From 9328d14d45bfc2e98820763586890827e13dc2e0 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sat, 8 Oct 2022 06:15:21 +0200 Subject: [PATCH] Use extern_methods! functionality To cut down on the amount of code, which should make things easier to review and understand. This uses features which are not actually yet done, see https://github.com/madsmtm/objc2/pull/244. Not happy with the formatting either, but not sure how to fix that? --- header-translator/src/lib.rs | 2 +- header-translator/src/method.rs | 38 +- .../Foundation/generated/FoundationErrors.rs | 2 +- .../FoundationLegacySwiftCompatibility.rs | 2 +- .../Foundation/generated/NSAffineTransform.rs | 77 +- .../generated/NSAppleEventDescriptor.rs | 326 ++--- .../generated/NSAppleEventManager.rs | 75 +- .../src/Foundation/generated/NSAppleScript.rs | 37 +- icrate/src/Foundation/generated/NSArchiver.rs | 128 +- icrate/src/Foundation/generated/NSArray.rs | 557 +++------ .../generated/NSAttributedString.rs | 441 ++----- .../Foundation/generated/NSAutoreleasePool.rs | 17 +- .../NSBackgroundActivityScheduler.rs | 67 +- icrate/src/Foundation/generated/NSBundle.rs | 446 +++---- .../generated/NSByteCountFormatter.rs | 128 +- .../src/Foundation/generated/NSByteOrder.rs | 2 +- icrate/src/Foundation/generated/NSCache.rs | 80 +- icrate/src/Foundation/generated/NSCalendar.rs | 688 ++++------ .../Foundation/generated/NSCalendarDate.rs | 234 ++-- .../Foundation/generated/NSCharacterSet.rs | 262 ++-- .../generated/NSClassDescription.rs | 66 +- icrate/src/Foundation/generated/NSCoder.rs | 331 ++--- .../generated/NSComparisonPredicate.rs | 67 +- .../generated/NSCompoundPredicate.rs | 37 +- .../src/Foundation/generated/NSConnection.rs | 256 ++-- icrate/src/Foundation/generated/NSData.rs | 345 ++--- icrate/src/Foundation/generated/NSDate.rs | 149 +-- .../generated/NSDateComponentsFormatter.rs | 157 +-- .../Foundation/generated/NSDateFormatter.rs | 429 +++---- .../Foundation/generated/NSDateInterval.rs | 62 +- .../generated/NSDateIntervalFormatter.rs | 72 +- icrate/src/Foundation/generated/NSDecimal.rs | 2 +- .../Foundation/generated/NSDecimalNumber.rs | 250 ++-- .../src/Foundation/generated/NSDictionary.rs | 333 ++--- .../Foundation/generated/NSDistantObject.rs | 45 +- .../Foundation/generated/NSDistributedLock.rs | 37 +- .../NSDistributedNotificationCenter.rs | 95 +- .../Foundation/generated/NSEnergyFormatter.rs | 62 +- .../src/Foundation/generated/NSEnumerator.rs | 12 +- icrate/src/Foundation/generated/NSError.rs | 102 +- .../src/Foundation/generated/NSException.rs | 67 +- .../src/Foundation/generated/NSExpression.rs | 203 +-- .../generated/NSExtensionContext.rs | 26 +- .../Foundation/generated/NSExtensionItem.rs | 42 +- .../generated/NSExtensionRequestHandling.rs | 2 +- .../Foundation/generated/NSFileCoordinator.rs | 142 +-- .../src/Foundation/generated/NSFileHandle.rs | 242 ++-- .../src/Foundation/generated/NSFileManager.rs | 600 +++------ .../Foundation/generated/NSFilePresenter.rs | 2 +- .../src/Foundation/generated/NSFileVersion.rs | 137 +- .../src/Foundation/generated/NSFileWrapper.rs | 198 ++- .../src/Foundation/generated/NSFormatter.rs | 53 +- .../generated/NSGarbageCollector.rs | 52 +- icrate/src/Foundation/generated/NSGeometry.rs | 102 +- .../Foundation/generated/NSHFSFileTypes.rs | 2 +- .../src/Foundation/generated/NSHTTPCookie.rs | 96 +- .../generated/NSHTTPCookieStorage.rs | 79 +- .../src/Foundation/generated/NSHashTable.rs | 116 +- icrate/src/Foundation/generated/NSHost.rs | 62 +- .../generated/NSISO8601DateFormatter.rs | 47 +- .../src/Foundation/generated/NSIndexPath.rs | 61 +- icrate/src/Foundation/generated/NSIndexSet.rs | 227 ++-- .../Foundation/generated/NSInflectionRule.rs | 32 +- .../src/Foundation/generated/NSInvocation.rs | 80 +- .../Foundation/generated/NSItemProvider.rs | 150 +-- .../generated/NSJSONSerialization.rs | 37 +- .../Foundation/generated/NSKeyValueCoding.rs | 187 ++- .../generated/NSKeyValueObserving.rs | 229 +--- .../Foundation/generated/NSKeyedArchiver.rs | 358 ++---- .../Foundation/generated/NSLengthFormatter.rs | 62 +- .../generated/NSLinguisticTagger.rs | 220 +--- .../Foundation/generated/NSListFormatter.rs | 37 +- icrate/src/Foundation/generated/NSLocale.rs | 267 ++-- icrate/src/Foundation/generated/NSLock.rs | 122 +- icrate/src/Foundation/generated/NSMapTable.rs | 126 +- .../Foundation/generated/NSMassFormatter.rs | 66 +- .../src/Foundation/generated/NSMeasurement.rs | 42 +- .../generated/NSMeasurementFormatter.rs | 52 +- icrate/src/Foundation/generated/NSMetadata.rs | 241 ++-- .../generated/NSMetadataAttributes.rs | 2 +- .../Foundation/generated/NSMethodSignature.rs | 37 +- .../src/Foundation/generated/NSMorphology.rs | 123 +- .../src/Foundation/generated/NSNetServices.rs | 182 ++- .../Foundation/generated/NSNotification.rs | 109 +- .../generated/NSNotificationQueue.rs | 41 +- icrate/src/Foundation/generated/NSNull.rs | 7 +- .../Foundation/generated/NSNumberFormatter.rs | 725 ++++------- .../src/Foundation/generated/NSObjCRuntime.rs | 2 +- icrate/src/Foundation/generated/NSObject.rs | 32 +- .../Foundation/generated/NSObjectScripting.rs | 38 +- .../src/Foundation/generated/NSOperation.rs | 258 ++-- .../generated/NSOrderedCollectionChange.rs | 47 +- .../NSOrderedCollectionDifference.rs | 58 +- .../src/Foundation/generated/NSOrderedSet.rs | 515 +++----- .../src/Foundation/generated/NSOrthography.rs | 61 +- .../Foundation/generated/NSPathUtilities.rs | 98 +- .../generated/NSPersonNameComponents.rs | 72 +- .../NSPersonNameComponentsFormatter.rs | 67 +- .../Foundation/generated/NSPointerArray.rs | 92 +- .../generated/NSPointerFunctions.rs | 95 +- icrate/src/Foundation/generated/NSPort.rs | 198 +-- .../src/Foundation/generated/NSPortCoder.rs | 62 +- .../src/Foundation/generated/NSPortMessage.rs | 42 +- .../Foundation/generated/NSPortNameServer.rs | 125 +- .../src/Foundation/generated/NSPredicate.rs | 94 +- .../src/Foundation/generated/NSProcessInfo.rs | 179 +-- icrate/src/Foundation/generated/NSProgress.rs | 302 ++--- .../Foundation/generated/NSPropertyList.rs | 40 +- .../Foundation/generated/NSProtocolChecker.rs | 26 +- icrate/src/Foundation/generated/NSProxy.rs | 62 +- icrate/src/Foundation/generated/NSRange.rs | 12 +- .../generated/NSRegularExpression.rs | 145 +-- .../generated/NSRelativeDateTimeFormatter.rs | 76 +- icrate/src/Foundation/generated/NSRunLoop.rs | 147 +-- icrate/src/Foundation/generated/NSScanner.rs | 137 +- .../generated/NSScriptClassDescription.rs | 125 +- .../generated/NSScriptCoercionHandler.rs | 23 +- .../Foundation/generated/NSScriptCommand.rs | 138 +- .../generated/NSScriptCommandDescription.rs | 87 +- .../generated/NSScriptExecutionContext.rs | 37 +- .../generated/NSScriptKeyValueCoding.rs | 52 +- .../generated/NSScriptObjectSpecifiers.rs | 411 +++--- .../NSScriptStandardSuiteCommands.rs | 62 +- .../generated/NSScriptSuiteRegistry.rs | 85 +- .../generated/NSScriptWhoseTests.rs | 137 +- icrate/src/Foundation/generated/NSSet.rs | 264 ++-- .../Foundation/generated/NSSortDescriptor.rs | 121 +- .../src/Foundation/generated/NSSpellServer.rs | 27 +- icrate/src/Foundation/generated/NSStream.rs | 191 +-- icrate/src/Foundation/generated/NSString.rs | 898 +++++-------- icrate/src/Foundation/generated/NSTask.rs | 195 ++- .../generated/NSTextCheckingResult.rs | 223 +--- icrate/src/Foundation/generated/NSThread.rs | 225 ++-- icrate/src/Foundation/generated/NSTimeZone.rs | 158 +-- icrate/src/Foundation/generated/NSTimer.rs | 135 +- icrate/src/Foundation/generated/NSURL.rs | 846 +++++-------- .../generated/NSURLAuthenticationChallenge.rs | 54 +- icrate/src/Foundation/generated/NSURLCache.rs | 150 +-- .../Foundation/generated/NSURLConnection.rs | 86 +- .../Foundation/generated/NSURLCredential.rs | 82 +- .../generated/NSURLCredentialStorage.rs | 107 +- .../src/Foundation/generated/NSURLDownload.rs | 55 +- icrate/src/Foundation/generated/NSURLError.rs | 2 +- .../src/Foundation/generated/NSURLHandle.rs | 122 +- .../generated/NSURLProtectionSpace.rs | 69 +- .../src/Foundation/generated/NSURLProtocol.rs | 105 +- .../src/Foundation/generated/NSURLRequest.rs | 298 ++--- .../src/Foundation/generated/NSURLResponse.rs | 69 +- .../src/Foundation/generated/NSURLSession.rs | 1108 ++++++----------- icrate/src/Foundation/generated/NSUUID.rs | 37 +- .../generated/NSUbiquitousKeyValueStore.rs | 105 +- .../src/Foundation/generated/NSUndoManager.rs | 177 +-- icrate/src/Foundation/generated/NSUnit.rs | 1090 +++++++--------- .../Foundation/generated/NSUserActivity.rs | 231 ++-- .../Foundation/generated/NSUserDefaults.rs | 195 ++- .../generated/NSUserNotification.rs | 271 ++-- .../Foundation/generated/NSUserScriptTask.rs | 80 +- icrate/src/Foundation/generated/NSValue.rs | 316 ++--- .../generated/NSValueTransformer.rs | 50 +- icrate/src/Foundation/generated/NSXMLDTD.rs | 101 +- .../src/Foundation/generated/NSXMLDTDNode.rs | 62 +- .../src/Foundation/generated/NSXMLDocument.rs | 177 +-- .../src/Foundation/generated/NSXMLElement.rs | 147 +-- icrate/src/Foundation/generated/NSXMLNode.rs | 284 ++--- .../Foundation/generated/NSXMLNodeOptions.rs | 2 +- .../src/Foundation/generated/NSXMLParser.rs | 124 +- .../Foundation/generated/NSXPCConnection.rs | 285 ++--- icrate/src/Foundation/generated/NSZone.rs | 2 +- 168 files changed, 9302 insertions(+), 16873 deletions(-) diff --git a/header-translator/src/lib.rs b/header-translator/src/lib.rs index 98d3d1782..bc9db61ed 100644 --- a/header-translator/src/lib.rs +++ b/header-translator/src/lib.rs @@ -57,7 +57,7 @@ impl RustFile { let tokens = quote! { #[allow(unused_imports)] - use objc2::{ClassType, extern_class, extern_methods, msg_send, msg_send_id}; + use objc2::{ClassType, extern_class, extern_methods}; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; diff --git a/header-translator/src/method.rs b/header-translator/src/method.rs index d8b1078e6..b2907799d 100644 --- a/header-translator/src/method.rs +++ b/header-translator/src/method.rs @@ -332,31 +332,15 @@ impl ToTokens for Method { .map(|(param, arg_ty)| quote!(#param: #arg_ty)) .collect(); - let method_call = if self.selector.contains(':') { - let split_selector: Vec<_> = self + let selector = if self.selector.contains(':') { + let iter = self .selector .split(':') .filter(|sel| !sel.is_empty()) - .collect(); + .map(|sel| format_ident!("{}", sel)); - assert!( - arguments.len() + (is_error as usize) == split_selector.len(), - "incorrect method argument length", - ); - - let iter = arguments - .into_iter() - .map(|(param, _)| param) - .chain(is_error.then(|| format_ident!("_"))) - .zip(split_selector) - .map(|(param, sel)| { - let sel = format_ident!("{}", sel); - quote!(#sel: #param) - }); - - quote!(#(#iter),*) + quote!(#(#iter:)*) } else { - assert_eq!(arguments.len(), 0, "too many arguments"); let sel = format_ident!("{}", self.selector); quote!(#sel) }; @@ -369,24 +353,22 @@ impl ToTokens for Method { }; let macro_name = if self.result_type.is_id() { - format_ident!("msg_send_id") + format_ident!("method_id") } else { - format_ident!("msg_send") + format_ident!("method") }; let unsafe_ = if self.safe { quote!() } else { quote!(unsafe) }; let result = if self.is_class { quote! { - pub #unsafe_ fn #fn_name(#(#fn_args),*) #ret { - #macro_name![Self::class(), #method_call] - } + #[#macro_name(#selector)] + pub #unsafe_ fn #fn_name(#(#fn_args),*) #ret; } } else { quote! { - pub #unsafe_ fn #fn_name(&self #(, #fn_args)*) #ret { - #macro_name![self, #method_call] - } + #[#macro_name(#selector)] + pub #unsafe_ fn #fn_name(&self #(, #fn_args)*) #ret; } }; tokens.append_all(result); diff --git a/icrate/src/Foundation/generated/FoundationErrors.rs b/icrate/src/Foundation/generated/FoundationErrors.rs index b935fd6ce..60e05e3b5 100644 --- a/icrate/src/Foundation/generated/FoundationErrors.rs +++ b/icrate/src/Foundation/generated/FoundationErrors.rs @@ -3,4 +3,4 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; diff --git a/icrate/src/Foundation/generated/FoundationLegacySwiftCompatibility.rs b/icrate/src/Foundation/generated/FoundationLegacySwiftCompatibility.rs index 97bb9cbef..5362722ad 100644 --- a/icrate/src/Foundation/generated/FoundationLegacySwiftCompatibility.rs +++ b/icrate/src/Foundation/generated/FoundationLegacySwiftCompatibility.rs @@ -2,4 +2,4 @@ use crate::Foundation::generated::NSObjCRuntime::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; diff --git a/icrate/src/Foundation/generated/NSAffineTransform.rs b/icrate/src/Foundation/generated/NSAffineTransform.rs index 5093f720f..faee75951 100644 --- a/icrate/src/Foundation/generated/NSAffineTransform.rs +++ b/icrate/src/Foundation/generated/NSAffineTransform.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSAffineTransform; @@ -14,50 +14,35 @@ extern_class!( ); extern_methods!( unsafe impl NSAffineTransform { - pub unsafe fn transform() -> Id { - msg_send_id![Self::class(), transform] - } - pub unsafe fn initWithTransform(&self, transform: &NSAffineTransform) -> Id { - msg_send_id![self, initWithTransform: transform] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn translateXBy_yBy(&self, deltaX: CGFloat, deltaY: CGFloat) { - msg_send![self, translateXBy: deltaX, yBy: deltaY] - } - pub unsafe fn rotateByDegrees(&self, angle: CGFloat) { - msg_send![self, rotateByDegrees: angle] - } - pub unsafe fn rotateByRadians(&self, angle: CGFloat) { - msg_send![self, rotateByRadians: angle] - } - pub unsafe fn scaleBy(&self, scale: CGFloat) { - msg_send![self, scaleBy: scale] - } - pub unsafe fn scaleXBy_yBy(&self, scaleX: CGFloat, scaleY: CGFloat) { - msg_send![self, scaleXBy: scaleX, yBy: scaleY] - } - pub unsafe fn invert(&self) { - msg_send![self, invert] - } - pub unsafe fn appendTransform(&self, transform: &NSAffineTransform) { - msg_send![self, appendTransform: transform] - } - pub unsafe fn prependTransform(&self, transform: &NSAffineTransform) { - msg_send![self, prependTransform: transform] - } - pub unsafe fn transformPoint(&self, aPoint: NSPoint) -> NSPoint { - msg_send![self, transformPoint: aPoint] - } - pub unsafe fn transformSize(&self, aSize: NSSize) -> NSSize { - msg_send![self, transformSize: aSize] - } - pub unsafe fn transformStruct(&self) -> NSAffineTransformStruct { - msg_send![self, transformStruct] - } - pub unsafe fn setTransformStruct(&self, transformStruct: NSAffineTransformStruct) { - msg_send![self, setTransformStruct: transformStruct] - } + #[method_id(transform)] + pub unsafe fn transform() -> Id; + # [method_id (initWithTransform :)] + pub unsafe fn initWithTransform(&self, transform: &NSAffineTransform) -> Id; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method (translateXBy : yBy :)] + pub unsafe fn translateXBy_yBy(&self, deltaX: CGFloat, deltaY: CGFloat); + # [method (rotateByDegrees :)] + pub unsafe fn rotateByDegrees(&self, angle: CGFloat); + # [method (rotateByRadians :)] + pub unsafe fn rotateByRadians(&self, angle: CGFloat); + # [method (scaleBy :)] + pub unsafe fn scaleBy(&self, scale: CGFloat); + # [method (scaleXBy : yBy :)] + pub unsafe fn scaleXBy_yBy(&self, scaleX: CGFloat, scaleY: CGFloat); + #[method(invert)] + pub unsafe fn invert(&self); + # [method (appendTransform :)] + pub unsafe fn appendTransform(&self, transform: &NSAffineTransform); + # [method (prependTransform :)] + pub unsafe fn prependTransform(&self, transform: &NSAffineTransform); + # [method (transformPoint :)] + pub unsafe fn transformPoint(&self, aPoint: NSPoint) -> NSPoint; + # [method (transformSize :)] + pub unsafe fn transformSize(&self, aSize: NSSize) -> NSSize; + #[method(transformStruct)] + pub unsafe fn transformStruct(&self) -> NSAffineTransformStruct; + # [method (setTransformStruct :)] + pub unsafe fn setTransformStruct(&self, transformStruct: NSAffineTransformStruct); } ); diff --git a/icrate/src/Foundation/generated/NSAppleEventDescriptor.rs b/icrate/src/Foundation/generated/NSAppleEventDescriptor.rs index 42f560343..884a6f454 100644 --- a/icrate/src/Foundation/generated/NSAppleEventDescriptor.rs +++ b/icrate/src/Foundation/generated/NSAppleEventDescriptor.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSAppleEventDescriptor; @@ -15,134 +15,85 @@ extern_class!( ); extern_methods!( unsafe impl NSAppleEventDescriptor { - pub unsafe fn nullDescriptor() -> Id { - msg_send_id![Self::class(), nullDescriptor] - } + #[method_id(nullDescriptor)] + pub unsafe fn nullDescriptor() -> Id; + # [method_id (descriptorWithDescriptorType : bytes : length :)] pub unsafe fn descriptorWithDescriptorType_bytes_length( descriptorType: DescType, bytes: *mut c_void, byteCount: NSUInteger, - ) -> Option> { - msg_send_id![ - Self::class(), - descriptorWithDescriptorType: descriptorType, - bytes: bytes, - length: byteCount - ] - } + ) -> Option>; + # [method_id (descriptorWithDescriptorType : data :)] pub unsafe fn descriptorWithDescriptorType_data( descriptorType: DescType, data: Option<&NSData>, - ) -> Option> { - msg_send_id![ - Self::class(), - descriptorWithDescriptorType: descriptorType, - data: data - ] - } - pub unsafe fn descriptorWithBoolean( - boolean: Boolean, - ) -> Id { - msg_send_id![Self::class(), descriptorWithBoolean: boolean] - } + ) -> Option>; + # [method_id (descriptorWithBoolean :)] + pub unsafe fn descriptorWithBoolean(boolean: Boolean) + -> Id; + # [method_id (descriptorWithEnumCode :)] pub unsafe fn descriptorWithEnumCode( enumerator: OSType, - ) -> Id { - msg_send_id![Self::class(), descriptorWithEnumCode: enumerator] - } - pub unsafe fn descriptorWithInt32(signedInt: SInt32) -> Id { - msg_send_id![Self::class(), descriptorWithInt32: signedInt] - } + ) -> Id; + # [method_id (descriptorWithInt32 :)] + pub unsafe fn descriptorWithInt32(signedInt: SInt32) -> Id; + # [method_id (descriptorWithDouble :)] pub unsafe fn descriptorWithDouble( doubleValue: c_double, - ) -> Id { - msg_send_id![Self::class(), descriptorWithDouble: doubleValue] - } + ) -> Id; + # [method_id (descriptorWithTypeCode :)] pub unsafe fn descriptorWithTypeCode( typeCode: OSType, - ) -> Id { - msg_send_id![Self::class(), descriptorWithTypeCode: typeCode] - } - pub unsafe fn descriptorWithString( - string: &NSString, - ) -> Id { - msg_send_id![Self::class(), descriptorWithString: string] - } - pub unsafe fn descriptorWithDate(date: &NSDate) -> Id { - msg_send_id![Self::class(), descriptorWithDate: date] - } - pub unsafe fn descriptorWithFileURL(fileURL: &NSURL) -> Id { - msg_send_id![Self::class(), descriptorWithFileURL: fileURL] - } + ) -> Id; + # [method_id (descriptorWithString :)] + pub unsafe fn descriptorWithString(string: &NSString) + -> Id; + # [method_id (descriptorWithDate :)] + pub unsafe fn descriptorWithDate(date: &NSDate) -> Id; + # [method_id (descriptorWithFileURL :)] + pub unsafe fn descriptorWithFileURL(fileURL: &NSURL) -> Id; + # [method_id (appleEventWithEventClass : eventID : targetDescriptor : returnID : transactionID :)] pub unsafe fn appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID( eventClass: AEEventClass, eventID: AEEventID, targetDescriptor: Option<&NSAppleEventDescriptor>, returnID: AEReturnID, transactionID: AETransactionID, - ) -> Id { - msg_send_id![ - Self::class(), - appleEventWithEventClass: eventClass, - eventID: eventID, - targetDescriptor: targetDescriptor, - returnID: returnID, - transactionID: transactionID - ] - } - pub unsafe fn listDescriptor() -> Id { - msg_send_id![Self::class(), listDescriptor] - } - pub unsafe fn recordDescriptor() -> Id { - msg_send_id![Self::class(), recordDescriptor] - } - pub unsafe fn currentProcessDescriptor() -> Id { - msg_send_id![Self::class(), currentProcessDescriptor] - } + ) -> Id; + #[method_id(listDescriptor)] + pub unsafe fn listDescriptor() -> Id; + #[method_id(recordDescriptor)] + pub unsafe fn recordDescriptor() -> Id; + #[method_id(currentProcessDescriptor)] + pub unsafe fn currentProcessDescriptor() -> Id; + # [method_id (descriptorWithProcessIdentifier :)] pub unsafe fn descriptorWithProcessIdentifier( processIdentifier: pid_t, - ) -> Id { - msg_send_id![ - Self::class(), - descriptorWithProcessIdentifier: processIdentifier - ] - } + ) -> Id; + # [method_id (descriptorWithBundleIdentifier :)] pub unsafe fn descriptorWithBundleIdentifier( bundleIdentifier: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - descriptorWithBundleIdentifier: bundleIdentifier - ] - } + ) -> Id; + # [method_id (descriptorWithApplicationURL :)] pub unsafe fn descriptorWithApplicationURL( applicationURL: &NSURL, - ) -> Id { - msg_send_id![Self::class(), descriptorWithApplicationURL: applicationURL] - } - pub unsafe fn initWithAEDescNoCopy(&self, aeDesc: NonNull) -> Id { - msg_send_id![self, initWithAEDescNoCopy: aeDesc] - } + ) -> Id; + # [method_id (initWithAEDescNoCopy :)] + pub unsafe fn initWithAEDescNoCopy(&self, aeDesc: NonNull) -> Id; + # [method_id (initWithDescriptorType : bytes : length :)] pub unsafe fn initWithDescriptorType_bytes_length( &self, descriptorType: DescType, bytes: *mut c_void, byteCount: NSUInteger, - ) -> Option> { - msg_send_id![ - self, - initWithDescriptorType: descriptorType, - bytes: bytes, - length: byteCount - ] - } + ) -> Option>; + # [method_id (initWithDescriptorType : data :)] pub unsafe fn initWithDescriptorType_data( &self, descriptorType: DescType, data: Option<&NSData>, - ) -> Option> { - msg_send_id![self, initWithDescriptorType: descriptorType, data: data] - } + ) -> Option>; + # [method_id (initWithEventClass : eventID : targetDescriptor : returnID : transactionID :)] pub unsafe fn initWithEventClass_eventID_targetDescriptor_returnID_transactionID( &self, eventClass: AEEventClass, @@ -150,158 +101,107 @@ extern_methods!( targetDescriptor: Option<&NSAppleEventDescriptor>, returnID: AEReturnID, transactionID: AETransactionID, - ) -> Id { - msg_send_id![ - self, - initWithEventClass: eventClass, - eventID: eventID, - targetDescriptor: targetDescriptor, - returnID: returnID, - transactionID: transactionID - ] - } - pub unsafe fn initListDescriptor(&self) -> Id { - msg_send_id![self, initListDescriptor] - } - pub unsafe fn initRecordDescriptor(&self) -> Id { - msg_send_id![self, initRecordDescriptor] - } - pub unsafe fn aeDesc(&self) -> *mut AEDesc { - msg_send![self, aeDesc] - } - pub unsafe fn descriptorType(&self) -> DescType { - msg_send![self, descriptorType] - } - pub unsafe fn data(&self) -> Id { - msg_send_id![self, data] - } - pub unsafe fn booleanValue(&self) -> Boolean { - msg_send![self, booleanValue] - } - pub unsafe fn enumCodeValue(&self) -> OSType { - msg_send![self, enumCodeValue] - } - pub unsafe fn int32Value(&self) -> SInt32 { - msg_send![self, int32Value] - } - pub unsafe fn doubleValue(&self) -> c_double { - msg_send![self, doubleValue] - } - pub unsafe fn typeCodeValue(&self) -> OSType { - msg_send![self, typeCodeValue] - } - pub unsafe fn stringValue(&self) -> Option> { - msg_send_id![self, stringValue] - } - pub unsafe fn dateValue(&self) -> Option> { - msg_send_id![self, dateValue] - } - pub unsafe fn fileURLValue(&self) -> Option> { - msg_send_id![self, fileURLValue] - } - pub unsafe fn eventClass(&self) -> AEEventClass { - msg_send![self, eventClass] - } - pub unsafe fn eventID(&self) -> AEEventID { - msg_send![self, eventID] - } - pub unsafe fn returnID(&self) -> AEReturnID { - msg_send![self, returnID] - } - pub unsafe fn transactionID(&self) -> AETransactionID { - msg_send![self, transactionID] - } + ) -> Id; + #[method_id(initListDescriptor)] + pub unsafe fn initListDescriptor(&self) -> Id; + #[method_id(initRecordDescriptor)] + pub unsafe fn initRecordDescriptor(&self) -> Id; + #[method(aeDesc)] + pub unsafe fn aeDesc(&self) -> *mut AEDesc; + #[method(descriptorType)] + pub unsafe fn descriptorType(&self) -> DescType; + #[method_id(data)] + pub unsafe fn data(&self) -> Id; + #[method(booleanValue)] + pub unsafe fn booleanValue(&self) -> Boolean; + #[method(enumCodeValue)] + pub unsafe fn enumCodeValue(&self) -> OSType; + #[method(int32Value)] + pub unsafe fn int32Value(&self) -> SInt32; + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + #[method(typeCodeValue)] + pub unsafe fn typeCodeValue(&self) -> OSType; + #[method_id(stringValue)] + pub unsafe fn stringValue(&self) -> Option>; + #[method_id(dateValue)] + pub unsafe fn dateValue(&self) -> Option>; + #[method_id(fileURLValue)] + pub unsafe fn fileURLValue(&self) -> Option>; + #[method(eventClass)] + pub unsafe fn eventClass(&self) -> AEEventClass; + #[method(eventID)] + pub unsafe fn eventID(&self) -> AEEventID; + #[method(returnID)] + pub unsafe fn returnID(&self) -> AEReturnID; + #[method(transactionID)] + pub unsafe fn transactionID(&self) -> AETransactionID; + # [method (setParamDescriptor : forKeyword :)] pub unsafe fn setParamDescriptor_forKeyword( &self, descriptor: &NSAppleEventDescriptor, keyword: AEKeyword, - ) { - msg_send![self, setParamDescriptor: descriptor, forKeyword: keyword] - } + ); + # [method_id (paramDescriptorForKeyword :)] pub unsafe fn paramDescriptorForKeyword( &self, keyword: AEKeyword, - ) -> Option> { - msg_send_id![self, paramDescriptorForKeyword: keyword] - } - pub unsafe fn removeParamDescriptorWithKeyword(&self, keyword: AEKeyword) { - msg_send![self, removeParamDescriptorWithKeyword: keyword] - } + ) -> Option>; + # [method (removeParamDescriptorWithKeyword :)] + pub unsafe fn removeParamDescriptorWithKeyword(&self, keyword: AEKeyword); + # [method (setAttributeDescriptor : forKeyword :)] pub unsafe fn setAttributeDescriptor_forKeyword( &self, descriptor: &NSAppleEventDescriptor, keyword: AEKeyword, - ) { - msg_send![ - self, - setAttributeDescriptor: descriptor, - forKeyword: keyword - ] - } + ); + # [method_id (attributeDescriptorForKeyword :)] pub unsafe fn attributeDescriptorForKeyword( &self, keyword: AEKeyword, - ) -> Option> { - msg_send_id![self, attributeDescriptorForKeyword: keyword] - } + ) -> Option>; + # [method_id (sendEventWithOptions : timeout : error :)] pub unsafe fn sendEventWithOptions_timeout_error( &self, sendOptions: NSAppleEventSendOptions, timeoutInSeconds: NSTimeInterval, - ) -> Result, Id> { - msg_send_id![ - self, - sendEventWithOptions: sendOptions, - timeout: timeoutInSeconds, - error: _ - ] - } - pub unsafe fn isRecordDescriptor(&self) -> bool { - msg_send![self, isRecordDescriptor] - } - pub unsafe fn numberOfItems(&self) -> NSInteger { - msg_send![self, numberOfItems] - } + ) -> Result, Id>; + #[method(isRecordDescriptor)] + pub unsafe fn isRecordDescriptor(&self) -> bool; + #[method(numberOfItems)] + pub unsafe fn numberOfItems(&self) -> NSInteger; + # [method (insertDescriptor : atIndex :)] pub unsafe fn insertDescriptor_atIndex( &self, descriptor: &NSAppleEventDescriptor, index: NSInteger, - ) { - msg_send![self, insertDescriptor: descriptor, atIndex: index] - } + ); + # [method_id (descriptorAtIndex :)] pub unsafe fn descriptorAtIndex( &self, index: NSInteger, - ) -> Option> { - msg_send_id![self, descriptorAtIndex: index] - } - pub unsafe fn removeDescriptorAtIndex(&self, index: NSInteger) { - msg_send![self, removeDescriptorAtIndex: index] - } + ) -> Option>; + # [method (removeDescriptorAtIndex :)] + pub unsafe fn removeDescriptorAtIndex(&self, index: NSInteger); + # [method (setDescriptor : forKeyword :)] pub unsafe fn setDescriptor_forKeyword( &self, descriptor: &NSAppleEventDescriptor, keyword: AEKeyword, - ) { - msg_send![self, setDescriptor: descriptor, forKeyword: keyword] - } + ); + # [method_id (descriptorForKeyword :)] pub unsafe fn descriptorForKeyword( &self, keyword: AEKeyword, - ) -> Option> { - msg_send_id![self, descriptorForKeyword: keyword] - } - pub unsafe fn removeDescriptorWithKeyword(&self, keyword: AEKeyword) { - msg_send![self, removeDescriptorWithKeyword: keyword] - } - pub unsafe fn keywordForDescriptorAtIndex(&self, index: NSInteger) -> AEKeyword { - msg_send![self, keywordForDescriptorAtIndex: index] - } + ) -> Option>; + # [method (removeDescriptorWithKeyword :)] + pub unsafe fn removeDescriptorWithKeyword(&self, keyword: AEKeyword); + # [method (keywordForDescriptorAtIndex :)] + pub unsafe fn keywordForDescriptorAtIndex(&self, index: NSInteger) -> AEKeyword; + # [method_id (coerceToDescriptorType :)] pub unsafe fn coerceToDescriptorType( &self, descriptorType: DescType, - ) -> Option> { - msg_send_id![self, coerceToDescriptorType: descriptorType] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSAppleEventManager.rs b/icrate/src/Foundation/generated/NSAppleEventManager.rs index 8e6f0f7c6..4659c2fa7 100644 --- a/icrate/src/Foundation/generated/NSAppleEventManager.rs +++ b/icrate/src/Foundation/generated/NSAppleEventManager.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSAppleEventManager; @@ -15,80 +15,51 @@ extern_class!( ); extern_methods!( unsafe impl NSAppleEventManager { - pub unsafe fn sharedAppleEventManager() -> Id { - msg_send_id![Self::class(), sharedAppleEventManager] - } + #[method_id(sharedAppleEventManager)] + pub unsafe fn sharedAppleEventManager() -> Id; + # [method (setEventHandler : andSelector : forEventClass : andEventID :)] pub unsafe fn setEventHandler_andSelector_forEventClass_andEventID( &self, handler: &Object, handleEventSelector: Sel, eventClass: AEEventClass, eventID: AEEventID, - ) { - msg_send![ - self, - setEventHandler: handler, - andSelector: handleEventSelector, - forEventClass: eventClass, - andEventID: eventID - ] - } + ); + # [method (removeEventHandlerForEventClass : andEventID :)] pub unsafe fn removeEventHandlerForEventClass_andEventID( &self, eventClass: AEEventClass, eventID: AEEventID, - ) { - msg_send![ - self, - removeEventHandlerForEventClass: eventClass, - andEventID: eventID - ] - } + ); + # [method (dispatchRawAppleEvent : withRawReply : handlerRefCon :)] pub unsafe fn dispatchRawAppleEvent_withRawReply_handlerRefCon( &self, theAppleEvent: NonNull, theReply: NonNull, handlerRefCon: SRefCon, - ) -> OSErr { - msg_send![ - self, - dispatchRawAppleEvent: theAppleEvent, - withRawReply: theReply, - handlerRefCon: handlerRefCon - ] - } - pub unsafe fn currentAppleEvent(&self) -> Option> { - msg_send_id![self, currentAppleEvent] - } - pub unsafe fn currentReplyAppleEvent(&self) -> Option> { - msg_send_id![self, currentReplyAppleEvent] - } - pub unsafe fn suspendCurrentAppleEvent(&self) -> NSAppleEventManagerSuspensionID { - msg_send![self, suspendCurrentAppleEvent] - } + ) -> OSErr; + #[method_id(currentAppleEvent)] + pub unsafe fn currentAppleEvent(&self) -> Option>; + #[method_id(currentReplyAppleEvent)] + pub unsafe fn currentReplyAppleEvent(&self) -> Option>; + #[method(suspendCurrentAppleEvent)] + pub unsafe fn suspendCurrentAppleEvent(&self) -> NSAppleEventManagerSuspensionID; + # [method_id (appleEventForSuspensionID :)] pub unsafe fn appleEventForSuspensionID( &self, suspensionID: NSAppleEventManagerSuspensionID, - ) -> Id { - msg_send_id![self, appleEventForSuspensionID: suspensionID] - } + ) -> Id; + # [method_id (replyAppleEventForSuspensionID :)] pub unsafe fn replyAppleEventForSuspensionID( &self, suspensionID: NSAppleEventManagerSuspensionID, - ) -> Id { - msg_send_id![self, replyAppleEventForSuspensionID: suspensionID] - } + ) -> Id; + # [method (setCurrentAppleEventAndReplyEventWithSuspensionID :)] pub unsafe fn setCurrentAppleEventAndReplyEventWithSuspensionID( &self, suspensionID: NSAppleEventManagerSuspensionID, - ) { - msg_send![ - self, - setCurrentAppleEventAndReplyEventWithSuspensionID: suspensionID - ] - } - pub unsafe fn resumeWithSuspensionID(&self, suspensionID: NSAppleEventManagerSuspensionID) { - msg_send![self, resumeWithSuspensionID: suspensionID] - } + ); + # [method (resumeWithSuspensionID :)] + pub unsafe fn resumeWithSuspensionID(&self, suspensionID: NSAppleEventManagerSuspensionID); } ); diff --git a/icrate/src/Foundation/generated/NSAppleScript.rs b/icrate/src/Foundation/generated/NSAppleScript.rs index a435eabd1..06d417f84 100644 --- a/icrate/src/Foundation/generated/NSAppleScript.rs +++ b/icrate/src/Foundation/generated/NSAppleScript.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSAppleScript; @@ -16,40 +16,33 @@ extern_class!( ); extern_methods!( unsafe impl NSAppleScript { + # [method_id (initWithContentsOfURL : error :)] pub unsafe fn initWithContentsOfURL_error( &self, url: &NSURL, errorInfo: Option<&mut Option, Shared>>>, - ) -> Option> { - msg_send_id![self, initWithContentsOfURL: url, error: errorInfo] - } - pub unsafe fn initWithSource(&self, source: &NSString) -> Option> { - msg_send_id![self, initWithSource: source] - } - pub unsafe fn source(&self) -> Option> { - msg_send_id![self, source] - } - pub unsafe fn isCompiled(&self) -> bool { - msg_send![self, isCompiled] - } + ) -> Option>; + # [method_id (initWithSource :)] + pub unsafe fn initWithSource(&self, source: &NSString) -> Option>; + #[method_id(source)] + pub unsafe fn source(&self) -> Option>; + #[method(isCompiled)] + pub unsafe fn isCompiled(&self) -> bool; + # [method (compileAndReturnError :)] pub unsafe fn compileAndReturnError( &self, errorInfo: Option<&mut Option, Shared>>>, - ) -> bool { - msg_send![self, compileAndReturnError: errorInfo] - } + ) -> bool; + # [method_id (executeAndReturnError :)] pub unsafe fn executeAndReturnError( &self, errorInfo: Option<&mut Option, Shared>>>, - ) -> Id { - msg_send_id![self, executeAndReturnError: errorInfo] - } + ) -> Id; + # [method_id (executeAppleEvent : error :)] pub unsafe fn executeAppleEvent_error( &self, event: &NSAppleEventDescriptor, errorInfo: Option<&mut Option, Shared>>>, - ) -> Id { - msg_send_id![self, executeAppleEvent: event, error: errorInfo] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSArchiver.rs b/icrate/src/Foundation/generated/NSArchiver.rs index 55addd1f0..8c96f192b 100644 --- a/icrate/src/Foundation/generated/NSArchiver.rs +++ b/icrate/src/Foundation/generated/NSArchiver.rs @@ -8,7 +8,7 @@ use crate::Foundation::generated::NSException::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSArchiver; @@ -18,47 +18,34 @@ extern_class!( ); extern_methods!( unsafe impl NSArchiver { + # [method_id (initForWritingWithMutableData :)] pub unsafe fn initForWritingWithMutableData( &self, mdata: &NSMutableData, - ) -> Id { - msg_send_id![self, initForWritingWithMutableData: mdata] - } - pub unsafe fn archiverData(&self) -> Id { - msg_send_id![self, archiverData] - } - pub unsafe fn encodeRootObject(&self, rootObject: &Object) { - msg_send![self, encodeRootObject: rootObject] - } - pub unsafe fn encodeConditionalObject(&self, object: Option<&Object>) { - msg_send![self, encodeConditionalObject: object] - } - pub unsafe fn archivedDataWithRootObject(rootObject: &Object) -> Id { - msg_send_id![Self::class(), archivedDataWithRootObject: rootObject] - } - pub unsafe fn archiveRootObject_toFile(rootObject: &Object, path: &NSString) -> bool { - msg_send![Self::class(), archiveRootObject: rootObject, toFile: path] - } + ) -> Id; + #[method_id(archiverData)] + pub unsafe fn archiverData(&self) -> Id; + # [method (encodeRootObject :)] + pub unsafe fn encodeRootObject(&self, rootObject: &Object); + # [method (encodeConditionalObject :)] + pub unsafe fn encodeConditionalObject(&self, object: Option<&Object>); + # [method_id (archivedDataWithRootObject :)] + pub unsafe fn archivedDataWithRootObject(rootObject: &Object) -> Id; + # [method (archiveRootObject : toFile :)] + pub unsafe fn archiveRootObject_toFile(rootObject: &Object, path: &NSString) -> bool; + # [method (encodeClassName : intoClassName :)] pub unsafe fn encodeClassName_intoClassName( &self, trueName: &NSString, inArchiveName: &NSString, - ) { - msg_send![ - self, - encodeClassName: trueName, - intoClassName: inArchiveName - ] - } + ); + # [method_id (classNameEncodedForTrueClassName :)] pub unsafe fn classNameEncodedForTrueClassName( &self, trueName: &NSString, - ) -> Option> { - msg_send_id![self, classNameEncodedForTrueClassName: trueName] - } - pub unsafe fn replaceObject_withObject(&self, object: &Object, newObject: &Object) { - msg_send![self, replaceObject: object, withObject: newObject] - } + ) -> Option>; + # [method (replaceObject : withObject :)] + pub unsafe fn replaceObject_withObject(&self, object: &Object, newObject: &Object); } ); extern_class!( @@ -70,71 +57,50 @@ extern_class!( ); extern_methods!( unsafe impl NSUnarchiver { - pub unsafe fn initForReadingWithData(&self, data: &NSData) -> Option> { - msg_send_id![self, initForReadingWithData: data] - } - pub unsafe fn setObjectZone(&self, zone: *mut NSZone) { - msg_send![self, setObjectZone: zone] - } - pub unsafe fn objectZone(&self) -> *mut NSZone { - msg_send![self, objectZone] - } - pub unsafe fn isAtEnd(&self) -> bool { - msg_send![self, isAtEnd] - } - pub unsafe fn systemVersion(&self) -> c_uint { - msg_send![self, systemVersion] - } - pub unsafe fn unarchiveObjectWithData(data: &NSData) -> Option> { - msg_send_id![Self::class(), unarchiveObjectWithData: data] - } - pub unsafe fn unarchiveObjectWithFile(path: &NSString) -> Option> { - msg_send_id![Self::class(), unarchiveObjectWithFile: path] - } - pub unsafe fn decodeClassName_asClassName(inArchiveName: &NSString, trueName: &NSString) { - msg_send![ - Self::class(), - decodeClassName: inArchiveName, - asClassName: trueName - ] - } + # [method_id (initForReadingWithData :)] + pub unsafe fn initForReadingWithData(&self, data: &NSData) -> Option>; + # [method (setObjectZone :)] + pub unsafe fn setObjectZone(&self, zone: *mut NSZone); + #[method(objectZone)] + pub unsafe fn objectZone(&self) -> *mut NSZone; + #[method(isAtEnd)] + pub unsafe fn isAtEnd(&self) -> bool; + #[method(systemVersion)] + pub unsafe fn systemVersion(&self) -> c_uint; + # [method_id (unarchiveObjectWithData :)] + pub unsafe fn unarchiveObjectWithData(data: &NSData) -> Option>; + # [method_id (unarchiveObjectWithFile :)] + pub unsafe fn unarchiveObjectWithFile(path: &NSString) -> Option>; + # [method (decodeClassName : asClassName :)] + pub unsafe fn decodeClassName_asClassName(inArchiveName: &NSString, trueName: &NSString); + # [method (decodeClassName : asClassName :)] pub unsafe fn decodeClassName_asClassName( &self, inArchiveName: &NSString, trueName: &NSString, - ) { - msg_send![self, decodeClassName: inArchiveName, asClassName: trueName] - } + ); + # [method_id (classNameDecodedForArchiveClassName :)] pub unsafe fn classNameDecodedForArchiveClassName( inArchiveName: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - classNameDecodedForArchiveClassName: inArchiveName - ] - } + ) -> Id; + # [method_id (classNameDecodedForArchiveClassName :)] pub unsafe fn classNameDecodedForArchiveClassName( &self, inArchiveName: &NSString, - ) -> Id { - msg_send_id![self, classNameDecodedForArchiveClassName: inArchiveName] - } - pub unsafe fn replaceObject_withObject(&self, object: &Object, newObject: &Object) { - msg_send![self, replaceObject: object, withObject: newObject] - } + ) -> Id; + # [method (replaceObject : withObject :)] + pub unsafe fn replaceObject_withObject(&self, object: &Object, newObject: &Object); } ); extern_methods!( #[doc = "NSArchiverCallback"] unsafe impl NSObject { - pub unsafe fn classForArchiver(&self) -> Option<&Class> { - msg_send![self, classForArchiver] - } + #[method(classForArchiver)] + pub unsafe fn classForArchiver(&self) -> Option<&Class>; + # [method_id (replacementObjectForArchiver :)] pub unsafe fn replacementObjectForArchiver( &self, archiver: &NSArchiver, - ) -> Option> { - msg_send_id![self, replacementObjectForArchiver: archiver] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSArray.rs b/icrate/src/Foundation/generated/NSArray.rs index 1849d0190..7a86e6268 100644 --- a/icrate/src/Foundation/generated/NSArray.rs +++ b/icrate/src/Foundation/generated/NSArray.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSRange::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; __inner_extern_class!( #[derive(Debug)] pub struct NSArray; @@ -20,391 +20,284 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSArray { - pub unsafe fn count(&self) -> NSUInteger { - msg_send![self, count] - } - pub unsafe fn objectAtIndex(&self, index: NSUInteger) -> Id { - msg_send_id![self, objectAtIndex: index] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + # [method_id (objectAtIndex :)] + pub unsafe fn objectAtIndex(&self, index: NSUInteger) -> Id; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithObjects : count :)] pub unsafe fn initWithObjects_count( &self, objects: TodoArray, cnt: NSUInteger, - ) -> Id { - msg_send_id![self, initWithObjects: objects, count: cnt] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSExtendedArray"] unsafe impl NSArray { + # [method_id (arrayByAddingObject :)] pub unsafe fn arrayByAddingObject( &self, anObject: &ObjectType, - ) -> Id, Shared> { - msg_send_id![self, arrayByAddingObject: anObject] - } + ) -> Id, Shared>; + # [method_id (arrayByAddingObjectsFromArray :)] pub unsafe fn arrayByAddingObjectsFromArray( &self, otherArray: &NSArray, - ) -> Id, Shared> { - msg_send_id![self, arrayByAddingObjectsFromArray: otherArray] - } - pub unsafe fn componentsJoinedByString( - &self, - separator: &NSString, - ) -> Id { - msg_send_id![self, componentsJoinedByString: separator] - } - pub unsafe fn containsObject(&self, anObject: &ObjectType) -> bool { - msg_send![self, containsObject: anObject] - } - pub unsafe fn description(&self) -> Id { - msg_send_id![self, description] - } - pub unsafe fn descriptionWithLocale( - &self, - locale: Option<&Object>, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale] - } + ) -> Id, Shared>; + # [method_id (componentsJoinedByString :)] + pub unsafe fn componentsJoinedByString(&self, separator: &NSString) + -> Id; + # [method (containsObject :)] + pub unsafe fn containsObject(&self, anObject: &ObjectType) -> bool; + #[method_id(description)] + pub unsafe fn description(&self) -> Id; + # [method_id (descriptionWithLocale :)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + # [method_id (descriptionWithLocale : indent :)] pub unsafe fn descriptionWithLocale_indent( &self, locale: Option<&Object>, level: NSUInteger, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale, indent: level] - } + ) -> Id; + # [method_id (firstObjectCommonWithArray :)] pub unsafe fn firstObjectCommonWithArray( &self, otherArray: &NSArray, - ) -> Option> { - msg_send_id![self, firstObjectCommonWithArray: otherArray] - } - pub unsafe fn getObjects_range(&self, objects: TodoArray, range: NSRange) { - msg_send![self, getObjects: objects, range: range] - } - pub unsafe fn indexOfObject(&self, anObject: &ObjectType) -> NSUInteger { - msg_send![self, indexOfObject: anObject] - } + ) -> Option>; + # [method (getObjects : range :)] + pub unsafe fn getObjects_range(&self, objects: TodoArray, range: NSRange); + # [method (indexOfObject :)] + pub unsafe fn indexOfObject(&self, anObject: &ObjectType) -> NSUInteger; + # [method (indexOfObject : inRange :)] pub unsafe fn indexOfObject_inRange( &self, anObject: &ObjectType, range: NSRange, - ) -> NSUInteger { - msg_send![self, indexOfObject: anObject, inRange: range] - } - pub unsafe fn indexOfObjectIdenticalTo(&self, anObject: &ObjectType) -> NSUInteger { - msg_send![self, indexOfObjectIdenticalTo: anObject] - } + ) -> NSUInteger; + # [method (indexOfObjectIdenticalTo :)] + pub unsafe fn indexOfObjectIdenticalTo(&self, anObject: &ObjectType) -> NSUInteger; + # [method (indexOfObjectIdenticalTo : inRange :)] pub unsafe fn indexOfObjectIdenticalTo_inRange( &self, anObject: &ObjectType, range: NSRange, - ) -> NSUInteger { - msg_send![self, indexOfObjectIdenticalTo: anObject, inRange: range] - } - pub unsafe fn isEqualToArray(&self, otherArray: &NSArray) -> bool { - msg_send![self, isEqualToArray: otherArray] - } - pub unsafe fn firstObject(&self) -> Option> { - msg_send_id![self, firstObject] - } - pub unsafe fn lastObject(&self) -> Option> { - msg_send_id![self, lastObject] - } - pub unsafe fn objectEnumerator(&self) -> Id, Shared> { - msg_send_id![self, objectEnumerator] - } - pub unsafe fn reverseObjectEnumerator(&self) -> Id, Shared> { - msg_send_id![self, reverseObjectEnumerator] - } - pub unsafe fn sortedArrayHint(&self) -> Id { - msg_send_id![self, sortedArrayHint] - } + ) -> NSUInteger; + # [method (isEqualToArray :)] + pub unsafe fn isEqualToArray(&self, otherArray: &NSArray) -> bool; + #[method_id(firstObject)] + pub unsafe fn firstObject(&self) -> Option>; + #[method_id(lastObject)] + pub unsafe fn lastObject(&self) -> Option>; + #[method_id(objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + #[method_id(reverseObjectEnumerator)] + pub unsafe fn reverseObjectEnumerator(&self) -> Id, Shared>; + #[method_id(sortedArrayHint)] + pub unsafe fn sortedArrayHint(&self) -> Id; + # [method_id (sortedArrayUsingFunction : context :)] pub unsafe fn sortedArrayUsingFunction_context( &self, comparator: NonNull, context: *mut c_void, - ) -> Id, Shared> { - msg_send_id![self, sortedArrayUsingFunction: comparator, context: context] - } + ) -> Id, Shared>; + # [method_id (sortedArrayUsingFunction : context : hint :)] pub unsafe fn sortedArrayUsingFunction_context_hint( &self, comparator: NonNull, context: *mut c_void, hint: Option<&NSData>, - ) -> Id, Shared> { - msg_send_id![ - self, - sortedArrayUsingFunction: comparator, - context: context, - hint: hint - ] - } + ) -> Id, Shared>; + # [method_id (sortedArrayUsingSelector :)] pub unsafe fn sortedArrayUsingSelector( &self, comparator: Sel, - ) -> Id, Shared> { - msg_send_id![self, sortedArrayUsingSelector: comparator] - } - pub unsafe fn subarrayWithRange(&self, range: NSRange) -> Id, Shared> { - msg_send_id![self, subarrayWithRange: range] - } - pub unsafe fn writeToURL_error(&self, url: &NSURL) -> Result<(), Id> { - msg_send![self, writeToURL: url, error: _] - } - pub unsafe fn makeObjectsPerformSelector(&self, aSelector: Sel) { - msg_send![self, makeObjectsPerformSelector: aSelector] - } + ) -> Id, Shared>; + # [method_id (subarrayWithRange :)] + pub unsafe fn subarrayWithRange(&self, range: NSRange) -> Id, Shared>; + # [method (writeToURL : error :)] + pub unsafe fn writeToURL_error(&self, url: &NSURL) -> Result<(), Id>; + # [method (makeObjectsPerformSelector :)] + pub unsafe fn makeObjectsPerformSelector(&self, aSelector: Sel); + # [method (makeObjectsPerformSelector : withObject :)] pub unsafe fn makeObjectsPerformSelector_withObject( &self, aSelector: Sel, argument: Option<&Object>, - ) { - msg_send![ - self, - makeObjectsPerformSelector: aSelector, - withObject: argument - ] - } + ); + # [method_id (objectsAtIndexes :)] pub unsafe fn objectsAtIndexes( &self, indexes: &NSIndexSet, - ) -> Id, Shared> { - msg_send_id![self, objectsAtIndexes: indexes] - } - pub unsafe fn objectAtIndexedSubscript(&self, idx: NSUInteger) -> Id { - msg_send_id![self, objectAtIndexedSubscript: idx] - } - pub unsafe fn enumerateObjectsUsingBlock(&self, block: TodoBlock) { - msg_send![self, enumerateObjectsUsingBlock: block] - } + ) -> Id, Shared>; + # [method_id (objectAtIndexedSubscript :)] + pub unsafe fn objectAtIndexedSubscript(&self, idx: NSUInteger) -> Id; + # [method (enumerateObjectsUsingBlock :)] + pub unsafe fn enumerateObjectsUsingBlock(&self, block: TodoBlock); + # [method (enumerateObjectsWithOptions : usingBlock :)] pub unsafe fn enumerateObjectsWithOptions_usingBlock( &self, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![self, enumerateObjectsWithOptions: opts, usingBlock: block] - } + ); + # [method (enumerateObjectsAtIndexes : options : usingBlock :)] pub unsafe fn enumerateObjectsAtIndexes_options_usingBlock( &self, s: &NSIndexSet, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateObjectsAtIndexes: s, - options: opts, - usingBlock: block - ] - } - pub unsafe fn indexOfObjectPassingTest(&self, predicate: TodoBlock) -> NSUInteger { - msg_send![self, indexOfObjectPassingTest: predicate] - } + ); + # [method (indexOfObjectPassingTest :)] + pub unsafe fn indexOfObjectPassingTest(&self, predicate: TodoBlock) -> NSUInteger; + # [method (indexOfObjectWithOptions : passingTest :)] pub unsafe fn indexOfObjectWithOptions_passingTest( &self, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> NSUInteger { - msg_send![self, indexOfObjectWithOptions: opts, passingTest: predicate] - } + ) -> NSUInteger; + # [method (indexOfObjectAtIndexes : options : passingTest :)] pub unsafe fn indexOfObjectAtIndexes_options_passingTest( &self, s: &NSIndexSet, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> NSUInteger { - msg_send![ - self, - indexOfObjectAtIndexes: s, - options: opts, - passingTest: predicate - ] - } + ) -> NSUInteger; + # [method_id (indexesOfObjectsPassingTest :)] pub unsafe fn indexesOfObjectsPassingTest( &self, predicate: TodoBlock, - ) -> Id { - msg_send_id![self, indexesOfObjectsPassingTest: predicate] - } + ) -> Id; + # [method_id (indexesOfObjectsWithOptions : passingTest :)] pub unsafe fn indexesOfObjectsWithOptions_passingTest( &self, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> Id { - msg_send_id![ - self, - indexesOfObjectsWithOptions: opts, - passingTest: predicate - ] - } + ) -> Id; + # [method_id (indexesOfObjectsAtIndexes : options : passingTest :)] pub unsafe fn indexesOfObjectsAtIndexes_options_passingTest( &self, s: &NSIndexSet, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> Id { - msg_send_id![ - self, - indexesOfObjectsAtIndexes: s, - options: opts, - passingTest: predicate - ] - } + ) -> Id; + # [method_id (sortedArrayUsingComparator :)] pub unsafe fn sortedArrayUsingComparator( &self, cmptr: NSComparator, - ) -> Id, Shared> { - msg_send_id![self, sortedArrayUsingComparator: cmptr] - } + ) -> Id, Shared>; + # [method_id (sortedArrayWithOptions : usingComparator :)] pub unsafe fn sortedArrayWithOptions_usingComparator( &self, opts: NSSortOptions, cmptr: NSComparator, - ) -> Id, Shared> { - msg_send_id![self, sortedArrayWithOptions: opts, usingComparator: cmptr] - } + ) -> Id, Shared>; + # [method (indexOfObject : inSortedRange : options : usingComparator :)] pub unsafe fn indexOfObject_inSortedRange_options_usingComparator( &self, obj: &ObjectType, r: NSRange, opts: NSBinarySearchingOptions, cmp: NSComparator, - ) -> NSUInteger { - msg_send![ - self, - indexOfObject: obj, - inSortedRange: r, - options: opts, - usingComparator: cmp - ] - } + ) -> NSUInteger; } ); extern_methods!( #[doc = "NSArrayCreation"] unsafe impl NSArray { - pub unsafe fn array() -> Id { - msg_send_id![Self::class(), array] - } - pub unsafe fn arrayWithObject(anObject: &ObjectType) -> Id { - msg_send_id![Self::class(), arrayWithObject: anObject] - } + #[method_id(array)] + pub unsafe fn array() -> Id; + # [method_id (arrayWithObject :)] + pub unsafe fn arrayWithObject(anObject: &ObjectType) -> Id; + # [method_id (arrayWithObjects : count :)] pub unsafe fn arrayWithObjects_count( objects: TodoArray, cnt: NSUInteger, - ) -> Id { - msg_send_id![Self::class(), arrayWithObjects: objects, count: cnt] - } - pub unsafe fn arrayWithArray(array: &NSArray) -> Id { - msg_send_id![Self::class(), arrayWithArray: array] - } - pub unsafe fn initWithArray(&self, array: &NSArray) -> Id { - msg_send_id![self, initWithArray: array] - } + ) -> Id; + # [method_id (arrayWithArray :)] + pub unsafe fn arrayWithArray(array: &NSArray) -> Id; + # [method_id (initWithArray :)] + pub unsafe fn initWithArray(&self, array: &NSArray) -> Id; + # [method_id (initWithArray : copyItems :)] pub unsafe fn initWithArray_copyItems( &self, array: &NSArray, flag: bool, - ) -> Id { - msg_send_id![self, initWithArray: array, copyItems: flag] - } + ) -> Id; + # [method_id (initWithContentsOfURL : error :)] pub unsafe fn initWithContentsOfURL_error( &self, url: &NSURL, - ) -> Result, Shared>, Id> { - msg_send_id![self, initWithContentsOfURL: url, error: _] - } + ) -> Result, Shared>, Id>; + # [method_id (arrayWithContentsOfURL : error :)] pub unsafe fn arrayWithContentsOfURL_error( url: &NSURL, - ) -> Result, Shared>, Id> { - msg_send_id![Self::class(), arrayWithContentsOfURL: url, error: _] - } + ) -> Result, Shared>, Id>; } ); extern_methods!( #[doc = "NSArrayDiffing"] unsafe impl NSArray { + # [method_id (differenceFromArray : withOptions : usingEquivalenceTest :)] pub unsafe fn differenceFromArray_withOptions_usingEquivalenceTest( &self, other: &NSArray, options: NSOrderedCollectionDifferenceCalculationOptions, block: TodoBlock, - ) -> Id, Shared> { - msg_send_id![ - self, - differenceFromArray: other, - withOptions: options, - usingEquivalenceTest: block - ] - } + ) -> Id, Shared>; + # [method_id (differenceFromArray : withOptions :)] pub unsafe fn differenceFromArray_withOptions( &self, other: &NSArray, options: NSOrderedCollectionDifferenceCalculationOptions, - ) -> Id, Shared> { - msg_send_id![self, differenceFromArray: other, withOptions: options] - } + ) -> Id, Shared>; + # [method_id (differenceFromArray :)] pub unsafe fn differenceFromArray( &self, other: &NSArray, - ) -> Id, Shared> { - msg_send_id![self, differenceFromArray: other] - } + ) -> Id, Shared>; + # [method_id (arrayByApplyingDifference :)] pub unsafe fn arrayByApplyingDifference( &self, difference: &NSOrderedCollectionDifference, - ) -> Option, Shared>> { - msg_send_id![self, arrayByApplyingDifference: difference] - } + ) -> Option, Shared>>; } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSArray { - pub unsafe fn getObjects(&self, objects: TodoArray) { - msg_send![self, getObjects: objects] - } + # [method (getObjects :)] + pub unsafe fn getObjects(&self, objects: TodoArray); + # [method_id (arrayWithContentsOfFile :)] pub unsafe fn arrayWithContentsOfFile( path: &NSString, - ) -> Option, Shared>> { - msg_send_id![Self::class(), arrayWithContentsOfFile: path] - } + ) -> Option, Shared>>; + # [method_id (arrayWithContentsOfURL :)] pub unsafe fn arrayWithContentsOfURL( url: &NSURL, - ) -> Option, Shared>> { - msg_send_id![Self::class(), arrayWithContentsOfURL: url] - } + ) -> Option, Shared>>; + # [method_id (initWithContentsOfFile :)] pub unsafe fn initWithContentsOfFile( &self, path: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, initWithContentsOfFile: path] - } + ) -> Option, Shared>>; + # [method_id (initWithContentsOfURL :)] pub unsafe fn initWithContentsOfURL( &self, url: &NSURL, - ) -> Option, Shared>> { - msg_send_id![self, initWithContentsOfURL: url] - } + ) -> Option, Shared>>; + # [method (writeToFile : atomically :)] pub unsafe fn writeToFile_atomically( &self, path: &NSString, useAuxiliaryFile: bool, - ) -> bool { - msg_send![self, writeToFile: path, atomically: useAuxiliaryFile] - } - pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool { - msg_send![self, writeToURL: url, atomically: atomically] - } + ) -> bool; + # [method (writeToURL : atomically :)] + pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool; } ); __inner_extern_class!( @@ -416,188 +309,140 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSMutableArray { - pub unsafe fn addObject(&self, anObject: &ObjectType) { - msg_send![self, addObject: anObject] - } - pub unsafe fn insertObject_atIndex(&self, anObject: &ObjectType, index: NSUInteger) { - msg_send![self, insertObject: anObject, atIndex: index] - } - pub unsafe fn removeLastObject(&self) { - msg_send![self, removeLastObject] - } - pub unsafe fn removeObjectAtIndex(&self, index: NSUInteger) { - msg_send![self, removeObjectAtIndex: index] - } + # [method (addObject :)] + pub unsafe fn addObject(&self, anObject: &ObjectType); + # [method (insertObject : atIndex :)] + pub unsafe fn insertObject_atIndex(&self, anObject: &ObjectType, index: NSUInteger); + #[method(removeLastObject)] + pub unsafe fn removeLastObject(&self); + # [method (removeObjectAtIndex :)] + pub unsafe fn removeObjectAtIndex(&self, index: NSUInteger); + # [method (replaceObjectAtIndex : withObject :)] pub unsafe fn replaceObjectAtIndex_withObject( &self, index: NSUInteger, anObject: &ObjectType, - ) { - msg_send![self, replaceObjectAtIndex: index, withObject: anObject] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithCapacity(&self, numItems: NSUInteger) -> Id { - msg_send_id![self, initWithCapacity: numItems] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ); + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithCapacity :)] + pub unsafe fn initWithCapacity(&self, numItems: NSUInteger) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSExtendedMutableArray"] unsafe impl NSMutableArray { - pub unsafe fn addObjectsFromArray(&self, otherArray: &NSArray) { - msg_send![self, addObjectsFromArray: otherArray] - } + # [method (addObjectsFromArray :)] + pub unsafe fn addObjectsFromArray(&self, otherArray: &NSArray); + # [method (exchangeObjectAtIndex : withObjectAtIndex :)] pub unsafe fn exchangeObjectAtIndex_withObjectAtIndex( &self, idx1: NSUInteger, idx2: NSUInteger, - ) { - msg_send![self, exchangeObjectAtIndex: idx1, withObjectAtIndex: idx2] - } - pub unsafe fn removeAllObjects(&self) { - msg_send![self, removeAllObjects] - } - pub unsafe fn removeObject_inRange(&self, anObject: &ObjectType, range: NSRange) { - msg_send![self, removeObject: anObject, inRange: range] - } - pub unsafe fn removeObject(&self, anObject: &ObjectType) { - msg_send![self, removeObject: anObject] - } - pub unsafe fn removeObjectIdenticalTo_inRange( - &self, - anObject: &ObjectType, - range: NSRange, - ) { - msg_send![self, removeObjectIdenticalTo: anObject, inRange: range] - } - pub unsafe fn removeObjectIdenticalTo(&self, anObject: &ObjectType) { - msg_send![self, removeObjectIdenticalTo: anObject] - } + ); + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + # [method (removeObject : inRange :)] + pub unsafe fn removeObject_inRange(&self, anObject: &ObjectType, range: NSRange); + # [method (removeObject :)] + pub unsafe fn removeObject(&self, anObject: &ObjectType); + # [method (removeObjectIdenticalTo : inRange :)] + pub unsafe fn removeObjectIdenticalTo_inRange(&self, anObject: &ObjectType, range: NSRange); + # [method (removeObjectIdenticalTo :)] + pub unsafe fn removeObjectIdenticalTo(&self, anObject: &ObjectType); + # [method (removeObjectsFromIndices : numIndices :)] pub unsafe fn removeObjectsFromIndices_numIndices( &self, indices: NonNull, cnt: NSUInteger, - ) { - msg_send![self, removeObjectsFromIndices: indices, numIndices: cnt] - } - pub unsafe fn removeObjectsInArray(&self, otherArray: &NSArray) { - msg_send![self, removeObjectsInArray: otherArray] - } - pub unsafe fn removeObjectsInRange(&self, range: NSRange) { - msg_send![self, removeObjectsInRange: range] - } + ); + # [method (removeObjectsInArray :)] + pub unsafe fn removeObjectsInArray(&self, otherArray: &NSArray); + # [method (removeObjectsInRange :)] + pub unsafe fn removeObjectsInRange(&self, range: NSRange); + # [method (replaceObjectsInRange : withObjectsFromArray : range :)] pub unsafe fn replaceObjectsInRange_withObjectsFromArray_range( &self, range: NSRange, otherArray: &NSArray, otherRange: NSRange, - ) { - msg_send![ - self, - replaceObjectsInRange: range, - withObjectsFromArray: otherArray, - range: otherRange - ] - } + ); + # [method (replaceObjectsInRange : withObjectsFromArray :)] pub unsafe fn replaceObjectsInRange_withObjectsFromArray( &self, range: NSRange, otherArray: &NSArray, - ) { - msg_send![ - self, - replaceObjectsInRange: range, - withObjectsFromArray: otherArray - ] - } - pub unsafe fn setArray(&self, otherArray: &NSArray) { - msg_send![self, setArray: otherArray] - } + ); + # [method (setArray :)] + pub unsafe fn setArray(&self, otherArray: &NSArray); + # [method (sortUsingFunction : context :)] pub unsafe fn sortUsingFunction_context( &self, compare: NonNull, context: *mut c_void, - ) { - msg_send![self, sortUsingFunction: compare, context: context] - } - pub unsafe fn sortUsingSelector(&self, comparator: Sel) { - msg_send![self, sortUsingSelector: comparator] - } + ); + # [method (sortUsingSelector :)] + pub unsafe fn sortUsingSelector(&self, comparator: Sel); + # [method (insertObjects : atIndexes :)] pub unsafe fn insertObjects_atIndexes( &self, objects: &NSArray, indexes: &NSIndexSet, - ) { - msg_send![self, insertObjects: objects, atIndexes: indexes] - } - pub unsafe fn removeObjectsAtIndexes(&self, indexes: &NSIndexSet) { - msg_send![self, removeObjectsAtIndexes: indexes] - } + ); + # [method (removeObjectsAtIndexes :)] + pub unsafe fn removeObjectsAtIndexes(&self, indexes: &NSIndexSet); + # [method (replaceObjectsAtIndexes : withObjects :)] pub unsafe fn replaceObjectsAtIndexes_withObjects( &self, indexes: &NSIndexSet, objects: &NSArray, - ) { - msg_send![self, replaceObjectsAtIndexes: indexes, withObjects: objects] - } - pub unsafe fn setObject_atIndexedSubscript(&self, obj: &ObjectType, idx: NSUInteger) { - msg_send![self, setObject: obj, atIndexedSubscript: idx] - } - pub unsafe fn sortUsingComparator(&self, cmptr: NSComparator) { - msg_send![self, sortUsingComparator: cmptr] - } + ); + # [method (setObject : atIndexedSubscript :)] + pub unsafe fn setObject_atIndexedSubscript(&self, obj: &ObjectType, idx: NSUInteger); + # [method (sortUsingComparator :)] + pub unsafe fn sortUsingComparator(&self, cmptr: NSComparator); + # [method (sortWithOptions : usingComparator :)] pub unsafe fn sortWithOptions_usingComparator( &self, opts: NSSortOptions, cmptr: NSComparator, - ) { - msg_send![self, sortWithOptions: opts, usingComparator: cmptr] - } + ); } ); extern_methods!( #[doc = "NSMutableArrayCreation"] unsafe impl NSMutableArray { - pub unsafe fn arrayWithCapacity(numItems: NSUInteger) -> Id { - msg_send_id![Self::class(), arrayWithCapacity: numItems] - } + # [method_id (arrayWithCapacity :)] + pub unsafe fn arrayWithCapacity(numItems: NSUInteger) -> Id; + # [method_id (arrayWithContentsOfFile :)] pub unsafe fn arrayWithContentsOfFile( path: &NSString, - ) -> Option, Shared>> { - msg_send_id![Self::class(), arrayWithContentsOfFile: path] - } + ) -> Option, Shared>>; + # [method_id (arrayWithContentsOfURL :)] pub unsafe fn arrayWithContentsOfURL( url: &NSURL, - ) -> Option, Shared>> { - msg_send_id![Self::class(), arrayWithContentsOfURL: url] - } + ) -> Option, Shared>>; + # [method_id (initWithContentsOfFile :)] pub unsafe fn initWithContentsOfFile( &self, path: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, initWithContentsOfFile: path] - } + ) -> Option, Shared>>; + # [method_id (initWithContentsOfURL :)] pub unsafe fn initWithContentsOfURL( &self, url: &NSURL, - ) -> Option, Shared>> { - msg_send_id![self, initWithContentsOfURL: url] - } + ) -> Option, Shared>>; } ); extern_methods!( #[doc = "NSMutableArrayDiffing"] unsafe impl NSMutableArray { + # [method (applyDifference :)] pub unsafe fn applyDifference( &self, difference: &NSOrderedCollectionDifference, - ) { - msg_send![self, applyDifference: difference] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSAttributedString.rs b/icrate/src/Foundation/generated/NSAttributedString.rs index 09c3be12d..d56491825 100644 --- a/icrate/src/Foundation/generated/NSAttributedString.rs +++ b/icrate/src/Foundation/generated/NSAttributedString.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSString::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSAttributedStringKey = NSString; extern_class!( #[derive(Debug)] @@ -14,118 +14,78 @@ extern_class!( ); extern_methods!( unsafe impl NSAttributedString { - pub unsafe fn string(&self) -> Id { - msg_send_id![self, string] - } + #[method_id(string)] + pub unsafe fn string(&self) -> Id; + # [method_id (attributesAtIndex : effectiveRange :)] pub unsafe fn attributesAtIndex_effectiveRange( &self, location: NSUInteger, range: NSRangePointer, - ) -> Id, Shared> { - msg_send_id![self, attributesAtIndex: location, effectiveRange: range] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSExtendedAttributedString"] unsafe impl NSAttributedString { - pub unsafe fn length(&self) -> NSUInteger { - msg_send![self, length] - } + #[method(length)] + pub unsafe fn length(&self) -> NSUInteger; + # [method_id (attribute : atIndex : effectiveRange :)] pub unsafe fn attribute_atIndex_effectiveRange( &self, attrName: &NSAttributedStringKey, location: NSUInteger, range: NSRangePointer, - ) -> Option> { - msg_send_id![ - self, - attribute: attrName, - atIndex: location, - effectiveRange: range - ] - } + ) -> Option>; + # [method_id (attributedSubstringFromRange :)] pub unsafe fn attributedSubstringFromRange( &self, range: NSRange, - ) -> Id { - msg_send_id![self, attributedSubstringFromRange: range] - } + ) -> Id; + # [method_id (attributesAtIndex : longestEffectiveRange : inRange :)] pub unsafe fn attributesAtIndex_longestEffectiveRange_inRange( &self, location: NSUInteger, range: NSRangePointer, rangeLimit: NSRange, - ) -> Id, Shared> { - msg_send_id![ - self, - attributesAtIndex: location, - longestEffectiveRange: range, - inRange: rangeLimit - ] - } + ) -> Id, Shared>; + # [method_id (attribute : atIndex : longestEffectiveRange : inRange :)] pub unsafe fn attribute_atIndex_longestEffectiveRange_inRange( &self, attrName: &NSAttributedStringKey, location: NSUInteger, range: NSRangePointer, rangeLimit: NSRange, - ) -> Option> { - msg_send_id![ - self, - attribute: attrName, - atIndex: location, - longestEffectiveRange: range, - inRange: rangeLimit - ] - } - pub unsafe fn isEqualToAttributedString(&self, other: &NSAttributedString) -> bool { - msg_send![self, isEqualToAttributedString: other] - } - pub unsafe fn initWithString(&self, str: &NSString) -> Id { - msg_send_id![self, initWithString: str] - } + ) -> Option>; + # [method (isEqualToAttributedString :)] + pub unsafe fn isEqualToAttributedString(&self, other: &NSAttributedString) -> bool; + # [method_id (initWithString :)] + pub unsafe fn initWithString(&self, str: &NSString) -> Id; + # [method_id (initWithString : attributes :)] pub unsafe fn initWithString_attributes( &self, str: &NSString, attrs: Option<&NSDictionary>, - ) -> Id { - msg_send_id![self, initWithString: str, attributes: attrs] - } + ) -> Id; + # [method_id (initWithAttributedString :)] pub unsafe fn initWithAttributedString( &self, attrStr: &NSAttributedString, - ) -> Id { - msg_send_id![self, initWithAttributedString: attrStr] - } + ) -> Id; + # [method (enumerateAttributesInRange : options : usingBlock :)] pub unsafe fn enumerateAttributesInRange_options_usingBlock( &self, enumerationRange: NSRange, opts: NSAttributedStringEnumerationOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateAttributesInRange: enumerationRange, - options: opts, - usingBlock: block - ] - } + ); + # [method (enumerateAttribute : inRange : options : usingBlock :)] pub unsafe fn enumerateAttribute_inRange_options_usingBlock( &self, attrName: &NSAttributedStringKey, enumerationRange: NSRange, opts: NSAttributedStringEnumerationOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateAttribute: attrName, - inRange: enumerationRange, - options: opts, - usingBlock: block - ] - } + ); } ); extern_class!( @@ -137,75 +97,58 @@ extern_class!( ); extern_methods!( unsafe impl NSMutableAttributedString { - pub unsafe fn replaceCharactersInRange_withString(&self, range: NSRange, str: &NSString) { - msg_send![self, replaceCharactersInRange: range, withString: str] - } + # [method (replaceCharactersInRange : withString :)] + pub unsafe fn replaceCharactersInRange_withString(&self, range: NSRange, str: &NSString); + # [method (setAttributes : range :)] pub unsafe fn setAttributes_range( &self, attrs: Option<&NSDictionary>, range: NSRange, - ) { - msg_send![self, setAttributes: attrs, range: range] - } + ); } ); extern_methods!( #[doc = "NSExtendedMutableAttributedString"] unsafe impl NSMutableAttributedString { - pub unsafe fn mutableString(&self) -> Id { - msg_send_id![self, mutableString] - } + #[method_id(mutableString)] + pub unsafe fn mutableString(&self) -> Id; + # [method (addAttribute : value : range :)] pub unsafe fn addAttribute_value_range( &self, name: &NSAttributedStringKey, value: &Object, range: NSRange, - ) { - msg_send![self, addAttribute: name, value: value, range: range] - } + ); + # [method (addAttributes : range :)] pub unsafe fn addAttributes_range( &self, attrs: &NSDictionary, range: NSRange, - ) { - msg_send![self, addAttributes: attrs, range: range] - } - pub unsafe fn removeAttribute_range(&self, name: &NSAttributedStringKey, range: NSRange) { - msg_send![self, removeAttribute: name, range: range] - } + ); + # [method (removeAttribute : range :)] + pub unsafe fn removeAttribute_range(&self, name: &NSAttributedStringKey, range: NSRange); + # [method (replaceCharactersInRange : withAttributedString :)] pub unsafe fn replaceCharactersInRange_withAttributedString( &self, range: NSRange, attrString: &NSAttributedString, - ) { - msg_send![ - self, - replaceCharactersInRange: range, - withAttributedString: attrString - ] - } + ); + # [method (insertAttributedString : atIndex :)] pub unsafe fn insertAttributedString_atIndex( &self, attrString: &NSAttributedString, loc: NSUInteger, - ) { - msg_send![self, insertAttributedString: attrString, atIndex: loc] - } - pub unsafe fn appendAttributedString(&self, attrString: &NSAttributedString) { - msg_send![self, appendAttributedString: attrString] - } - pub unsafe fn deleteCharactersInRange(&self, range: NSRange) { - msg_send![self, deleteCharactersInRange: range] - } - pub unsafe fn setAttributedString(&self, attrString: &NSAttributedString) { - msg_send![self, setAttributedString: attrString] - } - pub unsafe fn beginEditing(&self) { - msg_send![self, beginEditing] - } - pub unsafe fn endEditing(&self) { - msg_send![self, endEditing] - } + ); + # [method (appendAttributedString :)] + pub unsafe fn appendAttributedString(&self, attrString: &NSAttributedString); + # [method (deleteCharactersInRange :)] + pub unsafe fn deleteCharactersInRange(&self, range: NSRange); + # [method (setAttributedString :)] + pub unsafe fn setAttributedString(&self, attrString: &NSAttributedString); + #[method(beginEditing)] + pub unsafe fn beginEditing(&self); + #[method(endEditing)] + pub unsafe fn endEditing(&self); } ); extern_class!( @@ -217,106 +160,69 @@ extern_class!( ); extern_methods!( unsafe impl NSAttributedStringMarkdownParsingOptions { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn allowsExtendedAttributes(&self) -> bool { - msg_send![self, allowsExtendedAttributes] - } - pub unsafe fn setAllowsExtendedAttributes(&self, allowsExtendedAttributes: bool) { - msg_send![self, setAllowsExtendedAttributes: allowsExtendedAttributes] - } - pub unsafe fn interpretedSyntax(&self) -> NSAttributedStringMarkdownInterpretedSyntax { - msg_send![self, interpretedSyntax] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method(allowsExtendedAttributes)] + pub unsafe fn allowsExtendedAttributes(&self) -> bool; + # [method (setAllowsExtendedAttributes :)] + pub unsafe fn setAllowsExtendedAttributes(&self, allowsExtendedAttributes: bool); + #[method(interpretedSyntax)] + pub unsafe fn interpretedSyntax(&self) -> NSAttributedStringMarkdownInterpretedSyntax; + # [method (setInterpretedSyntax :)] pub unsafe fn setInterpretedSyntax( &self, interpretedSyntax: NSAttributedStringMarkdownInterpretedSyntax, - ) { - msg_send![self, setInterpretedSyntax: interpretedSyntax] - } - pub unsafe fn failurePolicy(&self) -> NSAttributedStringMarkdownParsingFailurePolicy { - msg_send![self, failurePolicy] - } + ); + #[method(failurePolicy)] + pub unsafe fn failurePolicy(&self) -> NSAttributedStringMarkdownParsingFailurePolicy; + # [method (setFailurePolicy :)] pub unsafe fn setFailurePolicy( &self, failurePolicy: NSAttributedStringMarkdownParsingFailurePolicy, - ) { - msg_send![self, setFailurePolicy: failurePolicy] - } - pub unsafe fn languageCode(&self) -> Option> { - msg_send_id![self, languageCode] - } - pub unsafe fn setLanguageCode(&self, languageCode: Option<&NSString>) { - msg_send![self, setLanguageCode: languageCode] - } + ); + #[method_id(languageCode)] + pub unsafe fn languageCode(&self) -> Option>; + # [method (setLanguageCode :)] + pub unsafe fn setLanguageCode(&self, languageCode: Option<&NSString>); } ); extern_methods!( #[doc = "NSAttributedStringCreateFromMarkdown"] unsafe impl NSAttributedString { + # [method_id (initWithContentsOfMarkdownFileAtURL : options : baseURL : error :)] pub unsafe fn initWithContentsOfMarkdownFileAtURL_options_baseURL_error( &self, markdownFile: &NSURL, options: Option<&NSAttributedStringMarkdownParsingOptions>, baseURL: Option<&NSURL>, - ) -> Result, Id> { - msg_send_id![ - self, - initWithContentsOfMarkdownFileAtURL: markdownFile, - options: options, - baseURL: baseURL, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (initWithMarkdown : options : baseURL : error :)] pub unsafe fn initWithMarkdown_options_baseURL_error( &self, markdown: &NSData, options: Option<&NSAttributedStringMarkdownParsingOptions>, baseURL: Option<&NSURL>, - ) -> Result, Id> { - msg_send_id![ - self, - initWithMarkdown: markdown, - options: options, - baseURL: baseURL, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (initWithMarkdownString : options : baseURL : error :)] pub unsafe fn initWithMarkdownString_options_baseURL_error( &self, markdownString: &NSString, options: Option<&NSAttributedStringMarkdownParsingOptions>, baseURL: Option<&NSURL>, - ) -> Result, Id> { - msg_send_id![ - self, - initWithMarkdownString: markdownString, - options: options, - baseURL: baseURL, - error: _ - ] - } + ) -> Result, Id>; } ); extern_methods!( #[doc = "NSAttributedStringFormatting"] unsafe impl NSAttributedString { + # [method_id (initWithFormat : options : locale : arguments :)] pub unsafe fn initWithFormat_options_locale_arguments( &self, format: &NSAttributedString, options: NSAttributedStringFormattingOptions, locale: Option<&NSLocale>, arguments: va_list, - ) -> Id { - msg_send_id![ - self, - initWithFormat: format, - options: options, - locale: locale, - arguments: arguments - ] - } + ) -> Id; } ); extern_methods!( @@ -326,9 +232,8 @@ extern_methods!( extern_methods!( #[doc = "NSMorphology"] unsafe impl NSAttributedString { - pub unsafe fn attributedStringByInflectingString(&self) -> Id { - msg_send_id![self, attributedStringByInflectingString] - } + #[method_id(attributedStringByInflectingString)] + pub unsafe fn attributedStringByInflectingString(&self) -> Id; } ); extern_class!( @@ -340,181 +245,99 @@ extern_class!( ); extern_methods!( unsafe impl NSPresentationIntent { - pub unsafe fn intentKind(&self) -> NSPresentationIntentKind { - msg_send![self, intentKind] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn parentIntent(&self) -> Option> { - msg_send_id![self, parentIntent] - } + #[method(intentKind)] + pub unsafe fn intentKind(&self) -> NSPresentationIntentKind; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(parentIntent)] + pub unsafe fn parentIntent(&self) -> Option>; + # [method_id (paragraphIntentWithIdentity : nestedInsideIntent :)] pub unsafe fn paragraphIntentWithIdentity_nestedInsideIntent( identity: NSInteger, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - paragraphIntentWithIdentity: identity, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (headerIntentWithIdentity : level : nestedInsideIntent :)] pub unsafe fn headerIntentWithIdentity_level_nestedInsideIntent( identity: NSInteger, level: NSInteger, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - headerIntentWithIdentity: identity, - level: level, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (codeBlockIntentWithIdentity : languageHint : nestedInsideIntent :)] pub unsafe fn codeBlockIntentWithIdentity_languageHint_nestedInsideIntent( identity: NSInteger, languageHint: Option<&NSString>, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - codeBlockIntentWithIdentity: identity, - languageHint: languageHint, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (thematicBreakIntentWithIdentity : nestedInsideIntent :)] pub unsafe fn thematicBreakIntentWithIdentity_nestedInsideIntent( identity: NSInteger, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - thematicBreakIntentWithIdentity: identity, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (orderedListIntentWithIdentity : nestedInsideIntent :)] pub unsafe fn orderedListIntentWithIdentity_nestedInsideIntent( identity: NSInteger, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - orderedListIntentWithIdentity: identity, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (unorderedListIntentWithIdentity : nestedInsideIntent :)] pub unsafe fn unorderedListIntentWithIdentity_nestedInsideIntent( identity: NSInteger, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - unorderedListIntentWithIdentity: identity, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (listItemIntentWithIdentity : ordinal : nestedInsideIntent :)] pub unsafe fn listItemIntentWithIdentity_ordinal_nestedInsideIntent( identity: NSInteger, ordinal: NSInteger, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - listItemIntentWithIdentity: identity, - ordinal: ordinal, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (blockQuoteIntentWithIdentity : nestedInsideIntent :)] pub unsafe fn blockQuoteIntentWithIdentity_nestedInsideIntent( identity: NSInteger, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - blockQuoteIntentWithIdentity: identity, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (tableIntentWithIdentity : columnCount : alignments : nestedInsideIntent :)] pub unsafe fn tableIntentWithIdentity_columnCount_alignments_nestedInsideIntent( identity: NSInteger, columnCount: NSInteger, alignments: &NSArray, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - tableIntentWithIdentity: identity, - columnCount: columnCount, - alignments: alignments, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (tableHeaderRowIntentWithIdentity : nestedInsideIntent :)] pub unsafe fn tableHeaderRowIntentWithIdentity_nestedInsideIntent( identity: NSInteger, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - tableHeaderRowIntentWithIdentity: identity, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (tableRowIntentWithIdentity : row : nestedInsideIntent :)] pub unsafe fn tableRowIntentWithIdentity_row_nestedInsideIntent( identity: NSInteger, row: NSInteger, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - tableRowIntentWithIdentity: identity, - row: row, - nestedInsideIntent: parent - ] - } + ) -> Id; + # [method_id (tableCellIntentWithIdentity : column : nestedInsideIntent :)] pub unsafe fn tableCellIntentWithIdentity_column_nestedInsideIntent( identity: NSInteger, column: NSInteger, parent: Option<&NSPresentationIntent>, - ) -> Id { - msg_send_id![ - Self::class(), - tableCellIntentWithIdentity: identity, - column: column, - nestedInsideIntent: parent - ] - } - pub unsafe fn identity(&self) -> NSInteger { - msg_send![self, identity] - } - pub unsafe fn ordinal(&self) -> NSInteger { - msg_send![self, ordinal] - } - pub unsafe fn columnAlignments(&self) -> Option, Shared>> { - msg_send_id![self, columnAlignments] - } - pub unsafe fn columnCount(&self) -> NSInteger { - msg_send![self, columnCount] - } - pub unsafe fn headerLevel(&self) -> NSInteger { - msg_send![self, headerLevel] - } - pub unsafe fn languageHint(&self) -> Option> { - msg_send_id![self, languageHint] - } - pub unsafe fn column(&self) -> NSInteger { - msg_send![self, column] - } - pub unsafe fn row(&self) -> NSInteger { - msg_send![self, row] - } - pub unsafe fn indentationLevel(&self) -> NSInteger { - msg_send![self, indentationLevel] - } - pub unsafe fn isEquivalentToPresentationIntent( - &self, - other: &NSPresentationIntent, - ) -> bool { - msg_send![self, isEquivalentToPresentationIntent: other] - } + ) -> Id; + #[method(identity)] + pub unsafe fn identity(&self) -> NSInteger; + #[method(ordinal)] + pub unsafe fn ordinal(&self) -> NSInteger; + #[method_id(columnAlignments)] + pub unsafe fn columnAlignments(&self) -> Option, Shared>>; + #[method(columnCount)] + pub unsafe fn columnCount(&self) -> NSInteger; + #[method(headerLevel)] + pub unsafe fn headerLevel(&self) -> NSInteger; + #[method_id(languageHint)] + pub unsafe fn languageHint(&self) -> Option>; + #[method(column)] + pub unsafe fn column(&self) -> NSInteger; + #[method(row)] + pub unsafe fn row(&self) -> NSInteger; + #[method(indentationLevel)] + pub unsafe fn indentationLevel(&self) -> NSInteger; + # [method (isEquivalentToPresentationIntent :)] + pub unsafe fn isEquivalentToPresentationIntent(&self, other: &NSPresentationIntent) + -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSAutoreleasePool.rs b/icrate/src/Foundation/generated/NSAutoreleasePool.rs index b6063842e..9e4089ac9 100644 --- a/icrate/src/Foundation/generated/NSAutoreleasePool.rs +++ b/icrate/src/Foundation/generated/NSAutoreleasePool.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSAutoreleasePool; @@ -12,14 +12,11 @@ extern_class!( ); extern_methods!( unsafe impl NSAutoreleasePool { - pub unsafe fn addObject(anObject: &Object) { - msg_send![Self::class(), addObject: anObject] - } - pub unsafe fn addObject(&self, anObject: &Object) { - msg_send![self, addObject: anObject] - } - pub unsafe fn drain(&self) { - msg_send![self, drain] - } + # [method (addObject :)] + pub unsafe fn addObject(anObject: &Object); + # [method (addObject :)] + pub unsafe fn addObject(&self, anObject: &Object); + #[method(drain)] + pub unsafe fn drain(&self); } ); diff --git a/icrate/src/Foundation/generated/NSBackgroundActivityScheduler.rs b/icrate/src/Foundation/generated/NSBackgroundActivityScheduler.rs index f0f9fa33d..d14ca5500 100644 --- a/icrate/src/Foundation/generated/NSBackgroundActivityScheduler.rs +++ b/icrate/src/Foundation/generated/NSBackgroundActivityScheduler.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSBackgroundActivityScheduler; @@ -14,44 +14,31 @@ extern_class!( ); extern_methods!( unsafe impl NSBackgroundActivityScheduler { - pub unsafe fn initWithIdentifier(&self, identifier: &NSString) -> Id { - msg_send_id![self, initWithIdentifier: identifier] - } - pub unsafe fn identifier(&self) -> Id { - msg_send_id![self, identifier] - } - pub unsafe fn qualityOfService(&self) -> NSQualityOfService { - msg_send![self, qualityOfService] - } - pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService) { - msg_send![self, setQualityOfService: qualityOfService] - } - pub unsafe fn repeats(&self) -> bool { - msg_send![self, repeats] - } - pub unsafe fn setRepeats(&self, repeats: bool) { - msg_send![self, setRepeats: repeats] - } - pub unsafe fn interval(&self) -> NSTimeInterval { - msg_send![self, interval] - } - pub unsafe fn setInterval(&self, interval: NSTimeInterval) { - msg_send![self, setInterval: interval] - } - pub unsafe fn tolerance(&self) -> NSTimeInterval { - msg_send![self, tolerance] - } - pub unsafe fn setTolerance(&self, tolerance: NSTimeInterval) { - msg_send![self, setTolerance: tolerance] - } - pub unsafe fn scheduleWithBlock(&self, block: TodoBlock) { - msg_send![self, scheduleWithBlock: block] - } - pub unsafe fn invalidate(&self) { - msg_send![self, invalidate] - } - pub unsafe fn shouldDefer(&self) -> bool { - msg_send![self, shouldDefer] - } + # [method_id (initWithIdentifier :)] + pub unsafe fn initWithIdentifier(&self, identifier: &NSString) -> Id; + #[method_id(identifier)] + pub unsafe fn identifier(&self) -> Id; + #[method(qualityOfService)] + pub unsafe fn qualityOfService(&self) -> NSQualityOfService; + # [method (setQualityOfService :)] + pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService); + #[method(repeats)] + pub unsafe fn repeats(&self) -> bool; + # [method (setRepeats :)] + pub unsafe fn setRepeats(&self, repeats: bool); + #[method(interval)] + pub unsafe fn interval(&self) -> NSTimeInterval; + # [method (setInterval :)] + pub unsafe fn setInterval(&self, interval: NSTimeInterval); + #[method(tolerance)] + pub unsafe fn tolerance(&self) -> NSTimeInterval; + # [method (setTolerance :)] + pub unsafe fn setTolerance(&self, tolerance: NSTimeInterval); + # [method (scheduleWithBlock :)] + pub unsafe fn scheduleWithBlock(&self, block: TodoBlock); + #[method(invalidate)] + pub unsafe fn invalidate(&self); + #[method(shouldDefer)] + pub unsafe fn shouldDefer(&self) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSBundle.rs b/icrate/src/Foundation/generated/NSBundle.rs index 47f385858..ffb54220f 100644 --- a/icrate/src/Foundation/generated/NSBundle.rs +++ b/icrate/src/Foundation/generated/NSBundle.rs @@ -14,7 +14,7 @@ use crate::Foundation::generated::NSString::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSBundle; @@ -24,357 +24,224 @@ extern_class!( ); extern_methods!( unsafe impl NSBundle { - pub unsafe fn mainBundle() -> Id { - msg_send_id![Self::class(), mainBundle] - } - pub unsafe fn bundleWithPath(path: &NSString) -> Option> { - msg_send_id![Self::class(), bundleWithPath: path] - } - pub unsafe fn initWithPath(&self, path: &NSString) -> Option> { - msg_send_id![self, initWithPath: path] - } - pub unsafe fn bundleWithURL(url: &NSURL) -> Option> { - msg_send_id![Self::class(), bundleWithURL: url] - } - pub unsafe fn initWithURL(&self, url: &NSURL) -> Option> { - msg_send_id![self, initWithURL: url] - } - pub unsafe fn bundleForClass(aClass: &Class) -> Id { - msg_send_id![Self::class(), bundleForClass: aClass] - } - pub unsafe fn bundleWithIdentifier(identifier: &NSString) -> Option> { - msg_send_id![Self::class(), bundleWithIdentifier: identifier] - } - pub unsafe fn allBundles() -> Id, Shared> { - msg_send_id![Self::class(), allBundles] - } - pub unsafe fn allFrameworks() -> Id, Shared> { - msg_send_id![Self::class(), allFrameworks] - } - pub unsafe fn load(&self) -> bool { - msg_send![self, load] - } - pub unsafe fn isLoaded(&self) -> bool { - msg_send![self, isLoaded] - } - pub unsafe fn unload(&self) -> bool { - msg_send![self, unload] - } - pub unsafe fn preflightAndReturnError(&self) -> Result<(), Id> { - msg_send![self, preflightAndReturnError: _] - } - pub unsafe fn loadAndReturnError(&self) -> Result<(), Id> { - msg_send![self, loadAndReturnError: _] - } - pub unsafe fn bundleURL(&self) -> Id { - msg_send_id![self, bundleURL] - } - pub unsafe fn resourceURL(&self) -> Option> { - msg_send_id![self, resourceURL] - } - pub unsafe fn executableURL(&self) -> Option> { - msg_send_id![self, executableURL] - } + #[method_id(mainBundle)] + pub unsafe fn mainBundle() -> Id; + # [method_id (bundleWithPath :)] + pub unsafe fn bundleWithPath(path: &NSString) -> Option>; + # [method_id (initWithPath :)] + pub unsafe fn initWithPath(&self, path: &NSString) -> Option>; + # [method_id (bundleWithURL :)] + pub unsafe fn bundleWithURL(url: &NSURL) -> Option>; + # [method_id (initWithURL :)] + pub unsafe fn initWithURL(&self, url: &NSURL) -> Option>; + # [method_id (bundleForClass :)] + pub unsafe fn bundleForClass(aClass: &Class) -> Id; + # [method_id (bundleWithIdentifier :)] + pub unsafe fn bundleWithIdentifier(identifier: &NSString) -> Option>; + #[method_id(allBundles)] + pub unsafe fn allBundles() -> Id, Shared>; + #[method_id(allFrameworks)] + pub unsafe fn allFrameworks() -> Id, Shared>; + #[method(load)] + pub unsafe fn load(&self) -> bool; + #[method(isLoaded)] + pub unsafe fn isLoaded(&self) -> bool; + #[method(unload)] + pub unsafe fn unload(&self) -> bool; + # [method (preflightAndReturnError :)] + pub unsafe fn preflightAndReturnError(&self) -> Result<(), Id>; + # [method (loadAndReturnError :)] + pub unsafe fn loadAndReturnError(&self) -> Result<(), Id>; + #[method_id(bundleURL)] + pub unsafe fn bundleURL(&self) -> Id; + #[method_id(resourceURL)] + pub unsafe fn resourceURL(&self) -> Option>; + #[method_id(executableURL)] + pub unsafe fn executableURL(&self) -> Option>; + # [method_id (URLForAuxiliaryExecutable :)] pub unsafe fn URLForAuxiliaryExecutable( &self, executableName: &NSString, - ) -> Option> { - msg_send_id![self, URLForAuxiliaryExecutable: executableName] - } - pub unsafe fn privateFrameworksURL(&self) -> Option> { - msg_send_id![self, privateFrameworksURL] - } - pub unsafe fn sharedFrameworksURL(&self) -> Option> { - msg_send_id![self, sharedFrameworksURL] - } - pub unsafe fn sharedSupportURL(&self) -> Option> { - msg_send_id![self, sharedSupportURL] - } - pub unsafe fn builtInPlugInsURL(&self) -> Option> { - msg_send_id![self, builtInPlugInsURL] - } - pub unsafe fn appStoreReceiptURL(&self) -> Option> { - msg_send_id![self, appStoreReceiptURL] - } - pub unsafe fn bundlePath(&self) -> Id { - msg_send_id![self, bundlePath] - } - pub unsafe fn resourcePath(&self) -> Option> { - msg_send_id![self, resourcePath] - } - pub unsafe fn executablePath(&self) -> Option> { - msg_send_id![self, executablePath] - } + ) -> Option>; + #[method_id(privateFrameworksURL)] + pub unsafe fn privateFrameworksURL(&self) -> Option>; + #[method_id(sharedFrameworksURL)] + pub unsafe fn sharedFrameworksURL(&self) -> Option>; + #[method_id(sharedSupportURL)] + pub unsafe fn sharedSupportURL(&self) -> Option>; + #[method_id(builtInPlugInsURL)] + pub unsafe fn builtInPlugInsURL(&self) -> Option>; + #[method_id(appStoreReceiptURL)] + pub unsafe fn appStoreReceiptURL(&self) -> Option>; + #[method_id(bundlePath)] + pub unsafe fn bundlePath(&self) -> Id; + #[method_id(resourcePath)] + pub unsafe fn resourcePath(&self) -> Option>; + #[method_id(executablePath)] + pub unsafe fn executablePath(&self) -> Option>; + # [method_id (pathForAuxiliaryExecutable :)] pub unsafe fn pathForAuxiliaryExecutable( &self, executableName: &NSString, - ) -> Option> { - msg_send_id![self, pathForAuxiliaryExecutable: executableName] - } - pub unsafe fn privateFrameworksPath(&self) -> Option> { - msg_send_id![self, privateFrameworksPath] - } - pub unsafe fn sharedFrameworksPath(&self) -> Option> { - msg_send_id![self, sharedFrameworksPath] - } - pub unsafe fn sharedSupportPath(&self) -> Option> { - msg_send_id![self, sharedSupportPath] - } - pub unsafe fn builtInPlugInsPath(&self) -> Option> { - msg_send_id![self, builtInPlugInsPath] - } + ) -> Option>; + #[method_id(privateFrameworksPath)] + pub unsafe fn privateFrameworksPath(&self) -> Option>; + #[method_id(sharedFrameworksPath)] + pub unsafe fn sharedFrameworksPath(&self) -> Option>; + #[method_id(sharedSupportPath)] + pub unsafe fn sharedSupportPath(&self) -> Option>; + #[method_id(builtInPlugInsPath)] + pub unsafe fn builtInPlugInsPath(&self) -> Option>; + # [method_id (URLForResource : withExtension : subdirectory : inBundleWithURL :)] pub unsafe fn URLForResource_withExtension_subdirectory_inBundleWithURL( name: Option<&NSString>, ext: Option<&NSString>, subpath: Option<&NSString>, bundleURL: &NSURL, - ) -> Option> { - msg_send_id![ - Self::class(), - URLForResource: name, - withExtension: ext, - subdirectory: subpath, - inBundleWithURL: bundleURL - ] - } + ) -> Option>; + # [method_id (URLsForResourcesWithExtension : subdirectory : inBundleWithURL :)] pub unsafe fn URLsForResourcesWithExtension_subdirectory_inBundleWithURL( ext: Option<&NSString>, subpath: Option<&NSString>, bundleURL: &NSURL, - ) -> Option, Shared>> { - msg_send_id![ - Self::class(), - URLsForResourcesWithExtension: ext, - subdirectory: subpath, - inBundleWithURL: bundleURL - ] - } + ) -> Option, Shared>>; + # [method_id (URLForResource : withExtension :)] pub unsafe fn URLForResource_withExtension( &self, name: Option<&NSString>, ext: Option<&NSString>, - ) -> Option> { - msg_send_id![self, URLForResource: name, withExtension: ext] - } + ) -> Option>; + # [method_id (URLForResource : withExtension : subdirectory :)] pub unsafe fn URLForResource_withExtension_subdirectory( &self, name: Option<&NSString>, ext: Option<&NSString>, subpath: Option<&NSString>, - ) -> Option> { - msg_send_id![ - self, - URLForResource: name, - withExtension: ext, - subdirectory: subpath - ] - } + ) -> Option>; + # [method_id (URLForResource : withExtension : subdirectory : localization :)] pub unsafe fn URLForResource_withExtension_subdirectory_localization( &self, name: Option<&NSString>, ext: Option<&NSString>, subpath: Option<&NSString>, localizationName: Option<&NSString>, - ) -> Option> { - msg_send_id![ - self, - URLForResource: name, - withExtension: ext, - subdirectory: subpath, - localization: localizationName - ] - } + ) -> Option>; + # [method_id (URLsForResourcesWithExtension : subdirectory :)] pub unsafe fn URLsForResourcesWithExtension_subdirectory( &self, ext: Option<&NSString>, subpath: Option<&NSString>, - ) -> Option, Shared>> { - msg_send_id![ - self, - URLsForResourcesWithExtension: ext, - subdirectory: subpath - ] - } + ) -> Option, Shared>>; + # [method_id (URLsForResourcesWithExtension : subdirectory : localization :)] pub unsafe fn URLsForResourcesWithExtension_subdirectory_localization( &self, ext: Option<&NSString>, subpath: Option<&NSString>, localizationName: Option<&NSString>, - ) -> Option, Shared>> { - msg_send_id![ - self, - URLsForResourcesWithExtension: ext, - subdirectory: subpath, - localization: localizationName - ] - } + ) -> Option, Shared>>; + # [method_id (pathForResource : ofType : inDirectory :)] pub unsafe fn pathForResource_ofType_inDirectory( name: Option<&NSString>, ext: Option<&NSString>, bundlePath: &NSString, - ) -> Option> { - msg_send_id![ - Self::class(), - pathForResource: name, - ofType: ext, - inDirectory: bundlePath - ] - } + ) -> Option>; + # [method_id (pathsForResourcesOfType : inDirectory :)] pub unsafe fn pathsForResourcesOfType_inDirectory( ext: Option<&NSString>, bundlePath: &NSString, - ) -> Id, Shared> { - msg_send_id![ - Self::class(), - pathsForResourcesOfType: ext, - inDirectory: bundlePath - ] - } + ) -> Id, Shared>; + # [method_id (pathForResource : ofType :)] pub unsafe fn pathForResource_ofType( &self, name: Option<&NSString>, ext: Option<&NSString>, - ) -> Option> { - msg_send_id![self, pathForResource: name, ofType: ext] - } + ) -> Option>; + # [method_id (pathForResource : ofType : inDirectory :)] pub unsafe fn pathForResource_ofType_inDirectory( &self, name: Option<&NSString>, ext: Option<&NSString>, subpath: Option<&NSString>, - ) -> Option> { - msg_send_id![ - self, - pathForResource: name, - ofType: ext, - inDirectory: subpath - ] - } + ) -> Option>; + # [method_id (pathForResource : ofType : inDirectory : forLocalization :)] pub unsafe fn pathForResource_ofType_inDirectory_forLocalization( &self, name: Option<&NSString>, ext: Option<&NSString>, subpath: Option<&NSString>, localizationName: Option<&NSString>, - ) -> Option> { - msg_send_id![ - self, - pathForResource: name, - ofType: ext, - inDirectory: subpath, - forLocalization: localizationName - ] - } + ) -> Option>; + # [method_id (pathsForResourcesOfType : inDirectory :)] pub unsafe fn pathsForResourcesOfType_inDirectory( &self, ext: Option<&NSString>, subpath: Option<&NSString>, - ) -> Id, Shared> { - msg_send_id![self, pathsForResourcesOfType: ext, inDirectory: subpath] - } + ) -> Id, Shared>; + # [method_id (pathsForResourcesOfType : inDirectory : forLocalization :)] pub unsafe fn pathsForResourcesOfType_inDirectory_forLocalization( &self, ext: Option<&NSString>, subpath: Option<&NSString>, localizationName: Option<&NSString>, - ) -> Id, Shared> { - msg_send_id![ - self, - pathsForResourcesOfType: ext, - inDirectory: subpath, - forLocalization: localizationName - ] - } + ) -> Id, Shared>; + # [method_id (localizedStringForKey : value : table :)] pub unsafe fn localizedStringForKey_value_table( &self, key: &NSString, value: Option<&NSString>, tableName: Option<&NSString>, - ) -> Id { - msg_send_id![ - self, - localizedStringForKey: key, - value: value, - table: tableName - ] - } + ) -> Id; + # [method_id (localizedAttributedStringForKey : value : table :)] pub unsafe fn localizedAttributedStringForKey_value_table( &self, key: &NSString, value: Option<&NSString>, tableName: Option<&NSString>, - ) -> Id { - msg_send_id![ - self, - localizedAttributedStringForKey: key, - value: value, - table: tableName - ] - } - pub unsafe fn bundleIdentifier(&self) -> Option> { - msg_send_id![self, bundleIdentifier] - } - pub unsafe fn infoDictionary(&self) -> Option, Shared>> { - msg_send_id![self, infoDictionary] - } + ) -> Id; + #[method_id(bundleIdentifier)] + pub unsafe fn bundleIdentifier(&self) -> Option>; + #[method_id(infoDictionary)] + pub unsafe fn infoDictionary(&self) -> Option, Shared>>; + #[method_id(localizedInfoDictionary)] pub unsafe fn localizedInfoDictionary( &self, - ) -> Option, Shared>> { - msg_send_id![self, localizedInfoDictionary] - } + ) -> Option, Shared>>; + # [method_id (objectForInfoDictionaryKey :)] pub unsafe fn objectForInfoDictionaryKey( &self, key: &NSString, - ) -> Option> { - msg_send_id![self, objectForInfoDictionaryKey: key] - } - pub unsafe fn classNamed(&self, className: &NSString) -> Option<&Class> { - msg_send![self, classNamed: className] - } - pub unsafe fn principalClass(&self) -> Option<&Class> { - msg_send![self, principalClass] - } - pub unsafe fn preferredLocalizations(&self) -> Id, Shared> { - msg_send_id![self, preferredLocalizations] - } - pub unsafe fn localizations(&self) -> Id, Shared> { - msg_send_id![self, localizations] - } - pub unsafe fn developmentLocalization(&self) -> Option> { - msg_send_id![self, developmentLocalization] - } + ) -> Option>; + # [method (classNamed :)] + pub unsafe fn classNamed(&self, className: &NSString) -> Option<&Class>; + #[method(principalClass)] + pub unsafe fn principalClass(&self) -> Option<&Class>; + #[method_id(preferredLocalizations)] + pub unsafe fn preferredLocalizations(&self) -> Id, Shared>; + #[method_id(localizations)] + pub unsafe fn localizations(&self) -> Id, Shared>; + #[method_id(developmentLocalization)] + pub unsafe fn developmentLocalization(&self) -> Option>; + # [method_id (preferredLocalizationsFromArray :)] pub unsafe fn preferredLocalizationsFromArray( localizationsArray: &NSArray, - ) -> Id, Shared> { - msg_send_id![ - Self::class(), - preferredLocalizationsFromArray: localizationsArray - ] - } + ) -> Id, Shared>; + # [method_id (preferredLocalizationsFromArray : forPreferences :)] pub unsafe fn preferredLocalizationsFromArray_forPreferences( localizationsArray: &NSArray, preferencesArray: Option<&NSArray>, - ) -> Id, Shared> { - msg_send_id![ - Self::class(), - preferredLocalizationsFromArray: localizationsArray, - forPreferences: preferencesArray - ] - } - pub unsafe fn executableArchitectures(&self) -> Option, Shared>> { - msg_send_id![self, executableArchitectures] - } + ) -> Id, Shared>; + #[method_id(executableArchitectures)] + pub unsafe fn executableArchitectures(&self) -> Option, Shared>>; } ); extern_methods!( #[doc = "NSBundleExtensionMethods"] unsafe impl NSString { + # [method_id (variantFittingPresentationWidth :)] pub unsafe fn variantFittingPresentationWidth( &self, width: NSInteger, - ) -> Id { - msg_send_id![self, variantFittingPresentationWidth: width] - } + ) -> Id; } ); extern_class!( @@ -386,69 +253,50 @@ extern_class!( ); extern_methods!( unsafe impl NSBundleResourceRequest { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithTags(&self, tags: &NSSet) -> Id { - msg_send_id![self, initWithTags: tags] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithTags :)] + pub unsafe fn initWithTags(&self, tags: &NSSet) -> Id; + # [method_id (initWithTags : bundle :)] pub unsafe fn initWithTags_bundle( &self, tags: &NSSet, bundle: &NSBundle, - ) -> Id { - msg_send_id![self, initWithTags: tags, bundle: bundle] - } - pub unsafe fn loadingPriority(&self) -> c_double { - msg_send![self, loadingPriority] - } - pub unsafe fn setLoadingPriority(&self, loadingPriority: c_double) { - msg_send![self, setLoadingPriority: loadingPriority] - } - pub unsafe fn tags(&self) -> Id, Shared> { - msg_send_id![self, tags] - } - pub unsafe fn bundle(&self) -> Id { - msg_send_id![self, bundle] - } + ) -> Id; + #[method(loadingPriority)] + pub unsafe fn loadingPriority(&self) -> c_double; + # [method (setLoadingPriority :)] + pub unsafe fn setLoadingPriority(&self, loadingPriority: c_double); + #[method_id(tags)] + pub unsafe fn tags(&self) -> Id, Shared>; + #[method_id(bundle)] + pub unsafe fn bundle(&self) -> Id; + # [method (beginAccessingResourcesWithCompletionHandler :)] pub unsafe fn beginAccessingResourcesWithCompletionHandler( &self, completionHandler: TodoBlock, - ) { - msg_send![ - self, - beginAccessingResourcesWithCompletionHandler: completionHandler - ] - } + ); + # [method (conditionallyBeginAccessingResourcesWithCompletionHandler :)] pub unsafe fn conditionallyBeginAccessingResourcesWithCompletionHandler( &self, completionHandler: TodoBlock, - ) { - msg_send![ - self, - conditionallyBeginAccessingResourcesWithCompletionHandler: completionHandler - ] - } - pub unsafe fn endAccessingResources(&self) { - msg_send![self, endAccessingResources] - } - pub unsafe fn progress(&self) -> Id { - msg_send_id![self, progress] - } + ); + #[method(endAccessingResources)] + pub unsafe fn endAccessingResources(&self); + #[method_id(progress)] + pub unsafe fn progress(&self) -> Id; } ); extern_methods!( #[doc = "NSBundleResourceRequestAdditions"] unsafe impl NSBundle { + # [method (setPreservationPriority : forTags :)] pub unsafe fn setPreservationPriority_forTags( &self, priority: c_double, tags: &NSSet, - ) { - msg_send![self, setPreservationPriority: priority, forTags: tags] - } - pub unsafe fn preservationPriorityForTag(&self, tag: &NSString) -> c_double { - msg_send![self, preservationPriorityForTag: tag] - } + ); + # [method (preservationPriorityForTag :)] + pub unsafe fn preservationPriorityForTag(&self, tag: &NSString) -> c_double; } ); diff --git a/icrate/src/Foundation/generated/NSByteCountFormatter.rs b/icrate/src/Foundation/generated/NSByteCountFormatter.rs index 4db8aa132..4423a1ffa 100644 --- a/icrate/src/Foundation/generated/NSByteCountFormatter.rs +++ b/icrate/src/Foundation/generated/NSByteCountFormatter.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSMeasurement::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSByteCountFormatter; @@ -13,97 +13,63 @@ extern_class!( ); extern_methods!( unsafe impl NSByteCountFormatter { + # [method_id (stringFromByteCount : countStyle :)] pub unsafe fn stringFromByteCount_countStyle( byteCount: c_longlong, countStyle: NSByteCountFormatterCountStyle, - ) -> Id { - msg_send_id![ - Self::class(), - stringFromByteCount: byteCount, - countStyle: countStyle - ] - } - pub unsafe fn stringFromByteCount(&self, byteCount: c_longlong) -> Id { - msg_send_id![self, stringFromByteCount: byteCount] - } + ) -> Id; + # [method_id (stringFromByteCount :)] + pub unsafe fn stringFromByteCount(&self, byteCount: c_longlong) -> Id; + # [method_id (stringFromMeasurement : countStyle :)] pub unsafe fn stringFromMeasurement_countStyle( measurement: &NSMeasurement, countStyle: NSByteCountFormatterCountStyle, - ) -> Id { - msg_send_id![ - Self::class(), - stringFromMeasurement: measurement, - countStyle: countStyle - ] - } + ) -> Id; + # [method_id (stringFromMeasurement :)] pub unsafe fn stringFromMeasurement( &self, measurement: &NSMeasurement, - ) -> Id { - msg_send_id![self, stringFromMeasurement: measurement] - } + ) -> Id; + # [method_id (stringForObjectValue :)] pub unsafe fn stringForObjectValue( &self, obj: Option<&Object>, - ) -> Option> { - msg_send_id![self, stringForObjectValue: obj] - } - pub unsafe fn allowedUnits(&self) -> NSByteCountFormatterUnits { - msg_send![self, allowedUnits] - } - pub unsafe fn setAllowedUnits(&self, allowedUnits: NSByteCountFormatterUnits) { - msg_send![self, setAllowedUnits: allowedUnits] - } - pub unsafe fn countStyle(&self) -> NSByteCountFormatterCountStyle { - msg_send![self, countStyle] - } - pub unsafe fn setCountStyle(&self, countStyle: NSByteCountFormatterCountStyle) { - msg_send![self, setCountStyle: countStyle] - } - pub unsafe fn allowsNonnumericFormatting(&self) -> bool { - msg_send![self, allowsNonnumericFormatting] - } - pub unsafe fn setAllowsNonnumericFormatting(&self, allowsNonnumericFormatting: bool) { - msg_send![ - self, - setAllowsNonnumericFormatting: allowsNonnumericFormatting - ] - } - pub unsafe fn includesUnit(&self) -> bool { - msg_send![self, includesUnit] - } - pub unsafe fn setIncludesUnit(&self, includesUnit: bool) { - msg_send![self, setIncludesUnit: includesUnit] - } - pub unsafe fn includesCount(&self) -> bool { - msg_send![self, includesCount] - } - pub unsafe fn setIncludesCount(&self, includesCount: bool) { - msg_send![self, setIncludesCount: includesCount] - } - pub unsafe fn includesActualByteCount(&self) -> bool { - msg_send![self, includesActualByteCount] - } - pub unsafe fn setIncludesActualByteCount(&self, includesActualByteCount: bool) { - msg_send![self, setIncludesActualByteCount: includesActualByteCount] - } - pub unsafe fn isAdaptive(&self) -> bool { - msg_send![self, isAdaptive] - } - pub unsafe fn setAdaptive(&self, adaptive: bool) { - msg_send![self, setAdaptive: adaptive] - } - pub unsafe fn zeroPadsFractionDigits(&self) -> bool { - msg_send![self, zeroPadsFractionDigits] - } - pub unsafe fn setZeroPadsFractionDigits(&self, zeroPadsFractionDigits: bool) { - msg_send![self, setZeroPadsFractionDigits: zeroPadsFractionDigits] - } - pub unsafe fn formattingContext(&self) -> NSFormattingContext { - msg_send![self, formattingContext] - } - pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext) { - msg_send![self, setFormattingContext: formattingContext] - } + ) -> Option>; + #[method(allowedUnits)] + pub unsafe fn allowedUnits(&self) -> NSByteCountFormatterUnits; + # [method (setAllowedUnits :)] + pub unsafe fn setAllowedUnits(&self, allowedUnits: NSByteCountFormatterUnits); + #[method(countStyle)] + pub unsafe fn countStyle(&self) -> NSByteCountFormatterCountStyle; + # [method (setCountStyle :)] + pub unsafe fn setCountStyle(&self, countStyle: NSByteCountFormatterCountStyle); + #[method(allowsNonnumericFormatting)] + pub unsafe fn allowsNonnumericFormatting(&self) -> bool; + # [method (setAllowsNonnumericFormatting :)] + pub unsafe fn setAllowsNonnumericFormatting(&self, allowsNonnumericFormatting: bool); + #[method(includesUnit)] + pub unsafe fn includesUnit(&self) -> bool; + # [method (setIncludesUnit :)] + pub unsafe fn setIncludesUnit(&self, includesUnit: bool); + #[method(includesCount)] + pub unsafe fn includesCount(&self) -> bool; + # [method (setIncludesCount :)] + pub unsafe fn setIncludesCount(&self, includesCount: bool); + #[method(includesActualByteCount)] + pub unsafe fn includesActualByteCount(&self) -> bool; + # [method (setIncludesActualByteCount :)] + pub unsafe fn setIncludesActualByteCount(&self, includesActualByteCount: bool); + #[method(isAdaptive)] + pub unsafe fn isAdaptive(&self) -> bool; + # [method (setAdaptive :)] + pub unsafe fn setAdaptive(&self, adaptive: bool); + #[method(zeroPadsFractionDigits)] + pub unsafe fn zeroPadsFractionDigits(&self) -> bool; + # [method (setZeroPadsFractionDigits :)] + pub unsafe fn setZeroPadsFractionDigits(&self, zeroPadsFractionDigits: bool); + #[method(formattingContext)] + pub unsafe fn formattingContext(&self) -> NSFormattingContext; + # [method (setFormattingContext :)] + pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext); } ); diff --git a/icrate/src/Foundation/generated/NSByteOrder.rs b/icrate/src/Foundation/generated/NSByteOrder.rs index 88346ff8e..9796b03ca 100644 --- a/icrate/src/Foundation/generated/NSByteOrder.rs +++ b/icrate/src/Foundation/generated/NSByteOrder.rs @@ -3,4 +3,4 @@ use crate::Foundation::generated::NSObjCRuntime::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; diff --git a/icrate/src/Foundation/generated/NSCache.rs b/icrate/src/Foundation/generated/NSCache.rs index c797b694c..65b648826 100644 --- a/icrate/src/Foundation/generated/NSCache.rs +++ b/icrate/src/Foundation/generated/NSCache.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; __inner_extern_class!( #[derive(Debug)] pub struct NSCache; @@ -13,57 +13,39 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSCache { - pub unsafe fn name(&self) -> Id { - msg_send_id![self, name] - } - pub unsafe fn setName(&self, name: &NSString) { - msg_send![self, setName: name] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSCacheDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn objectForKey(&self, key: &KeyType) -> Option> { - msg_send_id![self, objectForKey: key] - } - pub unsafe fn setObject_forKey(&self, obj: &ObjectType, key: &KeyType) { - msg_send![self, setObject: obj, forKey: key] - } - pub unsafe fn setObject_forKey_cost(&self, obj: &ObjectType, key: &KeyType, g: NSUInteger) { - msg_send![self, setObject: obj, forKey: key, cost: g] - } - pub unsafe fn removeObjectForKey(&self, key: &KeyType) { - msg_send![self, removeObjectForKey: key] - } - pub unsafe fn removeAllObjects(&self) { - msg_send![self, removeAllObjects] - } - pub unsafe fn totalCostLimit(&self) -> NSUInteger { - msg_send![self, totalCostLimit] - } - pub unsafe fn setTotalCostLimit(&self, totalCostLimit: NSUInteger) { - msg_send![self, setTotalCostLimit: totalCostLimit] - } - pub unsafe fn countLimit(&self) -> NSUInteger { - msg_send![self, countLimit] - } - pub unsafe fn setCountLimit(&self, countLimit: NSUInteger) { - msg_send![self, setCountLimit: countLimit] - } - pub unsafe fn evictsObjectsWithDiscardedContent(&self) -> bool { - msg_send![self, evictsObjectsWithDiscardedContent] - } + #[method_id(name)] + pub unsafe fn name(&self) -> Id; + # [method (setName :)] + pub unsafe fn setName(&self, name: &NSString); + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSCacheDelegate>); + # [method_id (objectForKey :)] + pub unsafe fn objectForKey(&self, key: &KeyType) -> Option>; + # [method (setObject : forKey :)] + pub unsafe fn setObject_forKey(&self, obj: &ObjectType, key: &KeyType); + # [method (setObject : forKey : cost :)] + pub unsafe fn setObject_forKey_cost(&self, obj: &ObjectType, key: &KeyType, g: NSUInteger); + # [method (removeObjectForKey :)] + pub unsafe fn removeObjectForKey(&self, key: &KeyType); + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + #[method(totalCostLimit)] + pub unsafe fn totalCostLimit(&self) -> NSUInteger; + # [method (setTotalCostLimit :)] + pub unsafe fn setTotalCostLimit(&self, totalCostLimit: NSUInteger); + #[method(countLimit)] + pub unsafe fn countLimit(&self) -> NSUInteger; + # [method (setCountLimit :)] + pub unsafe fn setCountLimit(&self, countLimit: NSUInteger); + #[method(evictsObjectsWithDiscardedContent)] + pub unsafe fn evictsObjectsWithDiscardedContent(&self) -> bool; + # [method (setEvictsObjectsWithDiscardedContent :)] pub unsafe fn setEvictsObjectsWithDiscardedContent( &self, evictsObjectsWithDiscardedContent: bool, - ) { - msg_send![ - self, - setEvictsObjectsWithDiscardedContent: evictsObjectsWithDiscardedContent - ] - } + ); } ); pub type NSCacheDelegate = NSObject; diff --git a/icrate/src/Foundation/generated/NSCalendar.rs b/icrate/src/Foundation/generated/NSCalendar.rs index a152e2b67..df16c8e31 100644 --- a/icrate/src/Foundation/generated/NSCalendar.rs +++ b/icrate/src/Foundation/generated/NSCalendar.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSRange::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSCalendarIdentifier = NSString; extern_class!( #[derive(Debug)] @@ -21,199 +21,132 @@ extern_class!( ); extern_methods!( unsafe impl NSCalendar { - pub unsafe fn currentCalendar() -> Id { - msg_send_id![Self::class(), currentCalendar] - } - pub unsafe fn autoupdatingCurrentCalendar() -> Id { - msg_send_id![Self::class(), autoupdatingCurrentCalendar] - } + #[method_id(currentCalendar)] + pub unsafe fn currentCalendar() -> Id; + #[method_id(autoupdatingCurrentCalendar)] + pub unsafe fn autoupdatingCurrentCalendar() -> Id; + # [method_id (calendarWithIdentifier :)] pub unsafe fn calendarWithIdentifier( calendarIdentifierConstant: &NSCalendarIdentifier, - ) -> Option> { - msg_send_id![ - Self::class(), - calendarWithIdentifier: calendarIdentifierConstant - ] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + ) -> Option>; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithCalendarIdentifier :)] pub unsafe fn initWithCalendarIdentifier( &self, ident: &NSCalendarIdentifier, - ) -> Option> { - msg_send_id![self, initWithCalendarIdentifier: ident] - } - pub unsafe fn calendarIdentifier(&self) -> Id { - msg_send_id![self, calendarIdentifier] - } - pub unsafe fn locale(&self) -> Option> { - msg_send_id![self, locale] - } - pub unsafe fn setLocale(&self, locale: Option<&NSLocale>) { - msg_send![self, setLocale: locale] - } - pub unsafe fn timeZone(&self) -> Id { - msg_send_id![self, timeZone] - } - pub unsafe fn setTimeZone(&self, timeZone: &NSTimeZone) { - msg_send![self, setTimeZone: timeZone] - } - pub unsafe fn firstWeekday(&self) -> NSUInteger { - msg_send![self, firstWeekday] - } - pub unsafe fn setFirstWeekday(&self, firstWeekday: NSUInteger) { - msg_send![self, setFirstWeekday: firstWeekday] - } - pub unsafe fn minimumDaysInFirstWeek(&self) -> NSUInteger { - msg_send![self, minimumDaysInFirstWeek] - } - pub unsafe fn setMinimumDaysInFirstWeek(&self, minimumDaysInFirstWeek: NSUInteger) { - msg_send![self, setMinimumDaysInFirstWeek: minimumDaysInFirstWeek] - } - pub unsafe fn eraSymbols(&self) -> Id, Shared> { - msg_send_id![self, eraSymbols] - } - pub unsafe fn longEraSymbols(&self) -> Id, Shared> { - msg_send_id![self, longEraSymbols] - } - pub unsafe fn monthSymbols(&self) -> Id, Shared> { - msg_send_id![self, monthSymbols] - } - pub unsafe fn shortMonthSymbols(&self) -> Id, Shared> { - msg_send_id![self, shortMonthSymbols] - } - pub unsafe fn veryShortMonthSymbols(&self) -> Id, Shared> { - msg_send_id![self, veryShortMonthSymbols] - } - pub unsafe fn standaloneMonthSymbols(&self) -> Id, Shared> { - msg_send_id![self, standaloneMonthSymbols] - } - pub unsafe fn shortStandaloneMonthSymbols(&self) -> Id, Shared> { - msg_send_id![self, shortStandaloneMonthSymbols] - } - pub unsafe fn veryShortStandaloneMonthSymbols(&self) -> Id, Shared> { - msg_send_id![self, veryShortStandaloneMonthSymbols] - } - pub unsafe fn weekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, weekdaySymbols] - } - pub unsafe fn shortWeekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, shortWeekdaySymbols] - } - pub unsafe fn veryShortWeekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, veryShortWeekdaySymbols] - } - pub unsafe fn standaloneWeekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, standaloneWeekdaySymbols] - } - pub unsafe fn shortStandaloneWeekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, shortStandaloneWeekdaySymbols] - } - pub unsafe fn veryShortStandaloneWeekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, veryShortStandaloneWeekdaySymbols] - } - pub unsafe fn quarterSymbols(&self) -> Id, Shared> { - msg_send_id![self, quarterSymbols] - } - pub unsafe fn shortQuarterSymbols(&self) -> Id, Shared> { - msg_send_id![self, shortQuarterSymbols] - } - pub unsafe fn standaloneQuarterSymbols(&self) -> Id, Shared> { - msg_send_id![self, standaloneQuarterSymbols] - } - pub unsafe fn shortStandaloneQuarterSymbols(&self) -> Id, Shared> { - msg_send_id![self, shortStandaloneQuarterSymbols] - } - pub unsafe fn AMSymbol(&self) -> Id { - msg_send_id![self, AMSymbol] - } - pub unsafe fn PMSymbol(&self) -> Id { - msg_send_id![self, PMSymbol] - } - pub unsafe fn minimumRangeOfUnit(&self, unit: NSCalendarUnit) -> NSRange { - msg_send![self, minimumRangeOfUnit: unit] - } - pub unsafe fn maximumRangeOfUnit(&self, unit: NSCalendarUnit) -> NSRange { - msg_send![self, maximumRangeOfUnit: unit] - } + ) -> Option>; + #[method_id(calendarIdentifier)] + pub unsafe fn calendarIdentifier(&self) -> Id; + #[method_id(locale)] + pub unsafe fn locale(&self) -> Option>; + # [method (setLocale :)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + #[method_id(timeZone)] + pub unsafe fn timeZone(&self) -> Id; + # [method (setTimeZone :)] + pub unsafe fn setTimeZone(&self, timeZone: &NSTimeZone); + #[method(firstWeekday)] + pub unsafe fn firstWeekday(&self) -> NSUInteger; + # [method (setFirstWeekday :)] + pub unsafe fn setFirstWeekday(&self, firstWeekday: NSUInteger); + #[method(minimumDaysInFirstWeek)] + pub unsafe fn minimumDaysInFirstWeek(&self) -> NSUInteger; + # [method (setMinimumDaysInFirstWeek :)] + pub unsafe fn setMinimumDaysInFirstWeek(&self, minimumDaysInFirstWeek: NSUInteger); + #[method_id(eraSymbols)] + pub unsafe fn eraSymbols(&self) -> Id, Shared>; + #[method_id(longEraSymbols)] + pub unsafe fn longEraSymbols(&self) -> Id, Shared>; + #[method_id(monthSymbols)] + pub unsafe fn monthSymbols(&self) -> Id, Shared>; + #[method_id(shortMonthSymbols)] + pub unsafe fn shortMonthSymbols(&self) -> Id, Shared>; + #[method_id(veryShortMonthSymbols)] + pub unsafe fn veryShortMonthSymbols(&self) -> Id, Shared>; + #[method_id(standaloneMonthSymbols)] + pub unsafe fn standaloneMonthSymbols(&self) -> Id, Shared>; + #[method_id(shortStandaloneMonthSymbols)] + pub unsafe fn shortStandaloneMonthSymbols(&self) -> Id, Shared>; + #[method_id(veryShortStandaloneMonthSymbols)] + pub unsafe fn veryShortStandaloneMonthSymbols(&self) -> Id, Shared>; + #[method_id(weekdaySymbols)] + pub unsafe fn weekdaySymbols(&self) -> Id, Shared>; + #[method_id(shortWeekdaySymbols)] + pub unsafe fn shortWeekdaySymbols(&self) -> Id, Shared>; + #[method_id(veryShortWeekdaySymbols)] + pub unsafe fn veryShortWeekdaySymbols(&self) -> Id, Shared>; + #[method_id(standaloneWeekdaySymbols)] + pub unsafe fn standaloneWeekdaySymbols(&self) -> Id, Shared>; + #[method_id(shortStandaloneWeekdaySymbols)] + pub unsafe fn shortStandaloneWeekdaySymbols(&self) -> Id, Shared>; + #[method_id(veryShortStandaloneWeekdaySymbols)] + pub unsafe fn veryShortStandaloneWeekdaySymbols(&self) -> Id, Shared>; + #[method_id(quarterSymbols)] + pub unsafe fn quarterSymbols(&self) -> Id, Shared>; + #[method_id(shortQuarterSymbols)] + pub unsafe fn shortQuarterSymbols(&self) -> Id, Shared>; + #[method_id(standaloneQuarterSymbols)] + pub unsafe fn standaloneQuarterSymbols(&self) -> Id, Shared>; + #[method_id(shortStandaloneQuarterSymbols)] + pub unsafe fn shortStandaloneQuarterSymbols(&self) -> Id, Shared>; + #[method_id(AMSymbol)] + pub unsafe fn AMSymbol(&self) -> Id; + #[method_id(PMSymbol)] + pub unsafe fn PMSymbol(&self) -> Id; + # [method (minimumRangeOfUnit :)] + pub unsafe fn minimumRangeOfUnit(&self, unit: NSCalendarUnit) -> NSRange; + # [method (maximumRangeOfUnit :)] + pub unsafe fn maximumRangeOfUnit(&self, unit: NSCalendarUnit) -> NSRange; + # [method (rangeOfUnit : inUnit : forDate :)] pub unsafe fn rangeOfUnit_inUnit_forDate( &self, smaller: NSCalendarUnit, larger: NSCalendarUnit, date: &NSDate, - ) -> NSRange { - msg_send![self, rangeOfUnit: smaller, inUnit: larger, forDate: date] - } + ) -> NSRange; + # [method (ordinalityOfUnit : inUnit : forDate :)] pub unsafe fn ordinalityOfUnit_inUnit_forDate( &self, smaller: NSCalendarUnit, larger: NSCalendarUnit, date: &NSDate, - ) -> NSUInteger { - msg_send![ - self, - ordinalityOfUnit: smaller, - inUnit: larger, - forDate: date - ] - } + ) -> NSUInteger; + # [method (rangeOfUnit : startDate : interval : forDate :)] pub unsafe fn rangeOfUnit_startDate_interval_forDate( &self, unit: NSCalendarUnit, datep: Option<&mut Option>>, tip: *mut NSTimeInterval, date: &NSDate, - ) -> bool { - msg_send![ - self, - rangeOfUnit: unit, - startDate: datep, - interval: tip, - forDate: date - ] - } + ) -> bool; + # [method_id (dateFromComponents :)] pub unsafe fn dateFromComponents( &self, comps: &NSDateComponents, - ) -> Option> { - msg_send_id![self, dateFromComponents: comps] - } + ) -> Option>; + # [method_id (components : fromDate :)] pub unsafe fn components_fromDate( &self, unitFlags: NSCalendarUnit, date: &NSDate, - ) -> Id { - msg_send_id![self, components: unitFlags, fromDate: date] - } + ) -> Id; + # [method_id (dateByAddingComponents : toDate : options :)] pub unsafe fn dateByAddingComponents_toDate_options( &self, comps: &NSDateComponents, date: &NSDate, opts: NSCalendarOptions, - ) -> Option> { - msg_send_id![ - self, - dateByAddingComponents: comps, - toDate: date, - options: opts - ] - } + ) -> Option>; + # [method_id (components : fromDate : toDate : options :)] pub unsafe fn components_fromDate_toDate_options( &self, unitFlags: NSCalendarUnit, startingDate: &NSDate, resultDate: &NSDate, opts: NSCalendarOptions, - ) -> Id { - msg_send_id![ - self, - components: unitFlags, - fromDate: startingDate, - toDate: resultDate, - options: opts - ] - } + ) -> Id; + # [method (getEra : year : month : day : fromDate :)] pub unsafe fn getEra_year_month_day_fromDate( &self, eraValuePointer: *mut NSInteger, @@ -221,16 +154,8 @@ extern_methods!( monthValuePointer: *mut NSInteger, dayValuePointer: *mut NSInteger, date: &NSDate, - ) { - msg_send![ - self, - getEra: eraValuePointer, - year: yearValuePointer, - month: monthValuePointer, - day: dayValuePointer, - fromDate: date - ] - } + ); + # [method (getEra : yearForWeekOfYear : weekOfYear : weekday : fromDate :)] pub unsafe fn getEra_yearForWeekOfYear_weekOfYear_weekday_fromDate( &self, eraValuePointer: *mut NSInteger, @@ -238,16 +163,8 @@ extern_methods!( weekValuePointer: *mut NSInteger, weekdayValuePointer: *mut NSInteger, date: &NSDate, - ) { - msg_send![ - self, - getEra: eraValuePointer, - yearForWeekOfYear: yearValuePointer, - weekOfYear: weekValuePointer, - weekday: weekdayValuePointer, - fromDate: date - ] - } + ); + # [method (getHour : minute : second : nanosecond : fromDate :)] pub unsafe fn getHour_minute_second_nanosecond_fromDate( &self, hourValuePointer: *mut NSInteger, @@ -255,19 +172,10 @@ extern_methods!( secondValuePointer: *mut NSInteger, nanosecondValuePointer: *mut NSInteger, date: &NSDate, - ) { - msg_send![ - self, - getHour: hourValuePointer, - minute: minuteValuePointer, - second: secondValuePointer, - nanosecond: nanosecondValuePointer, - fromDate: date - ] - } - pub unsafe fn component_fromDate(&self, unit: NSCalendarUnit, date: &NSDate) -> NSInteger { - msg_send![self, component: unit, fromDate: date] - } + ); + # [method (component : fromDate :)] + pub unsafe fn component_fromDate(&self, unit: NSCalendarUnit, date: &NSDate) -> NSInteger; + # [method_id (dateWithEra : year : month : day : hour : minute : second : nanosecond :)] pub unsafe fn dateWithEra_year_month_day_hour_minute_second_nanosecond( &self, eraValue: NSInteger, @@ -278,19 +186,8 @@ extern_methods!( minuteValue: NSInteger, secondValue: NSInteger, nanosecondValue: NSInteger, - ) -> Option> { - msg_send_id![ - self, - dateWithEra: eraValue, - year: yearValue, - month: monthValue, - day: dayValue, - hour: hourValue, - minute: minuteValue, - second: secondValue, - nanosecond: nanosecondValue - ] - } + ) -> Option>; + # [method_id (dateWithEra : yearForWeekOfYear : weekOfYear : weekday : hour : minute : second : nanosecond :)] pub unsafe fn dateWithEra_yearForWeekOfYear_weekOfYear_weekday_hour_minute_second_nanosecond( &self, eraValue: NSInteger, @@ -301,171 +198,94 @@ extern_methods!( minuteValue: NSInteger, secondValue: NSInteger, nanosecondValue: NSInteger, - ) -> Option> { - msg_send_id![ - self, - dateWithEra: eraValue, - yearForWeekOfYear: yearValue, - weekOfYear: weekValue, - weekday: weekdayValue, - hour: hourValue, - minute: minuteValue, - second: secondValue, - nanosecond: nanosecondValue - ] - } - pub unsafe fn startOfDayForDate(&self, date: &NSDate) -> Id { - msg_send_id![self, startOfDayForDate: date] - } + ) -> Option>; + # [method_id (startOfDayForDate :)] + pub unsafe fn startOfDayForDate(&self, date: &NSDate) -> Id; + # [method_id (componentsInTimeZone : fromDate :)] pub unsafe fn componentsInTimeZone_fromDate( &self, timezone: &NSTimeZone, date: &NSDate, - ) -> Id { - msg_send_id![self, componentsInTimeZone: timezone, fromDate: date] - } + ) -> Id; + # [method (compareDate : toDate : toUnitGranularity :)] pub unsafe fn compareDate_toDate_toUnitGranularity( &self, date1: &NSDate, date2: &NSDate, unit: NSCalendarUnit, - ) -> NSComparisonResult { - msg_send![ - self, - compareDate: date1, - toDate: date2, - toUnitGranularity: unit - ] - } + ) -> NSComparisonResult; + # [method (isDate : equalToDate : toUnitGranularity :)] pub unsafe fn isDate_equalToDate_toUnitGranularity( &self, date1: &NSDate, date2: &NSDate, unit: NSCalendarUnit, - ) -> bool { - msg_send![ - self, - isDate: date1, - equalToDate: date2, - toUnitGranularity: unit - ] - } - pub unsafe fn isDate_inSameDayAsDate(&self, date1: &NSDate, date2: &NSDate) -> bool { - msg_send![self, isDate: date1, inSameDayAsDate: date2] - } - pub unsafe fn isDateInToday(&self, date: &NSDate) -> bool { - msg_send![self, isDateInToday: date] - } - pub unsafe fn isDateInYesterday(&self, date: &NSDate) -> bool { - msg_send![self, isDateInYesterday: date] - } - pub unsafe fn isDateInTomorrow(&self, date: &NSDate) -> bool { - msg_send![self, isDateInTomorrow: date] - } - pub unsafe fn isDateInWeekend(&self, date: &NSDate) -> bool { - msg_send![self, isDateInWeekend: date] - } + ) -> bool; + # [method (isDate : inSameDayAsDate :)] + pub unsafe fn isDate_inSameDayAsDate(&self, date1: &NSDate, date2: &NSDate) -> bool; + # [method (isDateInToday :)] + pub unsafe fn isDateInToday(&self, date: &NSDate) -> bool; + # [method (isDateInYesterday :)] + pub unsafe fn isDateInYesterday(&self, date: &NSDate) -> bool; + # [method (isDateInTomorrow :)] + pub unsafe fn isDateInTomorrow(&self, date: &NSDate) -> bool; + # [method (isDateInWeekend :)] + pub unsafe fn isDateInWeekend(&self, date: &NSDate) -> bool; + # [method (rangeOfWeekendStartDate : interval : containingDate :)] pub unsafe fn rangeOfWeekendStartDate_interval_containingDate( &self, datep: Option<&mut Option>>, tip: *mut NSTimeInterval, date: &NSDate, - ) -> bool { - msg_send![ - self, - rangeOfWeekendStartDate: datep, - interval: tip, - containingDate: date - ] - } + ) -> bool; + # [method (nextWeekendStartDate : interval : options : afterDate :)] pub unsafe fn nextWeekendStartDate_interval_options_afterDate( &self, datep: Option<&mut Option>>, tip: *mut NSTimeInterval, options: NSCalendarOptions, date: &NSDate, - ) -> bool { - msg_send![ - self, - nextWeekendStartDate: datep, - interval: tip, - options: options, - afterDate: date - ] - } + ) -> bool; + # [method_id (components : fromDateComponents : toDateComponents : options :)] pub unsafe fn components_fromDateComponents_toDateComponents_options( &self, unitFlags: NSCalendarUnit, startingDateComp: &NSDateComponents, resultDateComp: &NSDateComponents, options: NSCalendarOptions, - ) -> Id { - msg_send_id![ - self, - components: unitFlags, - fromDateComponents: startingDateComp, - toDateComponents: resultDateComp, - options: options - ] - } + ) -> Id; + # [method_id (dateByAddingUnit : value : toDate : options :)] pub unsafe fn dateByAddingUnit_value_toDate_options( &self, unit: NSCalendarUnit, value: NSInteger, date: &NSDate, options: NSCalendarOptions, - ) -> Option> { - msg_send_id![ - self, - dateByAddingUnit: unit, - value: value, - toDate: date, - options: options - ] - } + ) -> Option>; + # [method (enumerateDatesStartingAfterDate : matchingComponents : options : usingBlock :)] pub unsafe fn enumerateDatesStartingAfterDate_matchingComponents_options_usingBlock( &self, start: &NSDate, comps: &NSDateComponents, opts: NSCalendarOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateDatesStartingAfterDate: start, - matchingComponents: comps, - options: opts, - usingBlock: block - ] - } + ); + # [method_id (nextDateAfterDate : matchingComponents : options :)] pub unsafe fn nextDateAfterDate_matchingComponents_options( &self, date: &NSDate, comps: &NSDateComponents, options: NSCalendarOptions, - ) -> Option> { - msg_send_id![ - self, - nextDateAfterDate: date, - matchingComponents: comps, - options: options - ] - } + ) -> Option>; + # [method_id (nextDateAfterDate : matchingUnit : value : options :)] pub unsafe fn nextDateAfterDate_matchingUnit_value_options( &self, date: &NSDate, unit: NSCalendarUnit, value: NSInteger, options: NSCalendarOptions, - ) -> Option> { - msg_send_id![ - self, - nextDateAfterDate: date, - matchingUnit: unit, - value: value, - options: options - ] - } + ) -> Option>; + # [method_id (nextDateAfterDate : matchingHour : minute : second : options :)] pub unsafe fn nextDateAfterDate_matchingHour_minute_second_options( &self, date: &NSDate, @@ -473,31 +293,16 @@ extern_methods!( minuteValue: NSInteger, secondValue: NSInteger, options: NSCalendarOptions, - ) -> Option> { - msg_send_id![ - self, - nextDateAfterDate: date, - matchingHour: hourValue, - minute: minuteValue, - second: secondValue, - options: options - ] - } + ) -> Option>; + # [method_id (dateBySettingUnit : value : ofDate : options :)] pub unsafe fn dateBySettingUnit_value_ofDate_options( &self, unit: NSCalendarUnit, v: NSInteger, date: &NSDate, opts: NSCalendarOptions, - ) -> Option> { - msg_send_id![ - self, - dateBySettingUnit: unit, - value: v, - ofDate: date, - options: opts - ] - } + ) -> Option>; + # [method_id (dateBySettingHour : minute : second : ofDate : options :)] pub unsafe fn dateBySettingHour_minute_second_ofDate_options( &self, h: NSInteger, @@ -505,23 +310,13 @@ extern_methods!( s: NSInteger, date: &NSDate, opts: NSCalendarOptions, - ) -> Option> { - msg_send_id![ - self, - dateBySettingHour: h, - minute: m, - second: s, - ofDate: date, - options: opts - ] - } + ) -> Option>; + # [method (date : matchesComponents :)] pub unsafe fn date_matchesComponents( &self, date: &NSDate, components: &NSDateComponents, - ) -> bool { - msg_send![self, date: date, matchesComponents: components] - } + ) -> bool; } ); extern_class!( @@ -533,128 +328,87 @@ extern_class!( ); extern_methods!( unsafe impl NSDateComponents { - pub unsafe fn calendar(&self) -> Option> { - msg_send_id![self, calendar] - } - pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>) { - msg_send![self, setCalendar: calendar] - } - pub unsafe fn timeZone(&self) -> Option> { - msg_send_id![self, timeZone] - } - pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>) { - msg_send![self, setTimeZone: timeZone] - } - pub unsafe fn era(&self) -> NSInteger { - msg_send![self, era] - } - pub unsafe fn setEra(&self, era: NSInteger) { - msg_send![self, setEra: era] - } - pub unsafe fn year(&self) -> NSInteger { - msg_send![self, year] - } - pub unsafe fn setYear(&self, year: NSInteger) { - msg_send![self, setYear: year] - } - pub unsafe fn month(&self) -> NSInteger { - msg_send![self, month] - } - pub unsafe fn setMonth(&self, month: NSInteger) { - msg_send![self, setMonth: month] - } - pub unsafe fn day(&self) -> NSInteger { - msg_send![self, day] - } - pub unsafe fn setDay(&self, day: NSInteger) { - msg_send![self, setDay: day] - } - pub unsafe fn hour(&self) -> NSInteger { - msg_send![self, hour] - } - pub unsafe fn setHour(&self, hour: NSInteger) { - msg_send![self, setHour: hour] - } - pub unsafe fn minute(&self) -> NSInteger { - msg_send![self, minute] - } - pub unsafe fn setMinute(&self, minute: NSInteger) { - msg_send![self, setMinute: minute] - } - pub unsafe fn second(&self) -> NSInteger { - msg_send![self, second] - } - pub unsafe fn setSecond(&self, second: NSInteger) { - msg_send![self, setSecond: second] - } - pub unsafe fn nanosecond(&self) -> NSInteger { - msg_send![self, nanosecond] - } - pub unsafe fn setNanosecond(&self, nanosecond: NSInteger) { - msg_send![self, setNanosecond: nanosecond] - } - pub unsafe fn weekday(&self) -> NSInteger { - msg_send![self, weekday] - } - pub unsafe fn setWeekday(&self, weekday: NSInteger) { - msg_send![self, setWeekday: weekday] - } - pub unsafe fn weekdayOrdinal(&self) -> NSInteger { - msg_send![self, weekdayOrdinal] - } - pub unsafe fn setWeekdayOrdinal(&self, weekdayOrdinal: NSInteger) { - msg_send![self, setWeekdayOrdinal: weekdayOrdinal] - } - pub unsafe fn quarter(&self) -> NSInteger { - msg_send![self, quarter] - } - pub unsafe fn setQuarter(&self, quarter: NSInteger) { - msg_send![self, setQuarter: quarter] - } - pub unsafe fn weekOfMonth(&self) -> NSInteger { - msg_send![self, weekOfMonth] - } - pub unsafe fn setWeekOfMonth(&self, weekOfMonth: NSInteger) { - msg_send![self, setWeekOfMonth: weekOfMonth] - } - pub unsafe fn weekOfYear(&self) -> NSInteger { - msg_send![self, weekOfYear] - } - pub unsafe fn setWeekOfYear(&self, weekOfYear: NSInteger) { - msg_send![self, setWeekOfYear: weekOfYear] - } - pub unsafe fn yearForWeekOfYear(&self) -> NSInteger { - msg_send![self, yearForWeekOfYear] - } - pub unsafe fn setYearForWeekOfYear(&self, yearForWeekOfYear: NSInteger) { - msg_send![self, setYearForWeekOfYear: yearForWeekOfYear] - } - pub unsafe fn isLeapMonth(&self) -> bool { - msg_send![self, isLeapMonth] - } - pub unsafe fn setLeapMonth(&self, leapMonth: bool) { - msg_send![self, setLeapMonth: leapMonth] - } - pub unsafe fn date(&self) -> Option> { - msg_send_id![self, date] - } - pub unsafe fn week(&self) -> NSInteger { - msg_send![self, week] - } - pub unsafe fn setWeek(&self, v: NSInteger) { - msg_send![self, setWeek: v] - } - pub unsafe fn setValue_forComponent(&self, value: NSInteger, unit: NSCalendarUnit) { - msg_send![self, setValue: value, forComponent: unit] - } - pub unsafe fn valueForComponent(&self, unit: NSCalendarUnit) -> NSInteger { - msg_send![self, valueForComponent: unit] - } - pub unsafe fn isValidDate(&self) -> bool { - msg_send![self, isValidDate] - } - pub unsafe fn isValidDateInCalendar(&self, calendar: &NSCalendar) -> bool { - msg_send![self, isValidDateInCalendar: calendar] - } + #[method_id(calendar)] + pub unsafe fn calendar(&self) -> Option>; + # [method (setCalendar :)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + #[method_id(timeZone)] + pub unsafe fn timeZone(&self) -> Option>; + # [method (setTimeZone :)] + pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>); + #[method(era)] + pub unsafe fn era(&self) -> NSInteger; + # [method (setEra :)] + pub unsafe fn setEra(&self, era: NSInteger); + #[method(year)] + pub unsafe fn year(&self) -> NSInteger; + # [method (setYear :)] + pub unsafe fn setYear(&self, year: NSInteger); + #[method(month)] + pub unsafe fn month(&self) -> NSInteger; + # [method (setMonth :)] + pub unsafe fn setMonth(&self, month: NSInteger); + #[method(day)] + pub unsafe fn day(&self) -> NSInteger; + # [method (setDay :)] + pub unsafe fn setDay(&self, day: NSInteger); + #[method(hour)] + pub unsafe fn hour(&self) -> NSInteger; + # [method (setHour :)] + pub unsafe fn setHour(&self, hour: NSInteger); + #[method(minute)] + pub unsafe fn minute(&self) -> NSInteger; + # [method (setMinute :)] + pub unsafe fn setMinute(&self, minute: NSInteger); + #[method(second)] + pub unsafe fn second(&self) -> NSInteger; + # [method (setSecond :)] + pub unsafe fn setSecond(&self, second: NSInteger); + #[method(nanosecond)] + pub unsafe fn nanosecond(&self) -> NSInteger; + # [method (setNanosecond :)] + pub unsafe fn setNanosecond(&self, nanosecond: NSInteger); + #[method(weekday)] + pub unsafe fn weekday(&self) -> NSInteger; + # [method (setWeekday :)] + pub unsafe fn setWeekday(&self, weekday: NSInteger); + #[method(weekdayOrdinal)] + pub unsafe fn weekdayOrdinal(&self) -> NSInteger; + # [method (setWeekdayOrdinal :)] + pub unsafe fn setWeekdayOrdinal(&self, weekdayOrdinal: NSInteger); + #[method(quarter)] + pub unsafe fn quarter(&self) -> NSInteger; + # [method (setQuarter :)] + pub unsafe fn setQuarter(&self, quarter: NSInteger); + #[method(weekOfMonth)] + pub unsafe fn weekOfMonth(&self) -> NSInteger; + # [method (setWeekOfMonth :)] + pub unsafe fn setWeekOfMonth(&self, weekOfMonth: NSInteger); + #[method(weekOfYear)] + pub unsafe fn weekOfYear(&self) -> NSInteger; + # [method (setWeekOfYear :)] + pub unsafe fn setWeekOfYear(&self, weekOfYear: NSInteger); + #[method(yearForWeekOfYear)] + pub unsafe fn yearForWeekOfYear(&self) -> NSInteger; + # [method (setYearForWeekOfYear :)] + pub unsafe fn setYearForWeekOfYear(&self, yearForWeekOfYear: NSInteger); + #[method(isLeapMonth)] + pub unsafe fn isLeapMonth(&self) -> bool; + # [method (setLeapMonth :)] + pub unsafe fn setLeapMonth(&self, leapMonth: bool); + #[method_id(date)] + pub unsafe fn date(&self) -> Option>; + #[method(week)] + pub unsafe fn week(&self) -> NSInteger; + # [method (setWeek :)] + pub unsafe fn setWeek(&self, v: NSInteger); + # [method (setValue : forComponent :)] + pub unsafe fn setValue_forComponent(&self, value: NSInteger, unit: NSCalendarUnit); + # [method (valueForComponent :)] + pub unsafe fn valueForComponent(&self, unit: NSCalendarUnit) -> NSInteger; + #[method(isValidDate)] + pub unsafe fn isValidDate(&self) -> bool; + # [method (isValidDateInCalendar :)] + pub unsafe fn isValidDateInCalendar(&self, calendar: &NSCalendar) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSCalendarDate.rs b/icrate/src/Foundation/generated/NSCalendarDate.rs index 444b49044..b83fc902c 100644 --- a/icrate/src/Foundation/generated/NSCalendarDate.rs +++ b/icrate/src/Foundation/generated/NSCalendarDate.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSDate::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSCalendarDate; @@ -15,31 +15,20 @@ extern_class!( ); extern_methods!( unsafe impl NSCalendarDate { - pub unsafe fn calendarDate() -> Id { - msg_send_id![Self::class(), calendarDate] - } + #[method_id(calendarDate)] + pub unsafe fn calendarDate() -> Id; + # [method_id (dateWithString : calendarFormat : locale :)] pub unsafe fn dateWithString_calendarFormat_locale( description: &NSString, format: &NSString, locale: Option<&Object>, - ) -> Option> { - msg_send_id![ - Self::class(), - dateWithString: description, - calendarFormat: format, - locale: locale - ] - } + ) -> Option>; + # [method_id (dateWithString : calendarFormat :)] pub unsafe fn dateWithString_calendarFormat( description: &NSString, format: &NSString, - ) -> Option> { - msg_send_id![ - Self::class(), - dateWithString: description, - calendarFormat: format - ] - } + ) -> Option>; + # [method_id (dateWithYear : month : day : hour : minute : second : timeZone :)] pub unsafe fn dateWithYear_month_day_hour_minute_second_timeZone( year: NSInteger, month: NSUInteger, @@ -48,18 +37,8 @@ extern_methods!( minute: NSUInteger, second: NSUInteger, aTimeZone: Option<&NSTimeZone>, - ) -> Id { - msg_send_id![ - Self::class(), - dateWithYear: year, - month: month, - day: day, - hour: hour, - minute: minute, - second: second, - timeZone: aTimeZone - ] - } + ) -> Id; + # [method_id (dateByAddingYears : months : days : hours : minutes : seconds :)] pub unsafe fn dateByAddingYears_months_days_hours_minutes_seconds( &self, year: NSInteger, @@ -68,92 +47,59 @@ extern_methods!( hour: NSInteger, minute: NSInteger, second: NSInteger, - ) -> Id { - msg_send_id![ - self, - dateByAddingYears: year, - months: month, - days: day, - hours: hour, - minutes: minute, - seconds: second - ] - } - pub unsafe fn dayOfCommonEra(&self) -> NSInteger { - msg_send![self, dayOfCommonEra] - } - pub unsafe fn dayOfMonth(&self) -> NSInteger { - msg_send![self, dayOfMonth] - } - pub unsafe fn dayOfWeek(&self) -> NSInteger { - msg_send![self, dayOfWeek] - } - pub unsafe fn dayOfYear(&self) -> NSInteger { - msg_send![self, dayOfYear] - } - pub unsafe fn hourOfDay(&self) -> NSInteger { - msg_send![self, hourOfDay] - } - pub unsafe fn minuteOfHour(&self) -> NSInteger { - msg_send![self, minuteOfHour] - } - pub unsafe fn monthOfYear(&self) -> NSInteger { - msg_send![self, monthOfYear] - } - pub unsafe fn secondOfMinute(&self) -> NSInteger { - msg_send![self, secondOfMinute] - } - pub unsafe fn yearOfCommonEra(&self) -> NSInteger { - msg_send![self, yearOfCommonEra] - } - pub unsafe fn calendarFormat(&self) -> Id { - msg_send_id![self, calendarFormat] - } + ) -> Id; + #[method(dayOfCommonEra)] + pub unsafe fn dayOfCommonEra(&self) -> NSInteger; + #[method(dayOfMonth)] + pub unsafe fn dayOfMonth(&self) -> NSInteger; + #[method(dayOfWeek)] + pub unsafe fn dayOfWeek(&self) -> NSInteger; + #[method(dayOfYear)] + pub unsafe fn dayOfYear(&self) -> NSInteger; + #[method(hourOfDay)] + pub unsafe fn hourOfDay(&self) -> NSInteger; + #[method(minuteOfHour)] + pub unsafe fn minuteOfHour(&self) -> NSInteger; + #[method(monthOfYear)] + pub unsafe fn monthOfYear(&self) -> NSInteger; + #[method(secondOfMinute)] + pub unsafe fn secondOfMinute(&self) -> NSInteger; + #[method(yearOfCommonEra)] + pub unsafe fn yearOfCommonEra(&self) -> NSInteger; + #[method_id(calendarFormat)] + pub unsafe fn calendarFormat(&self) -> Id; + # [method_id (descriptionWithCalendarFormat : locale :)] pub unsafe fn descriptionWithCalendarFormat_locale( &self, format: &NSString, locale: Option<&Object>, - ) -> Id { - msg_send_id![self, descriptionWithCalendarFormat: format, locale: locale] - } + ) -> Id; + # [method_id (descriptionWithCalendarFormat :)] pub unsafe fn descriptionWithCalendarFormat( &self, format: &NSString, - ) -> Id { - msg_send_id![self, descriptionWithCalendarFormat: format] - } - pub unsafe fn descriptionWithLocale( - &self, - locale: Option<&Object>, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale] - } - pub unsafe fn timeZone(&self) -> Id { - msg_send_id![self, timeZone] - } + ) -> Id; + # [method_id (descriptionWithLocale :)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + #[method_id(timeZone)] + pub unsafe fn timeZone(&self) -> Id; + # [method_id (initWithString : calendarFormat : locale :)] pub unsafe fn initWithString_calendarFormat_locale( &self, description: &NSString, format: &NSString, locale: Option<&Object>, - ) -> Option> { - msg_send_id![ - self, - initWithString: description, - calendarFormat: format, - locale: locale - ] - } + ) -> Option>; + # [method_id (initWithString : calendarFormat :)] pub unsafe fn initWithString_calendarFormat( &self, description: &NSString, format: &NSString, - ) -> Option> { - msg_send_id![self, initWithString: description, calendarFormat: format] - } - pub unsafe fn initWithString(&self, description: &NSString) -> Option> { - msg_send_id![self, initWithString: description] - } + ) -> Option>; + # [method_id (initWithString :)] + pub unsafe fn initWithString(&self, description: &NSString) -> Option>; + # [method_id (initWithYear : month : day : hour : minute : second : timeZone :)] pub unsafe fn initWithYear_month_day_hour_minute_second_timeZone( &self, year: NSInteger, @@ -163,24 +109,12 @@ extern_methods!( minute: NSUInteger, second: NSUInteger, aTimeZone: Option<&NSTimeZone>, - ) -> Id { - msg_send_id![ - self, - initWithYear: year, - month: month, - day: day, - hour: hour, - minute: minute, - second: second, - timeZone: aTimeZone - ] - } - pub unsafe fn setCalendarFormat(&self, format: Option<&NSString>) { - msg_send![self, setCalendarFormat: format] - } - pub unsafe fn setTimeZone(&self, aTimeZone: Option<&NSTimeZone>) { - msg_send![self, setTimeZone: aTimeZone] - } + ) -> Id; + # [method (setCalendarFormat :)] + pub unsafe fn setCalendarFormat(&self, format: Option<&NSString>); + # [method (setTimeZone :)] + pub unsafe fn setTimeZone(&self, aTimeZone: Option<&NSTimeZone>); + # [method (years : months : days : hours : minutes : seconds : sinceDate :)] pub unsafe fn years_months_days_hours_minutes_seconds_sinceDate( &self, yp: *mut NSInteger, @@ -190,69 +124,41 @@ extern_methods!( mip: *mut NSInteger, sp: *mut NSInteger, date: &NSCalendarDate, - ) { - msg_send![ - self, - years: yp, - months: mop, - days: dp, - hours: hp, - minutes: mip, - seconds: sp, - sinceDate: date - ] - } - pub unsafe fn distantFuture() -> Id { - msg_send_id![Self::class(), distantFuture] - } - pub unsafe fn distantPast() -> Id { - msg_send_id![Self::class(), distantPast] - } + ); + #[method_id(distantFuture)] + pub unsafe fn distantFuture() -> Id; + #[method_id(distantPast)] + pub unsafe fn distantPast() -> Id; } ); extern_methods!( #[doc = "NSCalendarDateExtras"] unsafe impl NSDate { + # [method_id (dateWithNaturalLanguageString : locale :)] pub unsafe fn dateWithNaturalLanguageString_locale( string: &NSString, locale: Option<&Object>, - ) -> Option> { - msg_send_id![ - Self::class(), - dateWithNaturalLanguageString: string, - locale: locale - ] - } + ) -> Option>; + # [method_id (dateWithNaturalLanguageString :)] pub unsafe fn dateWithNaturalLanguageString( string: &NSString, - ) -> Option> { - msg_send_id![Self::class(), dateWithNaturalLanguageString: string] - } - pub unsafe fn dateWithString(aString: &NSString) -> Id { - msg_send_id![Self::class(), dateWithString: aString] - } + ) -> Option>; + # [method_id (dateWithString :)] + pub unsafe fn dateWithString(aString: &NSString) -> Id; + # [method_id (dateWithCalendarFormat : timeZone :)] pub unsafe fn dateWithCalendarFormat_timeZone( &self, format: Option<&NSString>, aTimeZone: Option<&NSTimeZone>, - ) -> Id { - msg_send_id![self, dateWithCalendarFormat: format, timeZone: aTimeZone] - } + ) -> Id; + # [method_id (descriptionWithCalendarFormat : timeZone : locale :)] pub unsafe fn descriptionWithCalendarFormat_timeZone_locale( &self, format: Option<&NSString>, aTimeZone: Option<&NSTimeZone>, locale: Option<&Object>, - ) -> Option> { - msg_send_id![ - self, - descriptionWithCalendarFormat: format, - timeZone: aTimeZone, - locale: locale - ] - } - pub unsafe fn initWithString(&self, description: &NSString) -> Option> { - msg_send_id![self, initWithString: description] - } + ) -> Option>; + # [method_id (initWithString :)] + pub unsafe fn initWithString(&self, description: &NSString) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSCharacterSet.rs b/icrate/src/Foundation/generated/NSCharacterSet.rs index 36e6a9c5b..7b7424e8d 100644 --- a/icrate/src/Foundation/generated/NSCharacterSet.rs +++ b/icrate/src/Foundation/generated/NSCharacterSet.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSString::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSCharacterSet; @@ -16,90 +16,64 @@ extern_class!( ); extern_methods!( unsafe impl NSCharacterSet { - pub unsafe fn controlCharacterSet() -> Id { - msg_send_id![Self::class(), controlCharacterSet] - } - pub unsafe fn whitespaceCharacterSet() -> Id { - msg_send_id![Self::class(), whitespaceCharacterSet] - } - pub unsafe fn whitespaceAndNewlineCharacterSet() -> Id { - msg_send_id![Self::class(), whitespaceAndNewlineCharacterSet] - } - pub unsafe fn decimalDigitCharacterSet() -> Id { - msg_send_id![Self::class(), decimalDigitCharacterSet] - } - pub unsafe fn letterCharacterSet() -> Id { - msg_send_id![Self::class(), letterCharacterSet] - } - pub unsafe fn lowercaseLetterCharacterSet() -> Id { - msg_send_id![Self::class(), lowercaseLetterCharacterSet] - } - pub unsafe fn uppercaseLetterCharacterSet() -> Id { - msg_send_id![Self::class(), uppercaseLetterCharacterSet] - } - pub unsafe fn nonBaseCharacterSet() -> Id { - msg_send_id![Self::class(), nonBaseCharacterSet] - } - pub unsafe fn alphanumericCharacterSet() -> Id { - msg_send_id![Self::class(), alphanumericCharacterSet] - } - pub unsafe fn decomposableCharacterSet() -> Id { - msg_send_id![Self::class(), decomposableCharacterSet] - } - pub unsafe fn illegalCharacterSet() -> Id { - msg_send_id![Self::class(), illegalCharacterSet] - } - pub unsafe fn punctuationCharacterSet() -> Id { - msg_send_id![Self::class(), punctuationCharacterSet] - } - pub unsafe fn capitalizedLetterCharacterSet() -> Id { - msg_send_id![Self::class(), capitalizedLetterCharacterSet] - } - pub unsafe fn symbolCharacterSet() -> Id { - msg_send_id![Self::class(), symbolCharacterSet] - } - pub unsafe fn newlineCharacterSet() -> Id { - msg_send_id![Self::class(), newlineCharacterSet] - } - pub unsafe fn characterSetWithRange(aRange: NSRange) -> Id { - msg_send_id![Self::class(), characterSetWithRange: aRange] - } + #[method_id(controlCharacterSet)] + pub unsafe fn controlCharacterSet() -> Id; + #[method_id(whitespaceCharacterSet)] + pub unsafe fn whitespaceCharacterSet() -> Id; + #[method_id(whitespaceAndNewlineCharacterSet)] + pub unsafe fn whitespaceAndNewlineCharacterSet() -> Id; + #[method_id(decimalDigitCharacterSet)] + pub unsafe fn decimalDigitCharacterSet() -> Id; + #[method_id(letterCharacterSet)] + pub unsafe fn letterCharacterSet() -> Id; + #[method_id(lowercaseLetterCharacterSet)] + pub unsafe fn lowercaseLetterCharacterSet() -> Id; + #[method_id(uppercaseLetterCharacterSet)] + pub unsafe fn uppercaseLetterCharacterSet() -> Id; + #[method_id(nonBaseCharacterSet)] + pub unsafe fn nonBaseCharacterSet() -> Id; + #[method_id(alphanumericCharacterSet)] + pub unsafe fn alphanumericCharacterSet() -> Id; + #[method_id(decomposableCharacterSet)] + pub unsafe fn decomposableCharacterSet() -> Id; + #[method_id(illegalCharacterSet)] + pub unsafe fn illegalCharacterSet() -> Id; + #[method_id(punctuationCharacterSet)] + pub unsafe fn punctuationCharacterSet() -> Id; + #[method_id(capitalizedLetterCharacterSet)] + pub unsafe fn capitalizedLetterCharacterSet() -> Id; + #[method_id(symbolCharacterSet)] + pub unsafe fn symbolCharacterSet() -> Id; + #[method_id(newlineCharacterSet)] + pub unsafe fn newlineCharacterSet() -> Id; + # [method_id (characterSetWithRange :)] + pub unsafe fn characterSetWithRange(aRange: NSRange) -> Id; + # [method_id (characterSetWithCharactersInString :)] pub unsafe fn characterSetWithCharactersInString( aString: &NSString, - ) -> Id { - msg_send_id![Self::class(), characterSetWithCharactersInString: aString] - } + ) -> Id; + # [method_id (characterSetWithBitmapRepresentation :)] pub unsafe fn characterSetWithBitmapRepresentation( data: &NSData, - ) -> Id { - msg_send_id![Self::class(), characterSetWithBitmapRepresentation: data] - } + ) -> Id; + # [method_id (characterSetWithContentsOfFile :)] pub unsafe fn characterSetWithContentsOfFile( fName: &NSString, - ) -> Option> { - msg_send_id![Self::class(), characterSetWithContentsOfFile: fName] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Id { - msg_send_id![self, initWithCoder: coder] - } - pub unsafe fn characterIsMember(&self, aCharacter: unichar) -> bool { - msg_send![self, characterIsMember: aCharacter] - } - pub unsafe fn bitmapRepresentation(&self) -> Id { - msg_send_id![self, bitmapRepresentation] - } - pub unsafe fn invertedSet(&self) -> Id { - msg_send_id![self, invertedSet] - } - pub unsafe fn longCharacterIsMember(&self, theLongChar: UTF32Char) -> bool { - msg_send![self, longCharacterIsMember: theLongChar] - } - pub unsafe fn isSupersetOfSet(&self, theOtherSet: &NSCharacterSet) -> bool { - msg_send![self, isSupersetOfSet: theOtherSet] - } - pub unsafe fn hasMemberInPlane(&self, thePlane: u8) -> bool { - msg_send![self, hasMemberInPlane: thePlane] - } + ) -> Option>; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Id; + # [method (characterIsMember :)] + pub unsafe fn characterIsMember(&self, aCharacter: unichar) -> bool; + #[method_id(bitmapRepresentation)] + pub unsafe fn bitmapRepresentation(&self) -> Id; + #[method_id(invertedSet)] + pub unsafe fn invertedSet(&self) -> Id; + # [method (longCharacterIsMember :)] + pub unsafe fn longCharacterIsMember(&self, theLongChar: UTF32Char) -> bool; + # [method (isSupersetOfSet :)] + pub unsafe fn isSupersetOfSet(&self, theOtherSet: &NSCharacterSet) -> bool; + # [method (hasMemberInPlane :)] + pub unsafe fn hasMemberInPlane(&self, thePlane: u8) -> bool; } ); extern_class!( @@ -111,89 +85,63 @@ extern_class!( ); extern_methods!( unsafe impl NSMutableCharacterSet { - pub unsafe fn addCharactersInRange(&self, aRange: NSRange) { - msg_send![self, addCharactersInRange: aRange] - } - pub unsafe fn removeCharactersInRange(&self, aRange: NSRange) { - msg_send![self, removeCharactersInRange: aRange] - } - pub unsafe fn addCharactersInString(&self, aString: &NSString) { - msg_send![self, addCharactersInString: aString] - } - pub unsafe fn removeCharactersInString(&self, aString: &NSString) { - msg_send![self, removeCharactersInString: aString] - } - pub unsafe fn formUnionWithCharacterSet(&self, otherSet: &NSCharacterSet) { - msg_send![self, formUnionWithCharacterSet: otherSet] - } - pub unsafe fn formIntersectionWithCharacterSet(&self, otherSet: &NSCharacterSet) { - msg_send![self, formIntersectionWithCharacterSet: otherSet] - } - pub unsafe fn invert(&self) { - msg_send![self, invert] - } - pub unsafe fn controlCharacterSet() -> Id { - msg_send_id![Self::class(), controlCharacterSet] - } - pub unsafe fn whitespaceCharacterSet() -> Id { - msg_send_id![Self::class(), whitespaceCharacterSet] - } - pub unsafe fn whitespaceAndNewlineCharacterSet() -> Id { - msg_send_id![Self::class(), whitespaceAndNewlineCharacterSet] - } - pub unsafe fn decimalDigitCharacterSet() -> Id { - msg_send_id![Self::class(), decimalDigitCharacterSet] - } - pub unsafe fn letterCharacterSet() -> Id { - msg_send_id![Self::class(), letterCharacterSet] - } - pub unsafe fn lowercaseLetterCharacterSet() -> Id { - msg_send_id![Self::class(), lowercaseLetterCharacterSet] - } - pub unsafe fn uppercaseLetterCharacterSet() -> Id { - msg_send_id![Self::class(), uppercaseLetterCharacterSet] - } - pub unsafe fn nonBaseCharacterSet() -> Id { - msg_send_id![Self::class(), nonBaseCharacterSet] - } - pub unsafe fn alphanumericCharacterSet() -> Id { - msg_send_id![Self::class(), alphanumericCharacterSet] - } - pub unsafe fn decomposableCharacterSet() -> Id { - msg_send_id![Self::class(), decomposableCharacterSet] - } - pub unsafe fn illegalCharacterSet() -> Id { - msg_send_id![Self::class(), illegalCharacterSet] - } - pub unsafe fn punctuationCharacterSet() -> Id { - msg_send_id![Self::class(), punctuationCharacterSet] - } - pub unsafe fn capitalizedLetterCharacterSet() -> Id { - msg_send_id![Self::class(), capitalizedLetterCharacterSet] - } - pub unsafe fn symbolCharacterSet() -> Id { - msg_send_id![Self::class(), symbolCharacterSet] - } - pub unsafe fn newlineCharacterSet() -> Id { - msg_send_id![Self::class(), newlineCharacterSet] - } - pub unsafe fn characterSetWithRange(aRange: NSRange) -> Id { - msg_send_id![Self::class(), characterSetWithRange: aRange] - } + # [method (addCharactersInRange :)] + pub unsafe fn addCharactersInRange(&self, aRange: NSRange); + # [method (removeCharactersInRange :)] + pub unsafe fn removeCharactersInRange(&self, aRange: NSRange); + # [method (addCharactersInString :)] + pub unsafe fn addCharactersInString(&self, aString: &NSString); + # [method (removeCharactersInString :)] + pub unsafe fn removeCharactersInString(&self, aString: &NSString); + # [method (formUnionWithCharacterSet :)] + pub unsafe fn formUnionWithCharacterSet(&self, otherSet: &NSCharacterSet); + # [method (formIntersectionWithCharacterSet :)] + pub unsafe fn formIntersectionWithCharacterSet(&self, otherSet: &NSCharacterSet); + #[method(invert)] + pub unsafe fn invert(&self); + #[method_id(controlCharacterSet)] + pub unsafe fn controlCharacterSet() -> Id; + #[method_id(whitespaceCharacterSet)] + pub unsafe fn whitespaceCharacterSet() -> Id; + #[method_id(whitespaceAndNewlineCharacterSet)] + pub unsafe fn whitespaceAndNewlineCharacterSet() -> Id; + #[method_id(decimalDigitCharacterSet)] + pub unsafe fn decimalDigitCharacterSet() -> Id; + #[method_id(letterCharacterSet)] + pub unsafe fn letterCharacterSet() -> Id; + #[method_id(lowercaseLetterCharacterSet)] + pub unsafe fn lowercaseLetterCharacterSet() -> Id; + #[method_id(uppercaseLetterCharacterSet)] + pub unsafe fn uppercaseLetterCharacterSet() -> Id; + #[method_id(nonBaseCharacterSet)] + pub unsafe fn nonBaseCharacterSet() -> Id; + #[method_id(alphanumericCharacterSet)] + pub unsafe fn alphanumericCharacterSet() -> Id; + #[method_id(decomposableCharacterSet)] + pub unsafe fn decomposableCharacterSet() -> Id; + #[method_id(illegalCharacterSet)] + pub unsafe fn illegalCharacterSet() -> Id; + #[method_id(punctuationCharacterSet)] + pub unsafe fn punctuationCharacterSet() -> Id; + #[method_id(capitalizedLetterCharacterSet)] + pub unsafe fn capitalizedLetterCharacterSet() -> Id; + #[method_id(symbolCharacterSet)] + pub unsafe fn symbolCharacterSet() -> Id; + #[method_id(newlineCharacterSet)] + pub unsafe fn newlineCharacterSet() -> Id; + # [method_id (characterSetWithRange :)] + pub unsafe fn characterSetWithRange(aRange: NSRange) -> Id; + # [method_id (characterSetWithCharactersInString :)] pub unsafe fn characterSetWithCharactersInString( aString: &NSString, - ) -> Id { - msg_send_id![Self::class(), characterSetWithCharactersInString: aString] - } + ) -> Id; + # [method_id (characterSetWithBitmapRepresentation :)] pub unsafe fn characterSetWithBitmapRepresentation( data: &NSData, - ) -> Id { - msg_send_id![Self::class(), characterSetWithBitmapRepresentation: data] - } + ) -> Id; + # [method_id (characterSetWithContentsOfFile :)] pub unsafe fn characterSetWithContentsOfFile( fName: &NSString, - ) -> Option> { - msg_send_id![Self::class(), characterSetWithContentsOfFile: fName] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSClassDescription.rs b/icrate/src/Foundation/generated/NSClassDescription.rs index 1affb260e..5d4ab4024 100644 --- a/icrate/src/Foundation/generated/NSClassDescription.rs +++ b/icrate/src/Foundation/generated/NSClassDescription.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSClassDescription; @@ -17,61 +17,45 @@ extern_class!( ); extern_methods!( unsafe impl NSClassDescription { + # [method (registerClassDescription : forClass :)] pub unsafe fn registerClassDescription_forClass( description: &NSClassDescription, aClass: &Class, - ) { - msg_send![ - Self::class(), - registerClassDescription: description, - forClass: aClass - ] - } - pub unsafe fn invalidateClassDescriptionCache() { - msg_send![Self::class(), invalidateClassDescriptionCache] - } + ); + #[method(invalidateClassDescriptionCache)] + pub unsafe fn invalidateClassDescriptionCache(); + # [method_id (classDescriptionForClass :)] pub unsafe fn classDescriptionForClass( aClass: &Class, - ) -> Option> { - msg_send_id![Self::class(), classDescriptionForClass: aClass] - } - pub unsafe fn attributeKeys(&self) -> Id, Shared> { - msg_send_id![self, attributeKeys] - } - pub unsafe fn toOneRelationshipKeys(&self) -> Id, Shared> { - msg_send_id![self, toOneRelationshipKeys] - } - pub unsafe fn toManyRelationshipKeys(&self) -> Id, Shared> { - msg_send_id![self, toManyRelationshipKeys] - } + ) -> Option>; + #[method_id(attributeKeys)] + pub unsafe fn attributeKeys(&self) -> Id, Shared>; + #[method_id(toOneRelationshipKeys)] + pub unsafe fn toOneRelationshipKeys(&self) -> Id, Shared>; + #[method_id(toManyRelationshipKeys)] + pub unsafe fn toManyRelationshipKeys(&self) -> Id, Shared>; + # [method_id (inverseForRelationshipKey :)] pub unsafe fn inverseForRelationshipKey( &self, relationshipKey: &NSString, - ) -> Option> { - msg_send_id![self, inverseForRelationshipKey: relationshipKey] - } + ) -> Option>; } ); extern_methods!( #[doc = "NSClassDescriptionPrimitives"] unsafe impl NSObject { - pub unsafe fn classDescription(&self) -> Id { - msg_send_id![self, classDescription] - } - pub unsafe fn attributeKeys(&self) -> Id, Shared> { - msg_send_id![self, attributeKeys] - } - pub unsafe fn toOneRelationshipKeys(&self) -> Id, Shared> { - msg_send_id![self, toOneRelationshipKeys] - } - pub unsafe fn toManyRelationshipKeys(&self) -> Id, Shared> { - msg_send_id![self, toManyRelationshipKeys] - } + #[method_id(classDescription)] + pub unsafe fn classDescription(&self) -> Id; + #[method_id(attributeKeys)] + pub unsafe fn attributeKeys(&self) -> Id, Shared>; + #[method_id(toOneRelationshipKeys)] + pub unsafe fn toOneRelationshipKeys(&self) -> Id, Shared>; + #[method_id(toManyRelationshipKeys)] + pub unsafe fn toManyRelationshipKeys(&self) -> Id, Shared>; + # [method_id (inverseForRelationshipKey :)] pub unsafe fn inverseForRelationshipKey( &self, relationshipKey: &NSString, - ) -> Option> { - msg_send_id![self, inverseForRelationshipKey: relationshipKey] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSCoder.rs b/icrate/src/Foundation/generated/NSCoder.rs index 78d4f9e45..d47500b05 100644 --- a/icrate/src/Foundation/generated/NSCoder.rs +++ b/icrate/src/Foundation/generated/NSCoder.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSCoder; @@ -15,306 +15,219 @@ extern_class!( ); extern_methods!( unsafe impl NSCoder { + # [method (encodeValueOfObjCType : at :)] pub unsafe fn encodeValueOfObjCType_at( &self, type_: NonNull, addr: NonNull, - ) { - msg_send![self, encodeValueOfObjCType: type_, at: addr] - } - pub unsafe fn encodeDataObject(&self, data: &NSData) { - msg_send![self, encodeDataObject: data] - } - pub unsafe fn decodeDataObject(&self) -> Option> { - msg_send_id![self, decodeDataObject] - } + ); + # [method (encodeDataObject :)] + pub unsafe fn encodeDataObject(&self, data: &NSData); + #[method_id(decodeDataObject)] + pub unsafe fn decodeDataObject(&self) -> Option>; + # [method (decodeValueOfObjCType : at : size :)] pub unsafe fn decodeValueOfObjCType_at_size( &self, type_: NonNull, data: NonNull, size: NSUInteger, - ) { - msg_send![self, decodeValueOfObjCType: type_, at: data, size: size] - } - pub unsafe fn versionForClassName(&self, className: &NSString) -> NSInteger { - msg_send![self, versionForClassName: className] - } + ); + # [method (versionForClassName :)] + pub unsafe fn versionForClassName(&self, className: &NSString) -> NSInteger; } ); extern_methods!( #[doc = "NSExtendedCoder"] unsafe impl NSCoder { - pub unsafe fn encodeObject(&self, object: Option<&Object>) { - msg_send![self, encodeObject: object] - } - pub unsafe fn encodeRootObject(&self, rootObject: &Object) { - msg_send![self, encodeRootObject: rootObject] - } - pub unsafe fn encodeBycopyObject(&self, anObject: Option<&Object>) { - msg_send![self, encodeBycopyObject: anObject] - } - pub unsafe fn encodeByrefObject(&self, anObject: Option<&Object>) { - msg_send![self, encodeByrefObject: anObject] - } - pub unsafe fn encodeConditionalObject(&self, object: Option<&Object>) { - msg_send![self, encodeConditionalObject: object] - } + # [method (encodeObject :)] + pub unsafe fn encodeObject(&self, object: Option<&Object>); + # [method (encodeRootObject :)] + pub unsafe fn encodeRootObject(&self, rootObject: &Object); + # [method (encodeBycopyObject :)] + pub unsafe fn encodeBycopyObject(&self, anObject: Option<&Object>); + # [method (encodeByrefObject :)] + pub unsafe fn encodeByrefObject(&self, anObject: Option<&Object>); + # [method (encodeConditionalObject :)] + pub unsafe fn encodeConditionalObject(&self, object: Option<&Object>); + # [method (encodeArrayOfObjCType : count : at :)] pub unsafe fn encodeArrayOfObjCType_count_at( &self, type_: NonNull, count: NSUInteger, array: NonNull, - ) { - msg_send![self, encodeArrayOfObjCType: type_, count: count, at: array] - } - pub unsafe fn encodeBytes_length(&self, byteaddr: *mut c_void, length: NSUInteger) { - msg_send![self, encodeBytes: byteaddr, length: length] - } - pub unsafe fn decodeObject(&self) -> Option> { - msg_send_id![self, decodeObject] - } + ); + # [method (encodeBytes : length :)] + pub unsafe fn encodeBytes_length(&self, byteaddr: *mut c_void, length: NSUInteger); + #[method_id(decodeObject)] + pub unsafe fn decodeObject(&self) -> Option>; + # [method_id (decodeTopLevelObjectAndReturnError :)] pub unsafe fn decodeTopLevelObjectAndReturnError( &self, - ) -> Result, Id> { - msg_send_id![self, decodeTopLevelObjectAndReturnError: _] - } + ) -> Result, Id>; + # [method (decodeArrayOfObjCType : count : at :)] pub unsafe fn decodeArrayOfObjCType_count_at( &self, itemType: NonNull, count: NSUInteger, array: NonNull, - ) { - msg_send![ - self, - decodeArrayOfObjCType: itemType, - count: count, - at: array - ] - } + ); + # [method (decodeBytesWithReturnedLength :)] pub unsafe fn decodeBytesWithReturnedLength( &self, lengthp: NonNull, - ) -> *mut c_void { - msg_send![self, decodeBytesWithReturnedLength: lengthp] - } - pub unsafe fn encodePropertyList(&self, aPropertyList: &Object) { - msg_send![self, encodePropertyList: aPropertyList] - } - pub unsafe fn decodePropertyList(&self) -> Option> { - msg_send_id![self, decodePropertyList] - } - pub unsafe fn setObjectZone(&self, zone: *mut NSZone) { - msg_send![self, setObjectZone: zone] - } - pub unsafe fn objectZone(&self) -> *mut NSZone { - msg_send![self, objectZone] - } - pub unsafe fn systemVersion(&self) -> c_uint { - msg_send![self, systemVersion] - } - pub unsafe fn allowsKeyedCoding(&self) -> bool { - msg_send![self, allowsKeyedCoding] - } - pub unsafe fn encodeObject_forKey(&self, object: Option<&Object>, key: &NSString) { - msg_send![self, encodeObject: object, forKey: key] - } + ) -> *mut c_void; + # [method (encodePropertyList :)] + pub unsafe fn encodePropertyList(&self, aPropertyList: &Object); + #[method_id(decodePropertyList)] + pub unsafe fn decodePropertyList(&self) -> Option>; + # [method (setObjectZone :)] + pub unsafe fn setObjectZone(&self, zone: *mut NSZone); + #[method(objectZone)] + pub unsafe fn objectZone(&self) -> *mut NSZone; + #[method(systemVersion)] + pub unsafe fn systemVersion(&self) -> c_uint; + #[method(allowsKeyedCoding)] + pub unsafe fn allowsKeyedCoding(&self) -> bool; + # [method (encodeObject : forKey :)] + pub unsafe fn encodeObject_forKey(&self, object: Option<&Object>, key: &NSString); + # [method (encodeConditionalObject : forKey :)] pub unsafe fn encodeConditionalObject_forKey( &self, object: Option<&Object>, key: &NSString, - ) { - msg_send![self, encodeConditionalObject: object, forKey: key] - } - pub unsafe fn encodeBool_forKey(&self, value: bool, key: &NSString) { - msg_send![self, encodeBool: value, forKey: key] - } - pub unsafe fn encodeInt_forKey(&self, value: c_int, key: &NSString) { - msg_send![self, encodeInt: value, forKey: key] - } - pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString) { - msg_send![self, encodeInt32: value, forKey: key] - } - pub unsafe fn encodeInt64_forKey(&self, value: int64_t, key: &NSString) { - msg_send![self, encodeInt64: value, forKey: key] - } - pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString) { - msg_send![self, encodeFloat: value, forKey: key] - } - pub unsafe fn encodeDouble_forKey(&self, value: c_double, key: &NSString) { - msg_send![self, encodeDouble: value, forKey: key] - } + ); + # [method (encodeBool : forKey :)] + pub unsafe fn encodeBool_forKey(&self, value: bool, key: &NSString); + # [method (encodeInt : forKey :)] + pub unsafe fn encodeInt_forKey(&self, value: c_int, key: &NSString); + # [method (encodeInt32 : forKey :)] + pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString); + # [method (encodeInt64 : forKey :)] + pub unsafe fn encodeInt64_forKey(&self, value: int64_t, key: &NSString); + # [method (encodeFloat : forKey :)] + pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString); + # [method (encodeDouble : forKey :)] + pub unsafe fn encodeDouble_forKey(&self, value: c_double, key: &NSString); + # [method (encodeBytes : length : forKey :)] pub unsafe fn encodeBytes_length_forKey( &self, bytes: *mut u8, length: NSUInteger, key: &NSString, - ) { - msg_send![self, encodeBytes: bytes, length: length, forKey: key] - } - pub unsafe fn containsValueForKey(&self, key: &NSString) -> bool { - msg_send![self, containsValueForKey: key] - } - pub unsafe fn decodeObjectForKey(&self, key: &NSString) -> Option> { - msg_send_id![self, decodeObjectForKey: key] - } + ); + # [method (containsValueForKey :)] + pub unsafe fn containsValueForKey(&self, key: &NSString) -> bool; + # [method_id (decodeObjectForKey :)] + pub unsafe fn decodeObjectForKey(&self, key: &NSString) -> Option>; + # [method_id (decodeTopLevelObjectForKey : error :)] pub unsafe fn decodeTopLevelObjectForKey_error( &self, key: &NSString, - ) -> Result, Id> { - msg_send_id![self, decodeTopLevelObjectForKey: key, error: _] - } - pub unsafe fn decodeBoolForKey(&self, key: &NSString) -> bool { - msg_send![self, decodeBoolForKey: key] - } - pub unsafe fn decodeIntForKey(&self, key: &NSString) -> c_int { - msg_send![self, decodeIntForKey: key] - } - pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32 { - msg_send![self, decodeInt32ForKey: key] - } - pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> int64_t { - msg_send![self, decodeInt64ForKey: key] - } - pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float { - msg_send![self, decodeFloatForKey: key] - } - pub unsafe fn decodeDoubleForKey(&self, key: &NSString) -> c_double { - msg_send![self, decodeDoubleForKey: key] - } + ) -> Result, Id>; + # [method (decodeBoolForKey :)] + pub unsafe fn decodeBoolForKey(&self, key: &NSString) -> bool; + # [method (decodeIntForKey :)] + pub unsafe fn decodeIntForKey(&self, key: &NSString) -> c_int; + # [method (decodeInt32ForKey :)] + pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32; + # [method (decodeInt64ForKey :)] + pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> int64_t; + # [method (decodeFloatForKey :)] + pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float; + # [method (decodeDoubleForKey :)] + pub unsafe fn decodeDoubleForKey(&self, key: &NSString) -> c_double; + # [method (decodeBytesForKey : returnedLength :)] pub unsafe fn decodeBytesForKey_returnedLength( &self, key: &NSString, lengthp: *mut NSUInteger, - ) -> *mut u8 { - msg_send![self, decodeBytesForKey: key, returnedLength: lengthp] - } - pub unsafe fn encodeInteger_forKey(&self, value: NSInteger, key: &NSString) { - msg_send![self, encodeInteger: value, forKey: key] - } - pub unsafe fn decodeIntegerForKey(&self, key: &NSString) -> NSInteger { - msg_send![self, decodeIntegerForKey: key] - } - pub unsafe fn requiresSecureCoding(&self) -> bool { - msg_send![self, requiresSecureCoding] - } + ) -> *mut u8; + # [method (encodeInteger : forKey :)] + pub unsafe fn encodeInteger_forKey(&self, value: NSInteger, key: &NSString); + # [method (decodeIntegerForKey :)] + pub unsafe fn decodeIntegerForKey(&self, key: &NSString) -> NSInteger; + #[method(requiresSecureCoding)] + pub unsafe fn requiresSecureCoding(&self) -> bool; + # [method_id (decodeObjectOfClass : forKey :)] pub unsafe fn decodeObjectOfClass_forKey( &self, aClass: &Class, key: &NSString, - ) -> Option> { - msg_send_id![self, decodeObjectOfClass: aClass, forKey: key] - } + ) -> Option>; + # [method_id (decodeTopLevelObjectOfClass : forKey : error :)] pub unsafe fn decodeTopLevelObjectOfClass_forKey_error( &self, aClass: &Class, key: &NSString, - ) -> Result, Id> { - msg_send_id![ - self, - decodeTopLevelObjectOfClass: aClass, - forKey: key, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (decodeArrayOfObjectsOfClass : forKey :)] pub unsafe fn decodeArrayOfObjectsOfClass_forKey( &self, cls: &Class, key: &NSString, - ) -> Option> { - msg_send_id![self, decodeArrayOfObjectsOfClass: cls, forKey: key] - } + ) -> Option>; + # [method_id (decodeDictionaryWithKeysOfClass : objectsOfClass : forKey :)] pub unsafe fn decodeDictionaryWithKeysOfClass_objectsOfClass_forKey( &self, keyCls: &Class, objectCls: &Class, key: &NSString, - ) -> Option> { - msg_send_id![ - self, - decodeDictionaryWithKeysOfClass: keyCls, - objectsOfClass: objectCls, - forKey: key - ] - } + ) -> Option>; + # [method_id (decodeObjectOfClasses : forKey :)] pub unsafe fn decodeObjectOfClasses_forKey( &self, classes: Option<&NSSet>, key: &NSString, - ) -> Option> { - msg_send_id![self, decodeObjectOfClasses: classes, forKey: key] - } + ) -> Option>; + # [method_id (decodeTopLevelObjectOfClasses : forKey : error :)] pub unsafe fn decodeTopLevelObjectOfClasses_forKey_error( &self, classes: Option<&NSSet>, key: &NSString, - ) -> Result, Id> { - msg_send_id![ - self, - decodeTopLevelObjectOfClasses: classes, - forKey: key, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (decodeArrayOfObjectsOfClasses : forKey :)] pub unsafe fn decodeArrayOfObjectsOfClasses_forKey( &self, classes: &NSSet, key: &NSString, - ) -> Option> { - msg_send_id![self, decodeArrayOfObjectsOfClasses: classes, forKey: key] - } + ) -> Option>; + # [method_id (decodeDictionaryWithKeysOfClasses : objectsOfClasses : forKey :)] pub unsafe fn decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey( &self, keyClasses: &NSSet, objectClasses: &NSSet, key: &NSString, - ) -> Option> { - msg_send_id![ - self, - decodeDictionaryWithKeysOfClasses: keyClasses, - objectsOfClasses: objectClasses, - forKey: key - ] - } - pub unsafe fn decodePropertyListForKey( - &self, - key: &NSString, - ) -> Option> { - msg_send_id![self, decodePropertyListForKey: key] - } - pub unsafe fn allowedClasses(&self) -> Option, Shared>> { - msg_send_id![self, allowedClasses] - } - pub unsafe fn failWithError(&self, error: &NSError) { - msg_send![self, failWithError: error] - } - pub unsafe fn decodingFailurePolicy(&self) -> NSDecodingFailurePolicy { - msg_send![self, decodingFailurePolicy] - } - pub unsafe fn error(&self) -> Option> { - msg_send_id![self, error] - } + ) -> Option>; + # [method_id (decodePropertyListForKey :)] + pub unsafe fn decodePropertyListForKey(&self, key: &NSString) + -> Option>; + #[method_id(allowedClasses)] + pub unsafe fn allowedClasses(&self) -> Option, Shared>>; + # [method (failWithError :)] + pub unsafe fn failWithError(&self, error: &NSError); + #[method(decodingFailurePolicy)] + pub unsafe fn decodingFailurePolicy(&self) -> NSDecodingFailurePolicy; + #[method_id(error)] + pub unsafe fn error(&self) -> Option>; } ); extern_methods!( #[doc = "NSTypedstreamCompatibility"] unsafe impl NSCoder { - pub unsafe fn encodeNXObject(&self, object: &Object) { - msg_send![self, encodeNXObject: object] - } - pub unsafe fn decodeNXObject(&self) -> Option> { - msg_send_id![self, decodeNXObject] - } + # [method (encodeNXObject :)] + pub unsafe fn encodeNXObject(&self, object: &Object); + #[method_id(decodeNXObject)] + pub unsafe fn decodeNXObject(&self) -> Option>; } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSCoder { + # [method (decodeValueOfObjCType : at :)] pub unsafe fn decodeValueOfObjCType_at( &self, type_: NonNull, data: NonNull, - ) { - msg_send![self, decodeValueOfObjCType: type_, at: data] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSComparisonPredicate.rs b/icrate/src/Foundation/generated/NSComparisonPredicate.rs index 4489be1db..aba54390a 100644 --- a/icrate/src/Foundation/generated/NSComparisonPredicate.rs +++ b/icrate/src/Foundation/generated/NSComparisonPredicate.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSPredicate::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSComparisonPredicate; @@ -14,27 +14,21 @@ extern_class!( ); extern_methods!( unsafe impl NSComparisonPredicate { + # [method_id (predicateWithLeftExpression : rightExpression : modifier : type : options :)] pub unsafe fn predicateWithLeftExpression_rightExpression_modifier_type_options( lhs: &NSExpression, rhs: &NSExpression, modifier: NSComparisonPredicateModifier, type_: NSPredicateOperatorType, options: NSComparisonPredicateOptions, - ) -> Id { - msg_send_id ! [Self :: class () , predicateWithLeftExpression : lhs , rightExpression : rhs , modifier : modifier , type : type_ , options : options] - } + ) -> Id; + # [method_id (predicateWithLeftExpression : rightExpression : customSelector :)] pub unsafe fn predicateWithLeftExpression_rightExpression_customSelector( lhs: &NSExpression, rhs: &NSExpression, selector: Sel, - ) -> Id { - msg_send_id![ - Self::class(), - predicateWithLeftExpression: lhs, - rightExpression: rhs, - customSelector: selector - ] - } + ) -> Id; + # [method_id (initWithLeftExpression : rightExpression : modifier : type : options :)] pub unsafe fn initWithLeftExpression_rightExpression_modifier_type_options( &self, lhs: &NSExpression, @@ -42,42 +36,27 @@ extern_methods!( modifier: NSComparisonPredicateModifier, type_: NSPredicateOperatorType, options: NSComparisonPredicateOptions, - ) -> Id { - msg_send_id ! [self , initWithLeftExpression : lhs , rightExpression : rhs , modifier : modifier , type : type_ , options : options] - } + ) -> Id; + # [method_id (initWithLeftExpression : rightExpression : customSelector :)] pub unsafe fn initWithLeftExpression_rightExpression_customSelector( &self, lhs: &NSExpression, rhs: &NSExpression, selector: Sel, - ) -> Id { - msg_send_id![ - self, - initWithLeftExpression: lhs, - rightExpression: rhs, - customSelector: selector - ] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } - pub unsafe fn predicateOperatorType(&self) -> NSPredicateOperatorType { - msg_send![self, predicateOperatorType] - } - pub unsafe fn comparisonPredicateModifier(&self) -> NSComparisonPredicateModifier { - msg_send![self, comparisonPredicateModifier] - } - pub unsafe fn leftExpression(&self) -> Id { - msg_send_id![self, leftExpression] - } - pub unsafe fn rightExpression(&self) -> Id { - msg_send_id![self, rightExpression] - } - pub unsafe fn customSelector(&self) -> Option { - msg_send![self, customSelector] - } - pub unsafe fn options(&self) -> NSComparisonPredicateOptions { - msg_send![self, options] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; + #[method(predicateOperatorType)] + pub unsafe fn predicateOperatorType(&self) -> NSPredicateOperatorType; + #[method(comparisonPredicateModifier)] + pub unsafe fn comparisonPredicateModifier(&self) -> NSComparisonPredicateModifier; + #[method_id(leftExpression)] + pub unsafe fn leftExpression(&self) -> Id; + #[method_id(rightExpression)] + pub unsafe fn rightExpression(&self) -> Id; + #[method(customSelector)] + pub unsafe fn customSelector(&self) -> Option; + #[method(options)] + pub unsafe fn options(&self) -> NSComparisonPredicateOptions; } ); diff --git a/icrate/src/Foundation/generated/NSCompoundPredicate.rs b/icrate/src/Foundation/generated/NSCompoundPredicate.rs index 7e3ccfdcb..cd520d203 100644 --- a/icrate/src/Foundation/generated/NSCompoundPredicate.rs +++ b/icrate/src/Foundation/generated/NSCompoundPredicate.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSPredicate::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSCompoundPredicate; @@ -13,36 +13,29 @@ extern_class!( ); extern_methods!( unsafe impl NSCompoundPredicate { + # [method_id (initWithType : subpredicates :)] pub unsafe fn initWithType_subpredicates( &self, type_: NSCompoundPredicateType, subpredicates: &NSArray, - ) -> Id { - msg_send_id![self, initWithType: type_, subpredicates: subpredicates] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } - pub unsafe fn compoundPredicateType(&self) -> NSCompoundPredicateType { - msg_send![self, compoundPredicateType] - } - pub unsafe fn subpredicates(&self) -> Id { - msg_send_id![self, subpredicates] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; + #[method(compoundPredicateType)] + pub unsafe fn compoundPredicateType(&self) -> NSCompoundPredicateType; + #[method_id(subpredicates)] + pub unsafe fn subpredicates(&self) -> Id; + # [method_id (andPredicateWithSubpredicates :)] pub unsafe fn andPredicateWithSubpredicates( subpredicates: &NSArray, - ) -> Id { - msg_send_id![Self::class(), andPredicateWithSubpredicates: subpredicates] - } + ) -> Id; + # [method_id (orPredicateWithSubpredicates :)] pub unsafe fn orPredicateWithSubpredicates( subpredicates: &NSArray, - ) -> Id { - msg_send_id![Self::class(), orPredicateWithSubpredicates: subpredicates] - } + ) -> Id; + # [method_id (notPredicateWithSubpredicate :)] pub unsafe fn notPredicateWithSubpredicate( predicate: &NSPredicate, - ) -> Id { - msg_send_id![Self::class(), notPredicateWithSubpredicate: predicate] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSConnection.rs b/icrate/src/Foundation/generated/NSConnection.rs index c7c0cd8c9..71952eb1a 100644 --- a/icrate/src/Foundation/generated/NSConnection.rs +++ b/icrate/src/Foundation/generated/NSConnection.rs @@ -14,7 +14,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSConnection; @@ -24,195 +24,121 @@ extern_class!( ); extern_methods!( unsafe impl NSConnection { - pub unsafe fn statistics(&self) -> Id, Shared> { - msg_send_id![self, statistics] - } - pub unsafe fn allConnections() -> Id, Shared> { - msg_send_id![Self::class(), allConnections] - } - pub unsafe fn defaultConnection() -> Id { - msg_send_id![Self::class(), defaultConnection] - } + #[method_id(statistics)] + pub unsafe fn statistics(&self) -> Id, Shared>; + #[method_id(allConnections)] + pub unsafe fn allConnections() -> Id, Shared>; + #[method_id(defaultConnection)] + pub unsafe fn defaultConnection() -> Id; + # [method_id (connectionWithRegisteredName : host :)] pub unsafe fn connectionWithRegisteredName_host( name: &NSString, hostName: Option<&NSString>, - ) -> Option> { - msg_send_id![ - Self::class(), - connectionWithRegisteredName: name, - host: hostName - ] - } + ) -> Option>; + # [method_id (connectionWithRegisteredName : host : usingNameServer :)] pub unsafe fn connectionWithRegisteredName_host_usingNameServer( name: &NSString, hostName: Option<&NSString>, server: &NSPortNameServer, - ) -> Option> { - msg_send_id![ - Self::class(), - connectionWithRegisteredName: name, - host: hostName, - usingNameServer: server - ] - } + ) -> Option>; + # [method_id (rootProxyForConnectionWithRegisteredName : host :)] pub unsafe fn rootProxyForConnectionWithRegisteredName_host( name: &NSString, hostName: Option<&NSString>, - ) -> Option> { - msg_send_id![ - Self::class(), - rootProxyForConnectionWithRegisteredName: name, - host: hostName - ] - } + ) -> Option>; + # [method_id (rootProxyForConnectionWithRegisteredName : host : usingNameServer :)] pub unsafe fn rootProxyForConnectionWithRegisteredName_host_usingNameServer( name: &NSString, hostName: Option<&NSString>, server: &NSPortNameServer, - ) -> Option> { - msg_send_id![ - Self::class(), - rootProxyForConnectionWithRegisteredName: name, - host: hostName, - usingNameServer: server - ] - } + ) -> Option>; + # [method_id (serviceConnectionWithName : rootObject : usingNameServer :)] pub unsafe fn serviceConnectionWithName_rootObject_usingNameServer( name: &NSString, root: &Object, server: &NSPortNameServer, - ) -> Option> { - msg_send_id![ - Self::class(), - serviceConnectionWithName: name, - rootObject: root, - usingNameServer: server - ] - } + ) -> Option>; + # [method_id (serviceConnectionWithName : rootObject :)] pub unsafe fn serviceConnectionWithName_rootObject( name: &NSString, root: &Object, - ) -> Option> { - msg_send_id![ - Self::class(), - serviceConnectionWithName: name, - rootObject: root - ] - } - pub unsafe fn requestTimeout(&self) -> NSTimeInterval { - msg_send![self, requestTimeout] - } - pub unsafe fn setRequestTimeout(&self, requestTimeout: NSTimeInterval) { - msg_send![self, setRequestTimeout: requestTimeout] - } - pub unsafe fn replyTimeout(&self) -> NSTimeInterval { - msg_send![self, replyTimeout] - } - pub unsafe fn setReplyTimeout(&self, replyTimeout: NSTimeInterval) { - msg_send![self, setReplyTimeout: replyTimeout] - } - pub unsafe fn rootObject(&self) -> Option> { - msg_send_id![self, rootObject] - } - pub unsafe fn setRootObject(&self, rootObject: Option<&Object>) { - msg_send![self, setRootObject: rootObject] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSConnectionDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn independentConversationQueueing(&self) -> bool { - msg_send![self, independentConversationQueueing] - } + ) -> Option>; + #[method(requestTimeout)] + pub unsafe fn requestTimeout(&self) -> NSTimeInterval; + # [method (setRequestTimeout :)] + pub unsafe fn setRequestTimeout(&self, requestTimeout: NSTimeInterval); + #[method(replyTimeout)] + pub unsafe fn replyTimeout(&self) -> NSTimeInterval; + # [method (setReplyTimeout :)] + pub unsafe fn setReplyTimeout(&self, replyTimeout: NSTimeInterval); + #[method_id(rootObject)] + pub unsafe fn rootObject(&self) -> Option>; + # [method (setRootObject :)] + pub unsafe fn setRootObject(&self, rootObject: Option<&Object>); + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSConnectionDelegate>); + #[method(independentConversationQueueing)] + pub unsafe fn independentConversationQueueing(&self) -> bool; + # [method (setIndependentConversationQueueing :)] pub unsafe fn setIndependentConversationQueueing( &self, independentConversationQueueing: bool, - ) { - msg_send![ - self, - setIndependentConversationQueueing: independentConversationQueueing - ] - } - pub unsafe fn isValid(&self) -> bool { - msg_send![self, isValid] - } - pub unsafe fn rootProxy(&self) -> Id { - msg_send_id![self, rootProxy] - } - pub unsafe fn invalidate(&self) { - msg_send![self, invalidate] - } - pub unsafe fn addRequestMode(&self, rmode: &NSString) { - msg_send![self, addRequestMode: rmode] - } - pub unsafe fn removeRequestMode(&self, rmode: &NSString) { - msg_send![self, removeRequestMode: rmode] - } - pub unsafe fn requestModes(&self) -> Id, Shared> { - msg_send_id![self, requestModes] - } - pub unsafe fn registerName(&self, name: Option<&NSString>) -> bool { - msg_send![self, registerName: name] - } + ); + #[method(isValid)] + pub unsafe fn isValid(&self) -> bool; + #[method_id(rootProxy)] + pub unsafe fn rootProxy(&self) -> Id; + #[method(invalidate)] + pub unsafe fn invalidate(&self); + # [method (addRequestMode :)] + pub unsafe fn addRequestMode(&self, rmode: &NSString); + # [method (removeRequestMode :)] + pub unsafe fn removeRequestMode(&self, rmode: &NSString); + #[method_id(requestModes)] + pub unsafe fn requestModes(&self) -> Id, Shared>; + # [method (registerName :)] + pub unsafe fn registerName(&self, name: Option<&NSString>) -> bool; + # [method (registerName : withNameServer :)] pub unsafe fn registerName_withNameServer( &self, name: Option<&NSString>, server: &NSPortNameServer, - ) -> bool { - msg_send![self, registerName: name, withNameServer: server] - } + ) -> bool; + # [method_id (connectionWithReceivePort : sendPort :)] pub unsafe fn connectionWithReceivePort_sendPort( receivePort: Option<&NSPort>, sendPort: Option<&NSPort>, - ) -> Option> { - msg_send_id![ - Self::class(), - connectionWithReceivePort: receivePort, - sendPort: sendPort - ] - } - pub unsafe fn currentConversation() -> Option> { - msg_send_id![Self::class(), currentConversation] - } + ) -> Option>; + #[method_id(currentConversation)] + pub unsafe fn currentConversation() -> Option>; + # [method_id (initWithReceivePort : sendPort :)] pub unsafe fn initWithReceivePort_sendPort( &self, receivePort: Option<&NSPort>, sendPort: Option<&NSPort>, - ) -> Option> { - msg_send_id![self, initWithReceivePort: receivePort, sendPort: sendPort] - } - pub unsafe fn sendPort(&self) -> Id { - msg_send_id![self, sendPort] - } - pub unsafe fn receivePort(&self) -> Id { - msg_send_id![self, receivePort] - } - pub unsafe fn enableMultipleThreads(&self) { - msg_send![self, enableMultipleThreads] - } - pub unsafe fn multipleThreadsEnabled(&self) -> bool { - msg_send![self, multipleThreadsEnabled] - } - pub unsafe fn addRunLoop(&self, runloop: &NSRunLoop) { - msg_send![self, addRunLoop: runloop] - } - pub unsafe fn removeRunLoop(&self, runloop: &NSRunLoop) { - msg_send![self, removeRunLoop: runloop] - } - pub unsafe fn runInNewThread(&self) { - msg_send![self, runInNewThread] - } - pub unsafe fn remoteObjects(&self) -> Id { - msg_send_id![self, remoteObjects] - } - pub unsafe fn localObjects(&self) -> Id { - msg_send_id![self, localObjects] - } - pub unsafe fn dispatchWithComponents(&self, components: &NSArray) { - msg_send![self, dispatchWithComponents: components] - } + ) -> Option>; + #[method_id(sendPort)] + pub unsafe fn sendPort(&self) -> Id; + #[method_id(receivePort)] + pub unsafe fn receivePort(&self) -> Id; + #[method(enableMultipleThreads)] + pub unsafe fn enableMultipleThreads(&self); + #[method(multipleThreadsEnabled)] + pub unsafe fn multipleThreadsEnabled(&self) -> bool; + # [method (addRunLoop :)] + pub unsafe fn addRunLoop(&self, runloop: &NSRunLoop); + # [method (removeRunLoop :)] + pub unsafe fn removeRunLoop(&self, runloop: &NSRunLoop); + #[method(runInNewThread)] + pub unsafe fn runInNewThread(&self); + #[method_id(remoteObjects)] + pub unsafe fn remoteObjects(&self) -> Id; + #[method_id(localObjects)] + pub unsafe fn localObjects(&self) -> Id; + # [method (dispatchWithComponents :)] + pub unsafe fn dispatchWithComponents(&self, components: &NSArray); } ); pub type NSConnectionDelegate = NSObject; @@ -225,17 +151,13 @@ extern_class!( ); extern_methods!( unsafe impl NSDistantObjectRequest { - pub unsafe fn invocation(&self) -> Id { - msg_send_id![self, invocation] - } - pub unsafe fn connection(&self) -> Id { - msg_send_id![self, connection] - } - pub unsafe fn conversation(&self) -> Id { - msg_send_id![self, conversation] - } - pub unsafe fn replyWithException(&self, exception: Option<&NSException>) { - msg_send![self, replyWithException: exception] - } + #[method_id(invocation)] + pub unsafe fn invocation(&self) -> Id; + #[method_id(connection)] + pub unsafe fn connection(&self) -> Id; + #[method_id(conversation)] + pub unsafe fn conversation(&self) -> Id; + # [method (replyWithException :)] + pub unsafe fn replyWithException(&self, exception: Option<&NSException>); } ); diff --git a/icrate/src/Foundation/generated/NSData.rs b/icrate/src/Foundation/generated/NSData.rs index e60d4ff6c..3462ad159 100644 --- a/icrate/src/Foundation/generated/NSData.rs +++ b/icrate/src/Foundation/generated/NSData.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSRange::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSData; @@ -16,290 +16,200 @@ extern_class!( ); extern_methods!( unsafe impl NSData { - pub unsafe fn length(&self) -> NSUInteger { - msg_send![self, length] - } - pub unsafe fn bytes(&self) -> NonNull { - msg_send![self, bytes] - } + #[method(length)] + pub unsafe fn length(&self) -> NSUInteger; + #[method(bytes)] + pub unsafe fn bytes(&self) -> NonNull; } ); extern_methods!( #[doc = "NSExtendedData"] unsafe impl NSData { - pub unsafe fn description(&self) -> Id { - msg_send_id![self, description] - } - pub unsafe fn getBytes_length(&self, buffer: NonNull, length: NSUInteger) { - msg_send![self, getBytes: buffer, length: length] - } - pub unsafe fn getBytes_range(&self, buffer: NonNull, range: NSRange) { - msg_send![self, getBytes: buffer, range: range] - } - pub unsafe fn isEqualToData(&self, other: &NSData) -> bool { - msg_send![self, isEqualToData: other] - } - pub unsafe fn subdataWithRange(&self, range: NSRange) -> Id { - msg_send_id![self, subdataWithRange: range] - } + #[method_id(description)] + pub unsafe fn description(&self) -> Id; + # [method (getBytes : length :)] + pub unsafe fn getBytes_length(&self, buffer: NonNull, length: NSUInteger); + # [method (getBytes : range :)] + pub unsafe fn getBytes_range(&self, buffer: NonNull, range: NSRange); + # [method (isEqualToData :)] + pub unsafe fn isEqualToData(&self, other: &NSData) -> bool; + # [method_id (subdataWithRange :)] + pub unsafe fn subdataWithRange(&self, range: NSRange) -> Id; + # [method (writeToFile : atomically :)] pub unsafe fn writeToFile_atomically( &self, path: &NSString, useAuxiliaryFile: bool, - ) -> bool { - msg_send![self, writeToFile: path, atomically: useAuxiliaryFile] - } - pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool { - msg_send![self, writeToURL: url, atomically: atomically] - } + ) -> bool; + # [method (writeToURL : atomically :)] + pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool; + # [method (writeToFile : options : error :)] pub unsafe fn writeToFile_options_error( &self, path: &NSString, writeOptionsMask: NSDataWritingOptions, - ) -> Result<(), Id> { - msg_send![self, writeToFile: path, options: writeOptionsMask, error: _] - } + ) -> Result<(), Id>; + # [method (writeToURL : options : error :)] pub unsafe fn writeToURL_options_error( &self, url: &NSURL, writeOptionsMask: NSDataWritingOptions, - ) -> Result<(), Id> { - msg_send![self, writeToURL: url, options: writeOptionsMask, error: _] - } + ) -> Result<(), Id>; + # [method (rangeOfData : options : range :)] pub unsafe fn rangeOfData_options_range( &self, dataToFind: &NSData, mask: NSDataSearchOptions, searchRange: NSRange, - ) -> NSRange { - msg_send![ - self, - rangeOfData: dataToFind, - options: mask, - range: searchRange - ] - } - pub unsafe fn enumerateByteRangesUsingBlock(&self, block: TodoBlock) { - msg_send![self, enumerateByteRangesUsingBlock: block] - } + ) -> NSRange; + # [method (enumerateByteRangesUsingBlock :)] + pub unsafe fn enumerateByteRangesUsingBlock(&self, block: TodoBlock); } ); extern_methods!( #[doc = "NSDataCreation"] unsafe impl NSData { - pub unsafe fn data() -> Id { - msg_send_id![Self::class(), data] - } + #[method_id(data)] + pub unsafe fn data() -> Id; + # [method_id (dataWithBytes : length :)] pub unsafe fn dataWithBytes_length( bytes: *mut c_void, length: NSUInteger, - ) -> Id { - msg_send_id![Self::class(), dataWithBytes: bytes, length: length] - } + ) -> Id; + # [method_id (dataWithBytesNoCopy : length :)] pub unsafe fn dataWithBytesNoCopy_length( bytes: NonNull, length: NSUInteger, - ) -> Id { - msg_send_id![Self::class(), dataWithBytesNoCopy: bytes, length: length] - } + ) -> Id; + # [method_id (dataWithBytesNoCopy : length : freeWhenDone :)] pub unsafe fn dataWithBytesNoCopy_length_freeWhenDone( bytes: NonNull, length: NSUInteger, b: bool, - ) -> Id { - msg_send_id![ - Self::class(), - dataWithBytesNoCopy: bytes, - length: length, - freeWhenDone: b - ] - } + ) -> Id; + # [method_id (dataWithContentsOfFile : options : error :)] pub unsafe fn dataWithContentsOfFile_options_error( path: &NSString, readOptionsMask: NSDataReadingOptions, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - dataWithContentsOfFile: path, - options: readOptionsMask, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (dataWithContentsOfURL : options : error :)] pub unsafe fn dataWithContentsOfURL_options_error( url: &NSURL, readOptionsMask: NSDataReadingOptions, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - dataWithContentsOfURL: url, - options: readOptionsMask, - error: _ - ] - } - pub unsafe fn dataWithContentsOfFile(path: &NSString) -> Option> { - msg_send_id![Self::class(), dataWithContentsOfFile: path] - } - pub unsafe fn dataWithContentsOfURL(url: &NSURL) -> Option> { - msg_send_id![Self::class(), dataWithContentsOfURL: url] - } + ) -> Result, Id>; + # [method_id (dataWithContentsOfFile :)] + pub unsafe fn dataWithContentsOfFile(path: &NSString) -> Option>; + # [method_id (dataWithContentsOfURL :)] + pub unsafe fn dataWithContentsOfURL(url: &NSURL) -> Option>; + # [method_id (initWithBytes : length :)] pub unsafe fn initWithBytes_length( &self, bytes: *mut c_void, length: NSUInteger, - ) -> Id { - msg_send_id![self, initWithBytes: bytes, length: length] - } + ) -> Id; + # [method_id (initWithBytesNoCopy : length :)] pub unsafe fn initWithBytesNoCopy_length( &self, bytes: NonNull, length: NSUInteger, - ) -> Id { - msg_send_id![self, initWithBytesNoCopy: bytes, length: length] - } + ) -> Id; + # [method_id (initWithBytesNoCopy : length : freeWhenDone :)] pub unsafe fn initWithBytesNoCopy_length_freeWhenDone( &self, bytes: NonNull, length: NSUInteger, b: bool, - ) -> Id { - msg_send_id![ - self, - initWithBytesNoCopy: bytes, - length: length, - freeWhenDone: b - ] - } + ) -> Id; + # [method_id (initWithBytesNoCopy : length : deallocator :)] pub unsafe fn initWithBytesNoCopy_length_deallocator( &self, bytes: NonNull, length: NSUInteger, deallocator: TodoBlock, - ) -> Id { - msg_send_id![ - self, - initWithBytesNoCopy: bytes, - length: length, - deallocator: deallocator - ] - } + ) -> Id; + # [method_id (initWithContentsOfFile : options : error :)] pub unsafe fn initWithContentsOfFile_options_error( &self, path: &NSString, readOptionsMask: NSDataReadingOptions, - ) -> Result, Id> { - msg_send_id![ - self, - initWithContentsOfFile: path, - options: readOptionsMask, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (initWithContentsOfURL : options : error :)] pub unsafe fn initWithContentsOfURL_options_error( &self, url: &NSURL, readOptionsMask: NSDataReadingOptions, - ) -> Result, Id> { - msg_send_id![ - self, - initWithContentsOfURL: url, - options: readOptionsMask, - error: _ - ] - } - pub unsafe fn initWithContentsOfFile(&self, path: &NSString) -> Option> { - msg_send_id![self, initWithContentsOfFile: path] - } - pub unsafe fn initWithContentsOfURL(&self, url: &NSURL) -> Option> { - msg_send_id![self, initWithContentsOfURL: url] - } - pub unsafe fn initWithData(&self, data: &NSData) -> Id { - msg_send_id![self, initWithData: data] - } - pub unsafe fn dataWithData(data: &NSData) -> Id { - msg_send_id![Self::class(), dataWithData: data] - } + ) -> Result, Id>; + # [method_id (initWithContentsOfFile :)] + pub unsafe fn initWithContentsOfFile(&self, path: &NSString) -> Option>; + # [method_id (initWithContentsOfURL :)] + pub unsafe fn initWithContentsOfURL(&self, url: &NSURL) -> Option>; + # [method_id (initWithData :)] + pub unsafe fn initWithData(&self, data: &NSData) -> Id; + # [method_id (dataWithData :)] + pub unsafe fn dataWithData(data: &NSData) -> Id; } ); extern_methods!( #[doc = "NSDataBase64Encoding"] unsafe impl NSData { + # [method_id (initWithBase64EncodedString : options :)] pub unsafe fn initWithBase64EncodedString_options( &self, base64String: &NSString, options: NSDataBase64DecodingOptions, - ) -> Option> { - msg_send_id![ - self, - initWithBase64EncodedString: base64String, - options: options - ] - } + ) -> Option>; + # [method_id (base64EncodedStringWithOptions :)] pub unsafe fn base64EncodedStringWithOptions( &self, options: NSDataBase64EncodingOptions, - ) -> Id { - msg_send_id![self, base64EncodedStringWithOptions: options] - } + ) -> Id; + # [method_id (initWithBase64EncodedData : options :)] pub unsafe fn initWithBase64EncodedData_options( &self, base64Data: &NSData, options: NSDataBase64DecodingOptions, - ) -> Option> { - msg_send_id![ - self, - initWithBase64EncodedData: base64Data, - options: options - ] - } + ) -> Option>; + # [method_id (base64EncodedDataWithOptions :)] pub unsafe fn base64EncodedDataWithOptions( &self, options: NSDataBase64EncodingOptions, - ) -> Id { - msg_send_id![self, base64EncodedDataWithOptions: options] - } + ) -> Id; } ); extern_methods!( #[doc = "NSDataCompression"] unsafe impl NSData { + # [method_id (decompressedDataUsingAlgorithm : error :)] pub unsafe fn decompressedDataUsingAlgorithm_error( &self, algorithm: NSDataCompressionAlgorithm, - ) -> Result, Id> { - msg_send_id![self, decompressedDataUsingAlgorithm: algorithm, error: _] - } + ) -> Result, Id>; + # [method_id (compressedDataUsingAlgorithm : error :)] pub unsafe fn compressedDataUsingAlgorithm_error( &self, algorithm: NSDataCompressionAlgorithm, - ) -> Result, Id> { - msg_send_id![self, compressedDataUsingAlgorithm: algorithm, error: _] - } + ) -> Result, Id>; } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSData { - pub unsafe fn getBytes(&self, buffer: NonNull) { - msg_send![self, getBytes: buffer] - } - pub unsafe fn dataWithContentsOfMappedFile(path: &NSString) -> Option> { - msg_send_id![Self::class(), dataWithContentsOfMappedFile: path] - } + # [method (getBytes :)] + pub unsafe fn getBytes(&self, buffer: NonNull); + # [method_id (dataWithContentsOfMappedFile :)] + pub unsafe fn dataWithContentsOfMappedFile(path: &NSString) -> Option>; + # [method_id (initWithContentsOfMappedFile :)] pub unsafe fn initWithContentsOfMappedFile( &self, path: &NSString, - ) -> Option> { - msg_send_id![self, initWithContentsOfMappedFile: path] - } + ) -> Option>; + # [method_id (initWithBase64Encoding :)] pub unsafe fn initWithBase64Encoding( &self, base64String: &NSString, - ) -> Option> { - msg_send_id![self, initWithBase64Encoding: base64String] - } - pub unsafe fn base64Encoding(&self) -> Id { - msg_send_id![self, base64Encoding] - } + ) -> Option>; + #[method_id(base64Encoding)] + pub unsafe fn base64Encoding(&self) -> Id; } ); extern_class!( @@ -311,85 +221,64 @@ extern_class!( ); extern_methods!( unsafe impl NSMutableData { - pub unsafe fn mutableBytes(&self) -> NonNull { - msg_send![self, mutableBytes] - } - pub unsafe fn length(&self) -> NSUInteger { - msg_send![self, length] - } - pub unsafe fn setLength(&self, length: NSUInteger) { - msg_send![self, setLength: length] - } + #[method(mutableBytes)] + pub unsafe fn mutableBytes(&self) -> NonNull; + #[method(length)] + pub unsafe fn length(&self) -> NSUInteger; + # [method (setLength :)] + pub unsafe fn setLength(&self, length: NSUInteger); } ); extern_methods!( #[doc = "NSExtendedMutableData"] unsafe impl NSMutableData { - pub unsafe fn appendBytes_length(&self, bytes: NonNull, length: NSUInteger) { - msg_send![self, appendBytes: bytes, length: length] - } - pub unsafe fn appendData(&self, other: &NSData) { - msg_send![self, appendData: other] - } - pub unsafe fn increaseLengthBy(&self, extraLength: NSUInteger) { - msg_send![self, increaseLengthBy: extraLength] - } - pub unsafe fn replaceBytesInRange_withBytes(&self, range: NSRange, bytes: NonNull) { - msg_send![self, replaceBytesInRange: range, withBytes: bytes] - } - pub unsafe fn resetBytesInRange(&self, range: NSRange) { - msg_send![self, resetBytesInRange: range] - } - pub unsafe fn setData(&self, data: &NSData) { - msg_send![self, setData: data] - } + # [method (appendBytes : length :)] + pub unsafe fn appendBytes_length(&self, bytes: NonNull, length: NSUInteger); + # [method (appendData :)] + pub unsafe fn appendData(&self, other: &NSData); + # [method (increaseLengthBy :)] + pub unsafe fn increaseLengthBy(&self, extraLength: NSUInteger); + # [method (replaceBytesInRange : withBytes :)] + pub unsafe fn replaceBytesInRange_withBytes(&self, range: NSRange, bytes: NonNull); + # [method (resetBytesInRange :)] + pub unsafe fn resetBytesInRange(&self, range: NSRange); + # [method (setData :)] + pub unsafe fn setData(&self, data: &NSData); + # [method (replaceBytesInRange : withBytes : length :)] pub unsafe fn replaceBytesInRange_withBytes_length( &self, range: NSRange, replacementBytes: *mut c_void, replacementLength: NSUInteger, - ) { - msg_send![ - self, - replaceBytesInRange: range, - withBytes: replacementBytes, - length: replacementLength - ] - } + ); } ); extern_methods!( #[doc = "NSMutableDataCreation"] unsafe impl NSMutableData { - pub unsafe fn dataWithCapacity(aNumItems: NSUInteger) -> Option> { - msg_send_id![Self::class(), dataWithCapacity: aNumItems] - } - pub unsafe fn dataWithLength(length: NSUInteger) -> Option> { - msg_send_id![Self::class(), dataWithLength: length] - } - pub unsafe fn initWithCapacity(&self, capacity: NSUInteger) -> Option> { - msg_send_id![self, initWithCapacity: capacity] - } - pub unsafe fn initWithLength(&self, length: NSUInteger) -> Option> { - msg_send_id![self, initWithLength: length] - } + # [method_id (dataWithCapacity :)] + pub unsafe fn dataWithCapacity(aNumItems: NSUInteger) -> Option>; + # [method_id (dataWithLength :)] + pub unsafe fn dataWithLength(length: NSUInteger) -> Option>; + # [method_id (initWithCapacity :)] + pub unsafe fn initWithCapacity(&self, capacity: NSUInteger) -> Option>; + # [method_id (initWithLength :)] + pub unsafe fn initWithLength(&self, length: NSUInteger) -> Option>; } ); extern_methods!( #[doc = "NSMutableDataCompression"] unsafe impl NSMutableData { + # [method (decompressUsingAlgorithm : error :)] pub unsafe fn decompressUsingAlgorithm_error( &self, algorithm: NSDataCompressionAlgorithm, - ) -> Result<(), Id> { - msg_send![self, decompressUsingAlgorithm: algorithm, error: _] - } + ) -> Result<(), Id>; + # [method (compressUsingAlgorithm : error :)] pub unsafe fn compressUsingAlgorithm_error( &self, algorithm: NSDataCompressionAlgorithm, - ) -> Result<(), Id> { - msg_send![self, compressUsingAlgorithm: algorithm, error: _] - } + ) -> Result<(), Id>; } ); extern_class!( diff --git a/icrate/src/Foundation/generated/NSDate.rs b/icrate/src/Foundation/generated/NSDate.rs index d6d934560..f865b8cf0 100644 --- a/icrate/src/Foundation/generated/NSDate.rs +++ b/icrate/src/Foundation/generated/NSDate.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSDate; @@ -14,121 +14,86 @@ extern_class!( ); extern_methods!( unsafe impl NSDate { - pub unsafe fn timeIntervalSinceReferenceDate(&self) -> NSTimeInterval { - msg_send![self, timeIntervalSinceReferenceDate] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method(timeIntervalSinceReferenceDate)] + pub unsafe fn timeIntervalSinceReferenceDate(&self) -> NSTimeInterval; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithTimeIntervalSinceReferenceDate :)] pub unsafe fn initWithTimeIntervalSinceReferenceDate( &self, ti: NSTimeInterval, - ) -> Id { - msg_send_id![self, initWithTimeIntervalSinceReferenceDate: ti] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSExtendedDate"] unsafe impl NSDate { - pub unsafe fn timeIntervalSinceDate(&self, anotherDate: &NSDate) -> NSTimeInterval { - msg_send![self, timeIntervalSinceDate: anotherDate] - } - pub unsafe fn timeIntervalSinceNow(&self) -> NSTimeInterval { - msg_send![self, timeIntervalSinceNow] - } - pub unsafe fn timeIntervalSince1970(&self) -> NSTimeInterval { - msg_send![self, timeIntervalSince1970] - } - pub unsafe fn addTimeInterval(&self, seconds: NSTimeInterval) -> Id { - msg_send_id![self, addTimeInterval: seconds] - } - pub unsafe fn dateByAddingTimeInterval(&self, ti: NSTimeInterval) -> Id { - msg_send_id![self, dateByAddingTimeInterval: ti] - } - pub unsafe fn earlierDate(&self, anotherDate: &NSDate) -> Id { - msg_send_id![self, earlierDate: anotherDate] - } - pub unsafe fn laterDate(&self, anotherDate: &NSDate) -> Id { - msg_send_id![self, laterDate: anotherDate] - } - pub unsafe fn compare(&self, other: &NSDate) -> NSComparisonResult { - msg_send![self, compare: other] - } - pub unsafe fn isEqualToDate(&self, otherDate: &NSDate) -> bool { - msg_send![self, isEqualToDate: otherDate] - } - pub unsafe fn description(&self) -> Id { - msg_send_id![self, description] - } - pub unsafe fn descriptionWithLocale( - &self, - locale: Option<&Object>, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale] - } - pub unsafe fn timeIntervalSinceReferenceDate() -> NSTimeInterval { - msg_send![Self::class(), timeIntervalSinceReferenceDate] - } + # [method (timeIntervalSinceDate :)] + pub unsafe fn timeIntervalSinceDate(&self, anotherDate: &NSDate) -> NSTimeInterval; + #[method(timeIntervalSinceNow)] + pub unsafe fn timeIntervalSinceNow(&self) -> NSTimeInterval; + #[method(timeIntervalSince1970)] + pub unsafe fn timeIntervalSince1970(&self) -> NSTimeInterval; + # [method_id (addTimeInterval :)] + pub unsafe fn addTimeInterval(&self, seconds: NSTimeInterval) -> Id; + # [method_id (dateByAddingTimeInterval :)] + pub unsafe fn dateByAddingTimeInterval(&self, ti: NSTimeInterval) -> Id; + # [method_id (earlierDate :)] + pub unsafe fn earlierDate(&self, anotherDate: &NSDate) -> Id; + # [method_id (laterDate :)] + pub unsafe fn laterDate(&self, anotherDate: &NSDate) -> Id; + # [method (compare :)] + pub unsafe fn compare(&self, other: &NSDate) -> NSComparisonResult; + # [method (isEqualToDate :)] + pub unsafe fn isEqualToDate(&self, otherDate: &NSDate) -> bool; + #[method_id(description)] + pub unsafe fn description(&self) -> Id; + # [method_id (descriptionWithLocale :)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + #[method(timeIntervalSinceReferenceDate)] + pub unsafe fn timeIntervalSinceReferenceDate() -> NSTimeInterval; } ); extern_methods!( #[doc = "NSDateCreation"] unsafe impl NSDate { - pub unsafe fn date() -> Id { - msg_send_id![Self::class(), date] - } - pub unsafe fn dateWithTimeIntervalSinceNow(secs: NSTimeInterval) -> Id { - msg_send_id![Self::class(), dateWithTimeIntervalSinceNow: secs] - } + #[method_id(date)] + pub unsafe fn date() -> Id; + # [method_id (dateWithTimeIntervalSinceNow :)] + pub unsafe fn dateWithTimeIntervalSinceNow(secs: NSTimeInterval) -> Id; + # [method_id (dateWithTimeIntervalSinceReferenceDate :)] pub unsafe fn dateWithTimeIntervalSinceReferenceDate( ti: NSTimeInterval, - ) -> Id { - msg_send_id![Self::class(), dateWithTimeIntervalSinceReferenceDate: ti] - } - pub unsafe fn dateWithTimeIntervalSince1970(secs: NSTimeInterval) -> Id { - msg_send_id![Self::class(), dateWithTimeIntervalSince1970: secs] - } + ) -> Id; + # [method_id (dateWithTimeIntervalSince1970 :)] + pub unsafe fn dateWithTimeIntervalSince1970(secs: NSTimeInterval) -> Id; + # [method_id (dateWithTimeInterval : sinceDate :)] pub unsafe fn dateWithTimeInterval_sinceDate( secsToBeAdded: NSTimeInterval, date: &NSDate, - ) -> Id { - msg_send_id![ - Self::class(), - dateWithTimeInterval: secsToBeAdded, - sinceDate: date - ] - } - pub unsafe fn distantFuture() -> Id { - msg_send_id![Self::class(), distantFuture] - } - pub unsafe fn distantPast() -> Id { - msg_send_id![Self::class(), distantPast] - } - pub unsafe fn now() -> Id { - msg_send_id![Self::class(), now] - } - pub unsafe fn initWithTimeIntervalSinceNow( - &self, - secs: NSTimeInterval, - ) -> Id { - msg_send_id![self, initWithTimeIntervalSinceNow: secs] - } + ) -> Id; + #[method_id(distantFuture)] + pub unsafe fn distantFuture() -> Id; + #[method_id(distantPast)] + pub unsafe fn distantPast() -> Id; + #[method_id(now)] + pub unsafe fn now() -> Id; + # [method_id (initWithTimeIntervalSinceNow :)] + pub unsafe fn initWithTimeIntervalSinceNow(&self, secs: NSTimeInterval) + -> Id; + # [method_id (initWithTimeIntervalSince1970 :)] pub unsafe fn initWithTimeIntervalSince1970( &self, secs: NSTimeInterval, - ) -> Id { - msg_send_id![self, initWithTimeIntervalSince1970: secs] - } + ) -> Id; + # [method_id (initWithTimeInterval : sinceDate :)] pub unsafe fn initWithTimeInterval_sinceDate( &self, secsToBeAdded: NSTimeInterval, date: &NSDate, - ) -> Id { - msg_send_id![self, initWithTimeInterval: secsToBeAdded, sinceDate: date] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSDateComponentsFormatter.rs b/icrate/src/Foundation/generated/NSDateComponentsFormatter.rs index dccfb9a81..41c55d016 100644 --- a/icrate/src/Foundation/generated/NSDateComponentsFormatter.rs +++ b/icrate/src/Foundation/generated/NSDateComponentsFormatter.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSNumberFormatter::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSDateComponentsFormatter; @@ -14,130 +14,87 @@ extern_class!( ); extern_methods!( unsafe impl NSDateComponentsFormatter { + # [method_id (stringForObjectValue :)] pub unsafe fn stringForObjectValue( &self, obj: Option<&Object>, - ) -> Option> { - msg_send_id![self, stringForObjectValue: obj] - } + ) -> Option>; + # [method_id (stringFromDateComponents :)] pub unsafe fn stringFromDateComponents( &self, components: &NSDateComponents, - ) -> Option> { - msg_send_id![self, stringFromDateComponents: components] - } + ) -> Option>; + # [method_id (stringFromDate : toDate :)] pub unsafe fn stringFromDate_toDate( &self, startDate: &NSDate, endDate: &NSDate, - ) -> Option> { - msg_send_id![self, stringFromDate: startDate, toDate: endDate] - } + ) -> Option>; + # [method_id (stringFromTimeInterval :)] pub unsafe fn stringFromTimeInterval( &self, ti: NSTimeInterval, - ) -> Option> { - msg_send_id![self, stringFromTimeInterval: ti] - } + ) -> Option>; + # [method_id (localizedStringFromDateComponents : unitsStyle :)] pub unsafe fn localizedStringFromDateComponents_unitsStyle( components: &NSDateComponents, unitsStyle: NSDateComponentsFormatterUnitsStyle, - ) -> Option> { - msg_send_id![ - Self::class(), - localizedStringFromDateComponents: components, - unitsStyle: unitsStyle - ] - } - pub unsafe fn unitsStyle(&self) -> NSDateComponentsFormatterUnitsStyle { - msg_send![self, unitsStyle] - } - pub unsafe fn setUnitsStyle(&self, unitsStyle: NSDateComponentsFormatterUnitsStyle) { - msg_send![self, setUnitsStyle: unitsStyle] - } - pub unsafe fn allowedUnits(&self) -> NSCalendarUnit { - msg_send![self, allowedUnits] - } - pub unsafe fn setAllowedUnits(&self, allowedUnits: NSCalendarUnit) { - msg_send![self, setAllowedUnits: allowedUnits] - } + ) -> Option>; + #[method(unitsStyle)] + pub unsafe fn unitsStyle(&self) -> NSDateComponentsFormatterUnitsStyle; + # [method (setUnitsStyle :)] + pub unsafe fn setUnitsStyle(&self, unitsStyle: NSDateComponentsFormatterUnitsStyle); + #[method(allowedUnits)] + pub unsafe fn allowedUnits(&self) -> NSCalendarUnit; + # [method (setAllowedUnits :)] + pub unsafe fn setAllowedUnits(&self, allowedUnits: NSCalendarUnit); + #[method(zeroFormattingBehavior)] pub unsafe fn zeroFormattingBehavior( &self, - ) -> NSDateComponentsFormatterZeroFormattingBehavior { - msg_send![self, zeroFormattingBehavior] - } + ) -> NSDateComponentsFormatterZeroFormattingBehavior; + # [method (setZeroFormattingBehavior :)] pub unsafe fn setZeroFormattingBehavior( &self, zeroFormattingBehavior: NSDateComponentsFormatterZeroFormattingBehavior, - ) { - msg_send![self, setZeroFormattingBehavior: zeroFormattingBehavior] - } - pub unsafe fn calendar(&self) -> Option> { - msg_send_id![self, calendar] - } - pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>) { - msg_send![self, setCalendar: calendar] - } - pub unsafe fn referenceDate(&self) -> Option> { - msg_send_id![self, referenceDate] - } - pub unsafe fn setReferenceDate(&self, referenceDate: Option<&NSDate>) { - msg_send![self, setReferenceDate: referenceDate] - } - pub unsafe fn allowsFractionalUnits(&self) -> bool { - msg_send![self, allowsFractionalUnits] - } - pub unsafe fn setAllowsFractionalUnits(&self, allowsFractionalUnits: bool) { - msg_send![self, setAllowsFractionalUnits: allowsFractionalUnits] - } - pub unsafe fn maximumUnitCount(&self) -> NSInteger { - msg_send![self, maximumUnitCount] - } - pub unsafe fn setMaximumUnitCount(&self, maximumUnitCount: NSInteger) { - msg_send![self, setMaximumUnitCount: maximumUnitCount] - } - pub unsafe fn collapsesLargestUnit(&self) -> bool { - msg_send![self, collapsesLargestUnit] - } - pub unsafe fn setCollapsesLargestUnit(&self, collapsesLargestUnit: bool) { - msg_send![self, setCollapsesLargestUnit: collapsesLargestUnit] - } - pub unsafe fn includesApproximationPhrase(&self) -> bool { - msg_send![self, includesApproximationPhrase] - } - pub unsafe fn setIncludesApproximationPhrase(&self, includesApproximationPhrase: bool) { - msg_send![ - self, - setIncludesApproximationPhrase: includesApproximationPhrase - ] - } - pub unsafe fn includesTimeRemainingPhrase(&self) -> bool { - msg_send![self, includesTimeRemainingPhrase] - } - pub unsafe fn setIncludesTimeRemainingPhrase(&self, includesTimeRemainingPhrase: bool) { - msg_send![ - self, - setIncludesTimeRemainingPhrase: includesTimeRemainingPhrase - ] - } - pub unsafe fn formattingContext(&self) -> NSFormattingContext { - msg_send![self, formattingContext] - } - pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext) { - msg_send![self, setFormattingContext: formattingContext] - } + ); + #[method_id(calendar)] + pub unsafe fn calendar(&self) -> Option>; + # [method (setCalendar :)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + #[method_id(referenceDate)] + pub unsafe fn referenceDate(&self) -> Option>; + # [method (setReferenceDate :)] + pub unsafe fn setReferenceDate(&self, referenceDate: Option<&NSDate>); + #[method(allowsFractionalUnits)] + pub unsafe fn allowsFractionalUnits(&self) -> bool; + # [method (setAllowsFractionalUnits :)] + pub unsafe fn setAllowsFractionalUnits(&self, allowsFractionalUnits: bool); + #[method(maximumUnitCount)] + pub unsafe fn maximumUnitCount(&self) -> NSInteger; + # [method (setMaximumUnitCount :)] + pub unsafe fn setMaximumUnitCount(&self, maximumUnitCount: NSInteger); + #[method(collapsesLargestUnit)] + pub unsafe fn collapsesLargestUnit(&self) -> bool; + # [method (setCollapsesLargestUnit :)] + pub unsafe fn setCollapsesLargestUnit(&self, collapsesLargestUnit: bool); + #[method(includesApproximationPhrase)] + pub unsafe fn includesApproximationPhrase(&self) -> bool; + # [method (setIncludesApproximationPhrase :)] + pub unsafe fn setIncludesApproximationPhrase(&self, includesApproximationPhrase: bool); + #[method(includesTimeRemainingPhrase)] + pub unsafe fn includesTimeRemainingPhrase(&self) -> bool; + # [method (setIncludesTimeRemainingPhrase :)] + pub unsafe fn setIncludesTimeRemainingPhrase(&self, includesTimeRemainingPhrase: bool); + #[method(formattingContext)] + pub unsafe fn formattingContext(&self) -> NSFormattingContext; + # [method (setFormattingContext :)] + pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext); + # [method (getObjectValue : forString : errorDescription :)] pub unsafe fn getObjectValue_forString_errorDescription( &self, obj: Option<&mut Option>>, string: &NSString, error: Option<&mut Option>>, - ) -> bool { - msg_send![ - self, - getObjectValue: obj, - forString: string, - errorDescription: error - ] - } + ) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSDateFormatter.rs b/icrate/src/Foundation/generated/NSDateFormatter.rs index 9c1210a3b..18001d193 100644 --- a/icrate/src/Foundation/generated/NSDateFormatter.rs +++ b/icrate/src/Foundation/generated/NSDateFormatter.rs @@ -11,7 +11,7 @@ use crate::Foundation::generated::NSFormatter::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSDateFormatter; @@ -21,336 +21,221 @@ extern_class!( ); extern_methods!( unsafe impl NSDateFormatter { - pub unsafe fn formattingContext(&self) -> NSFormattingContext { - msg_send![self, formattingContext] - } - pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext) { - msg_send![self, setFormattingContext: formattingContext] - } + #[method(formattingContext)] + pub unsafe fn formattingContext(&self) -> NSFormattingContext; + # [method (setFormattingContext :)] + pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext); + # [method (getObjectValue : forString : range : error :)] pub unsafe fn getObjectValue_forString_range_error( &self, obj: Option<&mut Option>>, string: &NSString, rangep: *mut NSRange, - ) -> Result<(), Id> { - msg_send![ - self, - getObjectValue: obj, - forString: string, - range: rangep, - error: _ - ] - } - pub unsafe fn stringFromDate(&self, date: &NSDate) -> Id { - msg_send_id![self, stringFromDate: date] - } - pub unsafe fn dateFromString(&self, string: &NSString) -> Option> { - msg_send_id![self, dateFromString: string] - } + ) -> Result<(), Id>; + # [method_id (stringFromDate :)] + pub unsafe fn stringFromDate(&self, date: &NSDate) -> Id; + # [method_id (dateFromString :)] + pub unsafe fn dateFromString(&self, string: &NSString) -> Option>; + # [method_id (localizedStringFromDate : dateStyle : timeStyle :)] pub unsafe fn localizedStringFromDate_dateStyle_timeStyle( date: &NSDate, dstyle: NSDateFormatterStyle, tstyle: NSDateFormatterStyle, - ) -> Id { - msg_send_id![ - Self::class(), - localizedStringFromDate: date, - dateStyle: dstyle, - timeStyle: tstyle - ] - } + ) -> Id; + # [method_id (dateFormatFromTemplate : options : locale :)] pub unsafe fn dateFormatFromTemplate_options_locale( tmplate: &NSString, opts: NSUInteger, locale: Option<&NSLocale>, - ) -> Option> { - msg_send_id![ - Self::class(), - dateFormatFromTemplate: tmplate, - options: opts, - locale: locale - ] - } - pub unsafe fn defaultFormatterBehavior() -> NSDateFormatterBehavior { - msg_send![Self::class(), defaultFormatterBehavior] - } + ) -> Option>; + #[method(defaultFormatterBehavior)] + pub unsafe fn defaultFormatterBehavior() -> NSDateFormatterBehavior; + # [method (setDefaultFormatterBehavior :)] pub unsafe fn setDefaultFormatterBehavior( defaultFormatterBehavior: NSDateFormatterBehavior, - ) { - msg_send![ - Self::class(), - setDefaultFormatterBehavior: defaultFormatterBehavior - ] - } - pub unsafe fn setLocalizedDateFormatFromTemplate(&self, dateFormatTemplate: &NSString) { - msg_send![self, setLocalizedDateFormatFromTemplate: dateFormatTemplate] - } - pub unsafe fn dateFormat(&self) -> Id { - msg_send_id![self, dateFormat] - } - pub unsafe fn setDateFormat(&self, dateFormat: Option<&NSString>) { - msg_send![self, setDateFormat: dateFormat] - } - pub unsafe fn dateStyle(&self) -> NSDateFormatterStyle { - msg_send![self, dateStyle] - } - pub unsafe fn setDateStyle(&self, dateStyle: NSDateFormatterStyle) { - msg_send![self, setDateStyle: dateStyle] - } - pub unsafe fn timeStyle(&self) -> NSDateFormatterStyle { - msg_send![self, timeStyle] - } - pub unsafe fn setTimeStyle(&self, timeStyle: NSDateFormatterStyle) { - msg_send![self, setTimeStyle: timeStyle] - } - pub unsafe fn locale(&self) -> Id { - msg_send_id![self, locale] - } - pub unsafe fn setLocale(&self, locale: Option<&NSLocale>) { - msg_send![self, setLocale: locale] - } - pub unsafe fn generatesCalendarDates(&self) -> bool { - msg_send![self, generatesCalendarDates] - } - pub unsafe fn setGeneratesCalendarDates(&self, generatesCalendarDates: bool) { - msg_send![self, setGeneratesCalendarDates: generatesCalendarDates] - } - pub unsafe fn formatterBehavior(&self) -> NSDateFormatterBehavior { - msg_send![self, formatterBehavior] - } - pub unsafe fn setFormatterBehavior(&self, formatterBehavior: NSDateFormatterBehavior) { - msg_send![self, setFormatterBehavior: formatterBehavior] - } - pub unsafe fn timeZone(&self) -> Id { - msg_send_id![self, timeZone] - } - pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>) { - msg_send![self, setTimeZone: timeZone] - } - pub unsafe fn calendar(&self) -> Id { - msg_send_id![self, calendar] - } - pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>) { - msg_send![self, setCalendar: calendar] - } - pub unsafe fn isLenient(&self) -> bool { - msg_send![self, isLenient] - } - pub unsafe fn setLenient(&self, lenient: bool) { - msg_send![self, setLenient: lenient] - } - pub unsafe fn twoDigitStartDate(&self) -> Option> { - msg_send_id![self, twoDigitStartDate] - } - pub unsafe fn setTwoDigitStartDate(&self, twoDigitStartDate: Option<&NSDate>) { - msg_send![self, setTwoDigitStartDate: twoDigitStartDate] - } - pub unsafe fn defaultDate(&self) -> Option> { - msg_send_id![self, defaultDate] - } - pub unsafe fn setDefaultDate(&self, defaultDate: Option<&NSDate>) { - msg_send![self, setDefaultDate: defaultDate] - } - pub unsafe fn eraSymbols(&self) -> Id, Shared> { - msg_send_id![self, eraSymbols] - } - pub unsafe fn setEraSymbols(&self, eraSymbols: Option<&NSArray>) { - msg_send![self, setEraSymbols: eraSymbols] - } - pub unsafe fn monthSymbols(&self) -> Id, Shared> { - msg_send_id![self, monthSymbols] - } - pub unsafe fn setMonthSymbols(&self, monthSymbols: Option<&NSArray>) { - msg_send![self, setMonthSymbols: monthSymbols] - } - pub unsafe fn shortMonthSymbols(&self) -> Id, Shared> { - msg_send_id![self, shortMonthSymbols] - } - pub unsafe fn setShortMonthSymbols(&self, shortMonthSymbols: Option<&NSArray>) { - msg_send![self, setShortMonthSymbols: shortMonthSymbols] - } - pub unsafe fn weekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, weekdaySymbols] - } - pub unsafe fn setWeekdaySymbols(&self, weekdaySymbols: Option<&NSArray>) { - msg_send![self, setWeekdaySymbols: weekdaySymbols] - } - pub unsafe fn shortWeekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, shortWeekdaySymbols] - } + ); + # [method (setLocalizedDateFormatFromTemplate :)] + pub unsafe fn setLocalizedDateFormatFromTemplate(&self, dateFormatTemplate: &NSString); + #[method_id(dateFormat)] + pub unsafe fn dateFormat(&self) -> Id; + # [method (setDateFormat :)] + pub unsafe fn setDateFormat(&self, dateFormat: Option<&NSString>); + #[method(dateStyle)] + pub unsafe fn dateStyle(&self) -> NSDateFormatterStyle; + # [method (setDateStyle :)] + pub unsafe fn setDateStyle(&self, dateStyle: NSDateFormatterStyle); + #[method(timeStyle)] + pub unsafe fn timeStyle(&self) -> NSDateFormatterStyle; + # [method (setTimeStyle :)] + pub unsafe fn setTimeStyle(&self, timeStyle: NSDateFormatterStyle); + #[method_id(locale)] + pub unsafe fn locale(&self) -> Id; + # [method (setLocale :)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + #[method(generatesCalendarDates)] + pub unsafe fn generatesCalendarDates(&self) -> bool; + # [method (setGeneratesCalendarDates :)] + pub unsafe fn setGeneratesCalendarDates(&self, generatesCalendarDates: bool); + #[method(formatterBehavior)] + pub unsafe fn formatterBehavior(&self) -> NSDateFormatterBehavior; + # [method (setFormatterBehavior :)] + pub unsafe fn setFormatterBehavior(&self, formatterBehavior: NSDateFormatterBehavior); + #[method_id(timeZone)] + pub unsafe fn timeZone(&self) -> Id; + # [method (setTimeZone :)] + pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>); + #[method_id(calendar)] + pub unsafe fn calendar(&self) -> Id; + # [method (setCalendar :)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + #[method(isLenient)] + pub unsafe fn isLenient(&self) -> bool; + # [method (setLenient :)] + pub unsafe fn setLenient(&self, lenient: bool); + #[method_id(twoDigitStartDate)] + pub unsafe fn twoDigitStartDate(&self) -> Option>; + # [method (setTwoDigitStartDate :)] + pub unsafe fn setTwoDigitStartDate(&self, twoDigitStartDate: Option<&NSDate>); + #[method_id(defaultDate)] + pub unsafe fn defaultDate(&self) -> Option>; + # [method (setDefaultDate :)] + pub unsafe fn setDefaultDate(&self, defaultDate: Option<&NSDate>); + #[method_id(eraSymbols)] + pub unsafe fn eraSymbols(&self) -> Id, Shared>; + # [method (setEraSymbols :)] + pub unsafe fn setEraSymbols(&self, eraSymbols: Option<&NSArray>); + #[method_id(monthSymbols)] + pub unsafe fn monthSymbols(&self) -> Id, Shared>; + # [method (setMonthSymbols :)] + pub unsafe fn setMonthSymbols(&self, monthSymbols: Option<&NSArray>); + #[method_id(shortMonthSymbols)] + pub unsafe fn shortMonthSymbols(&self) -> Id, Shared>; + # [method (setShortMonthSymbols :)] + pub unsafe fn setShortMonthSymbols(&self, shortMonthSymbols: Option<&NSArray>); + #[method_id(weekdaySymbols)] + pub unsafe fn weekdaySymbols(&self) -> Id, Shared>; + # [method (setWeekdaySymbols :)] + pub unsafe fn setWeekdaySymbols(&self, weekdaySymbols: Option<&NSArray>); + #[method_id(shortWeekdaySymbols)] + pub unsafe fn shortWeekdaySymbols(&self) -> Id, Shared>; + # [method (setShortWeekdaySymbols :)] pub unsafe fn setShortWeekdaySymbols( &self, shortWeekdaySymbols: Option<&NSArray>, - ) { - msg_send![self, setShortWeekdaySymbols: shortWeekdaySymbols] - } - pub unsafe fn AMSymbol(&self) -> Id { - msg_send_id![self, AMSymbol] - } - pub unsafe fn setAMSymbol(&self, AMSymbol: Option<&NSString>) { - msg_send![self, setAMSymbol: AMSymbol] - } - pub unsafe fn PMSymbol(&self) -> Id { - msg_send_id![self, PMSymbol] - } - pub unsafe fn setPMSymbol(&self, PMSymbol: Option<&NSString>) { - msg_send![self, setPMSymbol: PMSymbol] - } - pub unsafe fn longEraSymbols(&self) -> Id, Shared> { - msg_send_id![self, longEraSymbols] - } - pub unsafe fn setLongEraSymbols(&self, longEraSymbols: Option<&NSArray>) { - msg_send![self, setLongEraSymbols: longEraSymbols] - } - pub unsafe fn veryShortMonthSymbols(&self) -> Id, Shared> { - msg_send_id![self, veryShortMonthSymbols] - } + ); + #[method_id(AMSymbol)] + pub unsafe fn AMSymbol(&self) -> Id; + # [method (setAMSymbol :)] + pub unsafe fn setAMSymbol(&self, AMSymbol: Option<&NSString>); + #[method_id(PMSymbol)] + pub unsafe fn PMSymbol(&self) -> Id; + # [method (setPMSymbol :)] + pub unsafe fn setPMSymbol(&self, PMSymbol: Option<&NSString>); + #[method_id(longEraSymbols)] + pub unsafe fn longEraSymbols(&self) -> Id, Shared>; + # [method (setLongEraSymbols :)] + pub unsafe fn setLongEraSymbols(&self, longEraSymbols: Option<&NSArray>); + #[method_id(veryShortMonthSymbols)] + pub unsafe fn veryShortMonthSymbols(&self) -> Id, Shared>; + # [method (setVeryShortMonthSymbols :)] pub unsafe fn setVeryShortMonthSymbols( &self, veryShortMonthSymbols: Option<&NSArray>, - ) { - msg_send![self, setVeryShortMonthSymbols: veryShortMonthSymbols] - } - pub unsafe fn standaloneMonthSymbols(&self) -> Id, Shared> { - msg_send_id![self, standaloneMonthSymbols] - } + ); + #[method_id(standaloneMonthSymbols)] + pub unsafe fn standaloneMonthSymbols(&self) -> Id, Shared>; + # [method (setStandaloneMonthSymbols :)] pub unsafe fn setStandaloneMonthSymbols( &self, standaloneMonthSymbols: Option<&NSArray>, - ) { - msg_send![self, setStandaloneMonthSymbols: standaloneMonthSymbols] - } - pub unsafe fn shortStandaloneMonthSymbols(&self) -> Id, Shared> { - msg_send_id![self, shortStandaloneMonthSymbols] - } + ); + #[method_id(shortStandaloneMonthSymbols)] + pub unsafe fn shortStandaloneMonthSymbols(&self) -> Id, Shared>; + # [method (setShortStandaloneMonthSymbols :)] pub unsafe fn setShortStandaloneMonthSymbols( &self, shortStandaloneMonthSymbols: Option<&NSArray>, - ) { - msg_send![ - self, - setShortStandaloneMonthSymbols: shortStandaloneMonthSymbols - ] - } - pub unsafe fn veryShortStandaloneMonthSymbols(&self) -> Id, Shared> { - msg_send_id![self, veryShortStandaloneMonthSymbols] - } + ); + #[method_id(veryShortStandaloneMonthSymbols)] + pub unsafe fn veryShortStandaloneMonthSymbols(&self) -> Id, Shared>; + # [method (setVeryShortStandaloneMonthSymbols :)] pub unsafe fn setVeryShortStandaloneMonthSymbols( &self, veryShortStandaloneMonthSymbols: Option<&NSArray>, - ) { - msg_send![ - self, - setVeryShortStandaloneMonthSymbols: veryShortStandaloneMonthSymbols - ] - } - pub unsafe fn veryShortWeekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, veryShortWeekdaySymbols] - } + ); + #[method_id(veryShortWeekdaySymbols)] + pub unsafe fn veryShortWeekdaySymbols(&self) -> Id, Shared>; + # [method (setVeryShortWeekdaySymbols :)] pub unsafe fn setVeryShortWeekdaySymbols( &self, veryShortWeekdaySymbols: Option<&NSArray>, - ) { - msg_send![self, setVeryShortWeekdaySymbols: veryShortWeekdaySymbols] - } - pub unsafe fn standaloneWeekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, standaloneWeekdaySymbols] - } + ); + #[method_id(standaloneWeekdaySymbols)] + pub unsafe fn standaloneWeekdaySymbols(&self) -> Id, Shared>; + # [method (setStandaloneWeekdaySymbols :)] pub unsafe fn setStandaloneWeekdaySymbols( &self, standaloneWeekdaySymbols: Option<&NSArray>, - ) { - msg_send![self, setStandaloneWeekdaySymbols: standaloneWeekdaySymbols] - } - pub unsafe fn shortStandaloneWeekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, shortStandaloneWeekdaySymbols] - } + ); + #[method_id(shortStandaloneWeekdaySymbols)] + pub unsafe fn shortStandaloneWeekdaySymbols(&self) -> Id, Shared>; + # [method (setShortStandaloneWeekdaySymbols :)] pub unsafe fn setShortStandaloneWeekdaySymbols( &self, shortStandaloneWeekdaySymbols: Option<&NSArray>, - ) { - msg_send![ - self, - setShortStandaloneWeekdaySymbols: shortStandaloneWeekdaySymbols - ] - } - pub unsafe fn veryShortStandaloneWeekdaySymbols(&self) -> Id, Shared> { - msg_send_id![self, veryShortStandaloneWeekdaySymbols] - } + ); + #[method_id(veryShortStandaloneWeekdaySymbols)] + pub unsafe fn veryShortStandaloneWeekdaySymbols(&self) -> Id, Shared>; + # [method (setVeryShortStandaloneWeekdaySymbols :)] pub unsafe fn setVeryShortStandaloneWeekdaySymbols( &self, veryShortStandaloneWeekdaySymbols: Option<&NSArray>, - ) { - msg_send![ - self, - setVeryShortStandaloneWeekdaySymbols: veryShortStandaloneWeekdaySymbols - ] - } - pub unsafe fn quarterSymbols(&self) -> Id, Shared> { - msg_send_id![self, quarterSymbols] - } - pub unsafe fn setQuarterSymbols(&self, quarterSymbols: Option<&NSArray>) { - msg_send![self, setQuarterSymbols: quarterSymbols] - } - pub unsafe fn shortQuarterSymbols(&self) -> Id, Shared> { - msg_send_id![self, shortQuarterSymbols] - } + ); + #[method_id(quarterSymbols)] + pub unsafe fn quarterSymbols(&self) -> Id, Shared>; + # [method (setQuarterSymbols :)] + pub unsafe fn setQuarterSymbols(&self, quarterSymbols: Option<&NSArray>); + #[method_id(shortQuarterSymbols)] + pub unsafe fn shortQuarterSymbols(&self) -> Id, Shared>; + # [method (setShortQuarterSymbols :)] pub unsafe fn setShortQuarterSymbols( &self, shortQuarterSymbols: Option<&NSArray>, - ) { - msg_send![self, setShortQuarterSymbols: shortQuarterSymbols] - } - pub unsafe fn standaloneQuarterSymbols(&self) -> Id, Shared> { - msg_send_id![self, standaloneQuarterSymbols] - } + ); + #[method_id(standaloneQuarterSymbols)] + pub unsafe fn standaloneQuarterSymbols(&self) -> Id, Shared>; + # [method (setStandaloneQuarterSymbols :)] pub unsafe fn setStandaloneQuarterSymbols( &self, standaloneQuarterSymbols: Option<&NSArray>, - ) { - msg_send![self, setStandaloneQuarterSymbols: standaloneQuarterSymbols] - } - pub unsafe fn shortStandaloneQuarterSymbols(&self) -> Id, Shared> { - msg_send_id![self, shortStandaloneQuarterSymbols] - } + ); + #[method_id(shortStandaloneQuarterSymbols)] + pub unsafe fn shortStandaloneQuarterSymbols(&self) -> Id, Shared>; + # [method (setShortStandaloneQuarterSymbols :)] pub unsafe fn setShortStandaloneQuarterSymbols( &self, shortStandaloneQuarterSymbols: Option<&NSArray>, - ) { - msg_send![ - self, - setShortStandaloneQuarterSymbols: shortStandaloneQuarterSymbols - ] - } - pub unsafe fn gregorianStartDate(&self) -> Option> { - msg_send_id![self, gregorianStartDate] - } - pub unsafe fn setGregorianStartDate(&self, gregorianStartDate: Option<&NSDate>) { - msg_send![self, setGregorianStartDate: gregorianStartDate] - } - pub unsafe fn doesRelativeDateFormatting(&self) -> bool { - msg_send![self, doesRelativeDateFormatting] - } - pub unsafe fn setDoesRelativeDateFormatting(&self, doesRelativeDateFormatting: bool) { - msg_send![ - self, - setDoesRelativeDateFormatting: doesRelativeDateFormatting - ] - } + ); + #[method_id(gregorianStartDate)] + pub unsafe fn gregorianStartDate(&self) -> Option>; + # [method (setGregorianStartDate :)] + pub unsafe fn setGregorianStartDate(&self, gregorianStartDate: Option<&NSDate>); + #[method(doesRelativeDateFormatting)] + pub unsafe fn doesRelativeDateFormatting(&self) -> bool; + # [method (setDoesRelativeDateFormatting :)] + pub unsafe fn setDoesRelativeDateFormatting(&self, doesRelativeDateFormatting: bool); } ); extern_methods!( #[doc = "NSDateFormatterCompatibility"] unsafe impl NSDateFormatter { + # [method_id (initWithDateFormat : allowNaturalLanguage :)] pub unsafe fn initWithDateFormat_allowNaturalLanguage( &self, format: &NSString, flag: bool, - ) -> Id { - msg_send_id![self, initWithDateFormat: format, allowNaturalLanguage: flag] - } - pub unsafe fn allowsNaturalLanguage(&self) -> bool { - msg_send![self, allowsNaturalLanguage] - } + ) -> Id; + #[method(allowsNaturalLanguage)] + pub unsafe fn allowsNaturalLanguage(&self) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSDateInterval.rs b/icrate/src/Foundation/generated/NSDateInterval.rs index 8cefe0a51..f6c814936 100644 --- a/icrate/src/Foundation/generated/NSDateInterval.rs +++ b/icrate/src/Foundation/generated/NSDateInterval.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSDateInterval; @@ -14,52 +14,40 @@ extern_class!( ); extern_methods!( unsafe impl NSDateInterval { - pub unsafe fn startDate(&self) -> Id { - msg_send_id![self, startDate] - } - pub unsafe fn endDate(&self) -> Id { - msg_send_id![self, endDate] - } - pub unsafe fn duration(&self) -> NSTimeInterval { - msg_send![self, duration] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Id { - msg_send_id![self, initWithCoder: coder] - } + #[method_id(startDate)] + pub unsafe fn startDate(&self) -> Id; + #[method_id(endDate)] + pub unsafe fn endDate(&self) -> Id; + #[method(duration)] + pub unsafe fn duration(&self) -> NSTimeInterval; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Id; + # [method_id (initWithStartDate : duration :)] pub unsafe fn initWithStartDate_duration( &self, startDate: &NSDate, duration: NSTimeInterval, - ) -> Id { - msg_send_id![self, initWithStartDate: startDate, duration: duration] - } + ) -> Id; + # [method_id (initWithStartDate : endDate :)] pub unsafe fn initWithStartDate_endDate( &self, startDate: &NSDate, endDate: &NSDate, - ) -> Id { - msg_send_id![self, initWithStartDate: startDate, endDate: endDate] - } - pub unsafe fn compare(&self, dateInterval: &NSDateInterval) -> NSComparisonResult { - msg_send![self, compare: dateInterval] - } - pub unsafe fn isEqualToDateInterval(&self, dateInterval: &NSDateInterval) -> bool { - msg_send![self, isEqualToDateInterval: dateInterval] - } - pub unsafe fn intersectsDateInterval(&self, dateInterval: &NSDateInterval) -> bool { - msg_send![self, intersectsDateInterval: dateInterval] - } + ) -> Id; + # [method (compare :)] + pub unsafe fn compare(&self, dateInterval: &NSDateInterval) -> NSComparisonResult; + # [method (isEqualToDateInterval :)] + pub unsafe fn isEqualToDateInterval(&self, dateInterval: &NSDateInterval) -> bool; + # [method (intersectsDateInterval :)] + pub unsafe fn intersectsDateInterval(&self, dateInterval: &NSDateInterval) -> bool; + # [method_id (intersectionWithDateInterval :)] pub unsafe fn intersectionWithDateInterval( &self, dateInterval: &NSDateInterval, - ) -> Option> { - msg_send_id![self, intersectionWithDateInterval: dateInterval] - } - pub unsafe fn containsDate(&self, date: &NSDate) -> bool { - msg_send![self, containsDate: date] - } + ) -> Option>; + # [method (containsDate :)] + pub unsafe fn containsDate(&self, date: &NSDate) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSDateIntervalFormatter.rs b/icrate/src/Foundation/generated/NSDateIntervalFormatter.rs index bc4bb6e15..397616959 100644 --- a/icrate/src/Foundation/generated/NSDateIntervalFormatter.rs +++ b/icrate/src/Foundation/generated/NSDateIntervalFormatter.rs @@ -8,7 +8,7 @@ use crate::Foundation::generated::NSFormatter::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSDateIntervalFormatter; @@ -18,54 +18,40 @@ extern_class!( ); extern_methods!( unsafe impl NSDateIntervalFormatter { - pub unsafe fn locale(&self) -> Id { - msg_send_id![self, locale] - } - pub unsafe fn setLocale(&self, locale: Option<&NSLocale>) { - msg_send![self, setLocale: locale] - } - pub unsafe fn calendar(&self) -> Id { - msg_send_id![self, calendar] - } - pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>) { - msg_send![self, setCalendar: calendar] - } - pub unsafe fn timeZone(&self) -> Id { - msg_send_id![self, timeZone] - } - pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>) { - msg_send![self, setTimeZone: timeZone] - } - pub unsafe fn dateTemplate(&self) -> Id { - msg_send_id![self, dateTemplate] - } - pub unsafe fn setDateTemplate(&self, dateTemplate: Option<&NSString>) { - msg_send![self, setDateTemplate: dateTemplate] - } - pub unsafe fn dateStyle(&self) -> NSDateIntervalFormatterStyle { - msg_send![self, dateStyle] - } - pub unsafe fn setDateStyle(&self, dateStyle: NSDateIntervalFormatterStyle) { - msg_send![self, setDateStyle: dateStyle] - } - pub unsafe fn timeStyle(&self) -> NSDateIntervalFormatterStyle { - msg_send![self, timeStyle] - } - pub unsafe fn setTimeStyle(&self, timeStyle: NSDateIntervalFormatterStyle) { - msg_send![self, setTimeStyle: timeStyle] - } + #[method_id(locale)] + pub unsafe fn locale(&self) -> Id; + # [method (setLocale :)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + #[method_id(calendar)] + pub unsafe fn calendar(&self) -> Id; + # [method (setCalendar :)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + #[method_id(timeZone)] + pub unsafe fn timeZone(&self) -> Id; + # [method (setTimeZone :)] + pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>); + #[method_id(dateTemplate)] + pub unsafe fn dateTemplate(&self) -> Id; + # [method (setDateTemplate :)] + pub unsafe fn setDateTemplate(&self, dateTemplate: Option<&NSString>); + #[method(dateStyle)] + pub unsafe fn dateStyle(&self) -> NSDateIntervalFormatterStyle; + # [method (setDateStyle :)] + pub unsafe fn setDateStyle(&self, dateStyle: NSDateIntervalFormatterStyle); + #[method(timeStyle)] + pub unsafe fn timeStyle(&self) -> NSDateIntervalFormatterStyle; + # [method (setTimeStyle :)] + pub unsafe fn setTimeStyle(&self, timeStyle: NSDateIntervalFormatterStyle); + # [method_id (stringFromDate : toDate :)] pub unsafe fn stringFromDate_toDate( &self, fromDate: &NSDate, toDate: &NSDate, - ) -> Id { - msg_send_id![self, stringFromDate: fromDate, toDate: toDate] - } + ) -> Id; + # [method_id (stringFromDateInterval :)] pub unsafe fn stringFromDateInterval( &self, dateInterval: &NSDateInterval, - ) -> Option> { - msg_send_id![self, stringFromDateInterval: dateInterval] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSDecimal.rs b/icrate/src/Foundation/generated/NSDecimal.rs index 51f969af1..53a1f0c4f 100644 --- a/icrate/src/Foundation/generated/NSDecimal.rs +++ b/icrate/src/Foundation/generated/NSDecimal.rs @@ -3,4 +3,4 @@ use crate::Foundation::generated::NSObjCRuntime::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; diff --git a/icrate/src/Foundation/generated/NSDecimalNumber.rs b/icrate/src/Foundation/generated/NSDecimalNumber.rs index 862a40f29..13f21237f 100644 --- a/icrate/src/Foundation/generated/NSDecimalNumber.rs +++ b/icrate/src/Foundation/generated/NSDecimalNumber.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSValue::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSDecimalNumberBehaviors = NSObject; extern_class!( #[derive(Debug)] @@ -17,209 +17,136 @@ extern_class!( ); extern_methods!( unsafe impl NSDecimalNumber { + # [method_id (initWithMantissa : exponent : isNegative :)] pub unsafe fn initWithMantissa_exponent_isNegative( &self, mantissa: c_ulonglong, exponent: c_short, flag: bool, - ) -> Id { - msg_send_id![ - self, - initWithMantissa: mantissa, - exponent: exponent, - isNegative: flag - ] - } - pub unsafe fn initWithDecimal(&self, dcm: NSDecimal) -> Id { - msg_send_id![self, initWithDecimal: dcm] - } - pub unsafe fn initWithString(&self, numberValue: Option<&NSString>) -> Id { - msg_send_id![self, initWithString: numberValue] - } + ) -> Id; + # [method_id (initWithDecimal :)] + pub unsafe fn initWithDecimal(&self, dcm: NSDecimal) -> Id; + # [method_id (initWithString :)] + pub unsafe fn initWithString(&self, numberValue: Option<&NSString>) -> Id; + # [method_id (initWithString : locale :)] pub unsafe fn initWithString_locale( &self, numberValue: Option<&NSString>, locale: Option<&Object>, - ) -> Id { - msg_send_id![self, initWithString: numberValue, locale: locale] - } - pub unsafe fn descriptionWithLocale( - &self, - locale: Option<&Object>, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale] - } - pub unsafe fn decimalValue(&self) -> NSDecimal { - msg_send![self, decimalValue] - } + ) -> Id; + # [method_id (descriptionWithLocale :)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + #[method(decimalValue)] + pub unsafe fn decimalValue(&self) -> NSDecimal; + # [method_id (decimalNumberWithMantissa : exponent : isNegative :)] pub unsafe fn decimalNumberWithMantissa_exponent_isNegative( mantissa: c_ulonglong, exponent: c_short, flag: bool, - ) -> Id { - msg_send_id![ - Self::class(), - decimalNumberWithMantissa: mantissa, - exponent: exponent, - isNegative: flag - ] - } - pub unsafe fn decimalNumberWithDecimal(dcm: NSDecimal) -> Id { - msg_send_id![Self::class(), decimalNumberWithDecimal: dcm] - } + ) -> Id; + # [method_id (decimalNumberWithDecimal :)] + pub unsafe fn decimalNumberWithDecimal(dcm: NSDecimal) -> Id; + # [method_id (decimalNumberWithString :)] pub unsafe fn decimalNumberWithString( numberValue: Option<&NSString>, - ) -> Id { - msg_send_id![Self::class(), decimalNumberWithString: numberValue] - } + ) -> Id; + # [method_id (decimalNumberWithString : locale :)] pub unsafe fn decimalNumberWithString_locale( numberValue: Option<&NSString>, locale: Option<&Object>, - ) -> Id { - msg_send_id![ - Self::class(), - decimalNumberWithString: numberValue, - locale: locale - ] - } - pub unsafe fn zero() -> Id { - msg_send_id![Self::class(), zero] - } - pub unsafe fn one() -> Id { - msg_send_id![Self::class(), one] - } - pub unsafe fn minimumDecimalNumber() -> Id { - msg_send_id![Self::class(), minimumDecimalNumber] - } - pub unsafe fn maximumDecimalNumber() -> Id { - msg_send_id![Self::class(), maximumDecimalNumber] - } - pub unsafe fn notANumber() -> Id { - msg_send_id![Self::class(), notANumber] - } + ) -> Id; + #[method_id(zero)] + pub unsafe fn zero() -> Id; + #[method_id(one)] + pub unsafe fn one() -> Id; + #[method_id(minimumDecimalNumber)] + pub unsafe fn minimumDecimalNumber() -> Id; + #[method_id(maximumDecimalNumber)] + pub unsafe fn maximumDecimalNumber() -> Id; + #[method_id(notANumber)] + pub unsafe fn notANumber() -> Id; + # [method_id (decimalNumberByAdding :)] pub unsafe fn decimalNumberByAdding( &self, decimalNumber: &NSDecimalNumber, - ) -> Id { - msg_send_id![self, decimalNumberByAdding: decimalNumber] - } + ) -> Id; + # [method_id (decimalNumberByAdding : withBehavior :)] pub unsafe fn decimalNumberByAdding_withBehavior( &self, decimalNumber: &NSDecimalNumber, behavior: Option<&NSDecimalNumberBehaviors>, - ) -> Id { - msg_send_id![ - self, - decimalNumberByAdding: decimalNumber, - withBehavior: behavior - ] - } + ) -> Id; + # [method_id (decimalNumberBySubtracting :)] pub unsafe fn decimalNumberBySubtracting( &self, decimalNumber: &NSDecimalNumber, - ) -> Id { - msg_send_id![self, decimalNumberBySubtracting: decimalNumber] - } + ) -> Id; + # [method_id (decimalNumberBySubtracting : withBehavior :)] pub unsafe fn decimalNumberBySubtracting_withBehavior( &self, decimalNumber: &NSDecimalNumber, behavior: Option<&NSDecimalNumberBehaviors>, - ) -> Id { - msg_send_id![ - self, - decimalNumberBySubtracting: decimalNumber, - withBehavior: behavior - ] - } + ) -> Id; + # [method_id (decimalNumberByMultiplyingBy :)] pub unsafe fn decimalNumberByMultiplyingBy( &self, decimalNumber: &NSDecimalNumber, - ) -> Id { - msg_send_id![self, decimalNumberByMultiplyingBy: decimalNumber] - } + ) -> Id; + # [method_id (decimalNumberByMultiplyingBy : withBehavior :)] pub unsafe fn decimalNumberByMultiplyingBy_withBehavior( &self, decimalNumber: &NSDecimalNumber, behavior: Option<&NSDecimalNumberBehaviors>, - ) -> Id { - msg_send_id![ - self, - decimalNumberByMultiplyingBy: decimalNumber, - withBehavior: behavior - ] - } + ) -> Id; + # [method_id (decimalNumberByDividingBy :)] pub unsafe fn decimalNumberByDividingBy( &self, decimalNumber: &NSDecimalNumber, - ) -> Id { - msg_send_id![self, decimalNumberByDividingBy: decimalNumber] - } + ) -> Id; + # [method_id (decimalNumberByDividingBy : withBehavior :)] pub unsafe fn decimalNumberByDividingBy_withBehavior( &self, decimalNumber: &NSDecimalNumber, behavior: Option<&NSDecimalNumberBehaviors>, - ) -> Id { - msg_send_id![ - self, - decimalNumberByDividingBy: decimalNumber, - withBehavior: behavior - ] - } + ) -> Id; + # [method_id (decimalNumberByRaisingToPower :)] pub unsafe fn decimalNumberByRaisingToPower( &self, power: NSUInteger, - ) -> Id { - msg_send_id![self, decimalNumberByRaisingToPower: power] - } + ) -> Id; + # [method_id (decimalNumberByRaisingToPower : withBehavior :)] pub unsafe fn decimalNumberByRaisingToPower_withBehavior( &self, power: NSUInteger, behavior: Option<&NSDecimalNumberBehaviors>, - ) -> Id { - msg_send_id![ - self, - decimalNumberByRaisingToPower: power, - withBehavior: behavior - ] - } + ) -> Id; + # [method_id (decimalNumberByMultiplyingByPowerOf10 :)] pub unsafe fn decimalNumberByMultiplyingByPowerOf10( &self, power: c_short, - ) -> Id { - msg_send_id![self, decimalNumberByMultiplyingByPowerOf10: power] - } + ) -> Id; + # [method_id (decimalNumberByMultiplyingByPowerOf10 : withBehavior :)] pub unsafe fn decimalNumberByMultiplyingByPowerOf10_withBehavior( &self, power: c_short, behavior: Option<&NSDecimalNumberBehaviors>, - ) -> Id { - msg_send_id![ - self, - decimalNumberByMultiplyingByPowerOf10: power, - withBehavior: behavior - ] - } + ) -> Id; + # [method_id (decimalNumberByRoundingAccordingToBehavior :)] pub unsafe fn decimalNumberByRoundingAccordingToBehavior( &self, behavior: Option<&NSDecimalNumberBehaviors>, - ) -> Id { - msg_send_id![self, decimalNumberByRoundingAccordingToBehavior: behavior] - } - pub unsafe fn compare(&self, decimalNumber: &NSNumber) -> NSComparisonResult { - msg_send![self, compare: decimalNumber] - } - pub unsafe fn defaultBehavior() -> Id { - msg_send_id![Self::class(), defaultBehavior] - } - pub unsafe fn setDefaultBehavior(defaultBehavior: &NSDecimalNumberBehaviors) { - msg_send![Self::class(), setDefaultBehavior: defaultBehavior] - } - pub unsafe fn objCType(&self) -> NonNull { - msg_send![self, objCType] - } - pub unsafe fn doubleValue(&self) -> c_double { - msg_send![self, doubleValue] - } + ) -> Id; + # [method (compare :)] + pub unsafe fn compare(&self, decimalNumber: &NSNumber) -> NSComparisonResult; + #[method_id(defaultBehavior)] + pub unsafe fn defaultBehavior() -> Id; + # [method (setDefaultBehavior :)] + pub unsafe fn setDefaultBehavior(defaultBehavior: &NSDecimalNumberBehaviors); + #[method(objCType)] + pub unsafe fn objCType(&self) -> NonNull; + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; } ); extern_class!( @@ -231,9 +158,9 @@ extern_class!( ); extern_methods!( unsafe impl NSDecimalNumberHandler { - pub unsafe fn defaultDecimalNumberHandler() -> Id { - msg_send_id![Self::class(), defaultDecimalNumberHandler] - } + #[method_id(defaultDecimalNumberHandler)] + pub unsafe fn defaultDecimalNumberHandler() -> Id; + # [method_id (initWithRoundingMode : scale : raiseOnExactness : raiseOnOverflow : raiseOnUnderflow : raiseOnDivideByZero :)] pub unsafe fn initWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero( &self, roundingMode: NSRoundingMode, @@ -242,17 +169,8 @@ extern_methods!( overflow: bool, underflow: bool, divideByZero: bool, - ) -> Id { - msg_send_id![ - self, - initWithRoundingMode: roundingMode, - scale: scale, - raiseOnExactness: exact, - raiseOnOverflow: overflow, - raiseOnUnderflow: underflow, - raiseOnDivideByZero: divideByZero - ] - } + ) -> Id; + # [method_id (decimalNumberHandlerWithRoundingMode : scale : raiseOnExactness : raiseOnOverflow : raiseOnUnderflow : raiseOnDivideByZero :)] pub unsafe fn decimalNumberHandlerWithRoundingMode_scale_raiseOnExactness_raiseOnOverflow_raiseOnUnderflow_raiseOnDivideByZero( roundingMode: NSRoundingMode, scale: c_short, @@ -260,32 +178,20 @@ extern_methods!( overflow: bool, underflow: bool, divideByZero: bool, - ) -> Id { - msg_send_id![ - Self::class(), - decimalNumberHandlerWithRoundingMode: roundingMode, - scale: scale, - raiseOnExactness: exact, - raiseOnOverflow: overflow, - raiseOnUnderflow: underflow, - raiseOnDivideByZero: divideByZero - ] - } + ) -> Id; } ); extern_methods!( #[doc = "NSDecimalNumberExtensions"] unsafe impl NSNumber { - pub unsafe fn decimalValue(&self) -> NSDecimal { - msg_send![self, decimalValue] - } + #[method(decimalValue)] + pub unsafe fn decimalValue(&self) -> NSDecimal; } ); extern_methods!( #[doc = "NSDecimalNumberScanning"] unsafe impl NSScanner { - pub unsafe fn scanDecimal(&self, dcm: *mut NSDecimal) -> bool { - msg_send![self, scanDecimal: dcm] - } + # [method (scanDecimal :)] + pub unsafe fn scanDecimal(&self, dcm: *mut NSDecimal) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSDictionary.rs b/icrate/src/Foundation/generated/NSDictionary.rs index d3806e855..bfdc5c6da 100644 --- a/icrate/src/Foundation/generated/NSDictionary.rs +++ b/icrate/src/Foundation/generated/NSDictionary.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; __inner_extern_class!( #[derive(Debug)] pub struct NSDictionary; @@ -17,256 +17,198 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSDictionary { - pub unsafe fn count(&self) -> NSUInteger { - msg_send![self, count] - } - pub unsafe fn objectForKey(&self, aKey: &KeyType) -> Option> { - msg_send_id![self, objectForKey: aKey] - } - pub unsafe fn keyEnumerator(&self) -> Id, Shared> { - msg_send_id![self, keyEnumerator] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + # [method_id (objectForKey :)] + pub unsafe fn objectForKey(&self, aKey: &KeyType) -> Option>; + #[method_id(keyEnumerator)] + pub unsafe fn keyEnumerator(&self) -> Id, Shared>; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithObjects : forKeys : count :)] pub unsafe fn initWithObjects_forKeys_count( &self, objects: TodoArray, keys: TodoArray, cnt: NSUInteger, - ) -> Id { - msg_send_id![self, initWithObjects: objects, forKeys: keys, count: cnt] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSExtendedDictionary"] unsafe impl NSDictionary { - pub unsafe fn allKeys(&self) -> Id, Shared> { - msg_send_id![self, allKeys] - } + #[method_id(allKeys)] + pub unsafe fn allKeys(&self) -> Id, Shared>; + # [method_id (allKeysForObject :)] pub unsafe fn allKeysForObject( &self, anObject: &ObjectType, - ) -> Id, Shared> { - msg_send_id![self, allKeysForObject: anObject] - } - pub unsafe fn allValues(&self) -> Id, Shared> { - msg_send_id![self, allValues] - } - pub unsafe fn description(&self) -> Id { - msg_send_id![self, description] - } - pub unsafe fn descriptionInStringsFileFormat(&self) -> Id { - msg_send_id![self, descriptionInStringsFileFormat] - } - pub unsafe fn descriptionWithLocale( - &self, - locale: Option<&Object>, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale] - } + ) -> Id, Shared>; + #[method_id(allValues)] + pub unsafe fn allValues(&self) -> Id, Shared>; + #[method_id(description)] + pub unsafe fn description(&self) -> Id; + #[method_id(descriptionInStringsFileFormat)] + pub unsafe fn descriptionInStringsFileFormat(&self) -> Id; + # [method_id (descriptionWithLocale :)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + # [method_id (descriptionWithLocale : indent :)] pub unsafe fn descriptionWithLocale_indent( &self, locale: Option<&Object>, level: NSUInteger, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale, indent: level] - } + ) -> Id; + # [method (isEqualToDictionary :)] pub unsafe fn isEqualToDictionary( &self, otherDictionary: &NSDictionary, - ) -> bool { - msg_send![self, isEqualToDictionary: otherDictionary] - } - pub unsafe fn objectEnumerator(&self) -> Id, Shared> { - msg_send_id![self, objectEnumerator] - } + ) -> bool; + #[method_id(objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + # [method_id (objectsForKeys : notFoundMarker :)] pub unsafe fn objectsForKeys_notFoundMarker( &self, keys: &NSArray, marker: &ObjectType, - ) -> Id, Shared> { - msg_send_id![self, objectsForKeys: keys, notFoundMarker: marker] - } - pub unsafe fn writeToURL_error(&self, url: &NSURL) -> Result<(), Id> { - msg_send![self, writeToURL: url, error: _] - } + ) -> Id, Shared>; + # [method (writeToURL : error :)] + pub unsafe fn writeToURL_error(&self, url: &NSURL) -> Result<(), Id>; + # [method_id (keysSortedByValueUsingSelector :)] pub unsafe fn keysSortedByValueUsingSelector( &self, comparator: Sel, - ) -> Id, Shared> { - msg_send_id![self, keysSortedByValueUsingSelector: comparator] - } + ) -> Id, Shared>; + # [method (getObjects : andKeys : count :)] pub unsafe fn getObjects_andKeys_count( &self, objects: TodoArray, keys: TodoArray, count: NSUInteger, - ) { - msg_send![self, getObjects: objects, andKeys: keys, count: count] - } + ); + # [method_id (objectForKeyedSubscript :)] pub unsafe fn objectForKeyedSubscript( &self, key: &KeyType, - ) -> Option> { - msg_send_id![self, objectForKeyedSubscript: key] - } - pub unsafe fn enumerateKeysAndObjectsUsingBlock(&self, block: TodoBlock) { - msg_send![self, enumerateKeysAndObjectsUsingBlock: block] - } + ) -> Option>; + # [method (enumerateKeysAndObjectsUsingBlock :)] + pub unsafe fn enumerateKeysAndObjectsUsingBlock(&self, block: TodoBlock); + # [method (enumerateKeysAndObjectsWithOptions : usingBlock :)] pub unsafe fn enumerateKeysAndObjectsWithOptions_usingBlock( &self, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateKeysAndObjectsWithOptions: opts, - usingBlock: block - ] - } + ); + # [method_id (keysSortedByValueUsingComparator :)] pub unsafe fn keysSortedByValueUsingComparator( &self, cmptr: NSComparator, - ) -> Id, Shared> { - msg_send_id![self, keysSortedByValueUsingComparator: cmptr] - } + ) -> Id, Shared>; + # [method_id (keysSortedByValueWithOptions : usingComparator :)] pub unsafe fn keysSortedByValueWithOptions_usingComparator( &self, opts: NSSortOptions, cmptr: NSComparator, - ) -> Id, Shared> { - msg_send_id![ - self, - keysSortedByValueWithOptions: opts, - usingComparator: cmptr - ] - } + ) -> Id, Shared>; + # [method_id (keysOfEntriesPassingTest :)] pub unsafe fn keysOfEntriesPassingTest( &self, predicate: TodoBlock, - ) -> Id, Shared> { - msg_send_id![self, keysOfEntriesPassingTest: predicate] - } + ) -> Id, Shared>; + # [method_id (keysOfEntriesWithOptions : passingTest :)] pub unsafe fn keysOfEntriesWithOptions_passingTest( &self, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> Id, Shared> { - msg_send_id![self, keysOfEntriesWithOptions: opts, passingTest: predicate] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSDictionary { - pub unsafe fn getObjects_andKeys(&self, objects: TodoArray, keys: TodoArray) { - msg_send![self, getObjects: objects, andKeys: keys] - } + # [method (getObjects : andKeys :)] + pub unsafe fn getObjects_andKeys(&self, objects: TodoArray, keys: TodoArray); + # [method_id (dictionaryWithContentsOfFile :)] pub unsafe fn dictionaryWithContentsOfFile( path: &NSString, - ) -> Option, Shared>> { - msg_send_id![Self::class(), dictionaryWithContentsOfFile: path] - } + ) -> Option, Shared>>; + # [method_id (dictionaryWithContentsOfURL :)] pub unsafe fn dictionaryWithContentsOfURL( url: &NSURL, - ) -> Option, Shared>> { - msg_send_id![Self::class(), dictionaryWithContentsOfURL: url] - } + ) -> Option, Shared>>; + # [method_id (initWithContentsOfFile :)] pub unsafe fn initWithContentsOfFile( &self, path: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, initWithContentsOfFile: path] - } + ) -> Option, Shared>>; + # [method_id (initWithContentsOfURL :)] pub unsafe fn initWithContentsOfURL( &self, url: &NSURL, - ) -> Option, Shared>> { - msg_send_id![self, initWithContentsOfURL: url] - } + ) -> Option, Shared>>; + # [method (writeToFile : atomically :)] pub unsafe fn writeToFile_atomically( &self, path: &NSString, useAuxiliaryFile: bool, - ) -> bool { - msg_send![self, writeToFile: path, atomically: useAuxiliaryFile] - } - pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool { - msg_send![self, writeToURL: url, atomically: atomically] - } + ) -> bool; + # [method (writeToURL : atomically :)] + pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool; } ); extern_methods!( #[doc = "NSDictionaryCreation"] unsafe impl NSDictionary { - pub unsafe fn dictionary() -> Id { - msg_send_id![Self::class(), dictionary] - } + #[method_id(dictionary)] + pub unsafe fn dictionary() -> Id; + # [method_id (dictionaryWithObject : forKey :)] pub unsafe fn dictionaryWithObject_forKey( object: &ObjectType, key: &NSCopying, - ) -> Id { - msg_send_id![Self::class(), dictionaryWithObject: object, forKey: key] - } + ) -> Id; + # [method_id (dictionaryWithObjects : forKeys : count :)] pub unsafe fn dictionaryWithObjects_forKeys_count( objects: TodoArray, keys: TodoArray, cnt: NSUInteger, - ) -> Id { - msg_send_id![ - Self::class(), - dictionaryWithObjects: objects, - forKeys: keys, - count: cnt - ] - } + ) -> Id; + # [method_id (dictionaryWithDictionary :)] pub unsafe fn dictionaryWithDictionary( dict: &NSDictionary, - ) -> Id { - msg_send_id![Self::class(), dictionaryWithDictionary: dict] - } + ) -> Id; + # [method_id (dictionaryWithObjects : forKeys :)] pub unsafe fn dictionaryWithObjects_forKeys( objects: &NSArray, keys: &NSArray, - ) -> Id { - msg_send_id![Self::class(), dictionaryWithObjects: objects, forKeys: keys] - } + ) -> Id; + # [method_id (initWithDictionary :)] pub unsafe fn initWithDictionary( &self, otherDictionary: &NSDictionary, - ) -> Id { - msg_send_id![self, initWithDictionary: otherDictionary] - } + ) -> Id; + # [method_id (initWithDictionary : copyItems :)] pub unsafe fn initWithDictionary_copyItems( &self, otherDictionary: &NSDictionary, flag: bool, - ) -> Id { - msg_send_id![self, initWithDictionary: otherDictionary, copyItems: flag] - } + ) -> Id; + # [method_id (initWithObjects : forKeys :)] pub unsafe fn initWithObjects_forKeys( &self, objects: &NSArray, keys: &NSArray, - ) -> Id { - msg_send_id![self, initWithObjects: objects, forKeys: keys] - } + ) -> Id; + # [method_id (initWithContentsOfURL : error :)] pub unsafe fn initWithContentsOfURL_error( &self, url: &NSURL, - ) -> Result, Shared>, Id> { - msg_send_id![self, initWithContentsOfURL: url, error: _] - } + ) -> Result, Shared>, Id>; + # [method_id (dictionaryWithContentsOfURL : error :)] pub unsafe fn dictionaryWithContentsOfURL_error( url: &NSURL, - ) -> Result, Shared>, Id> { - msg_send_id![Self::class(), dictionaryWithContentsOfURL: url, error: _] - } + ) -> Result, Shared>, Id>; } ); __inner_extern_class!( @@ -280,113 +222,86 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSMutableDictionary { - pub unsafe fn removeObjectForKey(&self, aKey: &KeyType) { - msg_send![self, removeObjectForKey: aKey] - } - pub unsafe fn setObject_forKey(&self, anObject: &ObjectType, aKey: &NSCopying) { - msg_send![self, setObject: anObject, forKey: aKey] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithCapacity(&self, numItems: NSUInteger) -> Id { - msg_send_id![self, initWithCapacity: numItems] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + # [method (removeObjectForKey :)] + pub unsafe fn removeObjectForKey(&self, aKey: &KeyType); + # [method (setObject : forKey :)] + pub unsafe fn setObject_forKey(&self, anObject: &ObjectType, aKey: &NSCopying); + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithCapacity :)] + pub unsafe fn initWithCapacity(&self, numItems: NSUInteger) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSExtendedMutableDictionary"] unsafe impl NSMutableDictionary { + # [method (addEntriesFromDictionary :)] pub unsafe fn addEntriesFromDictionary( &self, otherDictionary: &NSDictionary, - ) { - msg_send![self, addEntriesFromDictionary: otherDictionary] - } - pub unsafe fn removeAllObjects(&self) { - msg_send![self, removeAllObjects] - } - pub unsafe fn removeObjectsForKeys(&self, keyArray: &NSArray) { - msg_send![self, removeObjectsForKeys: keyArray] - } - pub unsafe fn setDictionary(&self, otherDictionary: &NSDictionary) { - msg_send![self, setDictionary: otherDictionary] - } - pub unsafe fn setObject_forKeyedSubscript( - &self, - obj: Option<&ObjectType>, - key: &NSCopying, - ) { - msg_send![self, setObject: obj, forKeyedSubscript: key] - } + ); + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + # [method (removeObjectsForKeys :)] + pub unsafe fn removeObjectsForKeys(&self, keyArray: &NSArray); + # [method (setDictionary :)] + pub unsafe fn setDictionary(&self, otherDictionary: &NSDictionary); + # [method (setObject : forKeyedSubscript :)] + pub unsafe fn setObject_forKeyedSubscript(&self, obj: Option<&ObjectType>, key: &NSCopying); } ); extern_methods!( #[doc = "NSMutableDictionaryCreation"] unsafe impl NSMutableDictionary { - pub unsafe fn dictionaryWithCapacity(numItems: NSUInteger) -> Id { - msg_send_id![Self::class(), dictionaryWithCapacity: numItems] - } + # [method_id (dictionaryWithCapacity :)] + pub unsafe fn dictionaryWithCapacity(numItems: NSUInteger) -> Id; + # [method_id (dictionaryWithContentsOfFile :)] pub unsafe fn dictionaryWithContentsOfFile( path: &NSString, - ) -> Option, Shared>> { - msg_send_id![Self::class(), dictionaryWithContentsOfFile: path] - } + ) -> Option, Shared>>; + # [method_id (dictionaryWithContentsOfURL :)] pub unsafe fn dictionaryWithContentsOfURL( url: &NSURL, - ) -> Option, Shared>> { - msg_send_id![Self::class(), dictionaryWithContentsOfURL: url] - } + ) -> Option, Shared>>; + # [method_id (initWithContentsOfFile :)] pub unsafe fn initWithContentsOfFile( &self, path: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, initWithContentsOfFile: path] - } + ) -> Option, Shared>>; + # [method_id (initWithContentsOfURL :)] pub unsafe fn initWithContentsOfURL( &self, url: &NSURL, - ) -> Option, Shared>> { - msg_send_id![self, initWithContentsOfURL: url] - } + ) -> Option, Shared>>; } ); extern_methods!( #[doc = "NSSharedKeySetDictionary"] unsafe impl NSDictionary { - pub unsafe fn sharedKeySetForKeys(keys: &NSArray) -> Id { - msg_send_id![Self::class(), sharedKeySetForKeys: keys] - } + # [method_id (sharedKeySetForKeys :)] + pub unsafe fn sharedKeySetForKeys(keys: &NSArray) -> Id; } ); extern_methods!( #[doc = "NSSharedKeySetDictionary"] unsafe impl NSMutableDictionary { + # [method_id (dictionaryWithSharedKeySet :)] pub unsafe fn dictionaryWithSharedKeySet( keyset: &Object, - ) -> Id, Shared> { - msg_send_id![Self::class(), dictionaryWithSharedKeySet: keyset] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSGenericFastEnumeraiton"] unsafe impl NSDictionary { + # [method (countByEnumeratingWithState : objects : count :)] pub unsafe fn countByEnumeratingWithState_objects_count( &self, state: NonNull, buffer: TodoArray, len: NSUInteger, - ) -> NSUInteger { - msg_send![ - self, - countByEnumeratingWithState: state, - objects: buffer, - count: len - ] - } + ) -> NSUInteger; } ); diff --git a/icrate/src/Foundation/generated/NSDistantObject.rs b/icrate/src/Foundation/generated/NSDistantObject.rs index 06d141997..7a09c83ed 100644 --- a/icrate/src/Foundation/generated/NSDistantObject.rs +++ b/icrate/src/Foundation/generated/NSDistantObject.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSProxy::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSDistantObject; @@ -15,48 +15,33 @@ extern_class!( ); extern_methods!( unsafe impl NSDistantObject { + # [method_id (proxyWithTarget : connection :)] pub unsafe fn proxyWithTarget_connection( target: &Object, connection: &NSConnection, - ) -> Option> { - msg_send_id![ - Self::class(), - proxyWithTarget: target, - connection: connection - ] - } + ) -> Option>; + # [method_id (initWithTarget : connection :)] pub unsafe fn initWithTarget_connection( &self, target: &Object, connection: &NSConnection, - ) -> Option> { - msg_send_id![self, initWithTarget: target, connection: connection] - } + ) -> Option>; + # [method_id (proxyWithLocal : connection :)] pub unsafe fn proxyWithLocal_connection( target: &Object, connection: &NSConnection, - ) -> Id { - msg_send_id![ - Self::class(), - proxyWithLocal: target, - connection: connection - ] - } + ) -> Id; + # [method_id (initWithLocal : connection :)] pub unsafe fn initWithLocal_connection( &self, target: &Object, connection: &NSConnection, - ) -> Id { - msg_send_id![self, initWithLocal: target, connection: connection] - } - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } - pub unsafe fn setProtocolForProxy(&self, proto: Option<&Protocol>) { - msg_send![self, setProtocolForProxy: proto] - } - pub unsafe fn connectionForProxy(&self) -> Id { - msg_send_id![self, connectionForProxy] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + # [method (setProtocolForProxy :)] + pub unsafe fn setProtocolForProxy(&self, proto: Option<&Protocol>); + #[method_id(connectionForProxy)] + pub unsafe fn connectionForProxy(&self) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSDistributedLock.rs b/icrate/src/Foundation/generated/NSDistributedLock.rs index 071354ac1..113e1d9eb 100644 --- a/icrate/src/Foundation/generated/NSDistributedLock.rs +++ b/icrate/src/Foundation/generated/NSDistributedLock.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSDistributedLock; @@ -13,26 +13,19 @@ extern_class!( ); extern_methods!( unsafe impl NSDistributedLock { - pub unsafe fn lockWithPath(path: &NSString) -> Option> { - msg_send_id![Self::class(), lockWithPath: path] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithPath(&self, path: &NSString) -> Option> { - msg_send_id![self, initWithPath: path] - } - pub unsafe fn tryLock(&self) -> bool { - msg_send![self, tryLock] - } - pub unsafe fn unlock(&self) { - msg_send![self, unlock] - } - pub unsafe fn breakLock(&self) { - msg_send![self, breakLock] - } - pub unsafe fn lockDate(&self) -> Id { - msg_send_id![self, lockDate] - } + # [method_id (lockWithPath :)] + pub unsafe fn lockWithPath(path: &NSString) -> Option>; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithPath :)] + pub unsafe fn initWithPath(&self, path: &NSString) -> Option>; + #[method(tryLock)] + pub unsafe fn tryLock(&self) -> bool; + #[method(unlock)] + pub unsafe fn unlock(&self); + #[method(breakLock)] + pub unsafe fn breakLock(&self); + #[method_id(lockDate)] + pub unsafe fn lockDate(&self) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSDistributedNotificationCenter.rs b/icrate/src/Foundation/generated/NSDistributedNotificationCenter.rs index e4037c029..dec5c50b4 100644 --- a/icrate/src/Foundation/generated/NSDistributedNotificationCenter.rs +++ b/icrate/src/Foundation/generated/NSDistributedNotificationCenter.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSNotification::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSDistributedNotificationCenterType = NSString; extern_class!( #[derive(Debug)] @@ -15,17 +15,13 @@ extern_class!( ); extern_methods!( unsafe impl NSDistributedNotificationCenter { + # [method_id (notificationCenterForType :)] pub unsafe fn notificationCenterForType( notificationCenterType: &NSDistributedNotificationCenterType, - ) -> Id { - msg_send_id![ - Self::class(), - notificationCenterForType: notificationCenterType - ] - } - pub unsafe fn defaultCenter() -> Id { - msg_send_id![Self::class(), defaultCenter] - } + ) -> Id; + #[method_id(defaultCenter)] + pub unsafe fn defaultCenter() -> Id; + # [method (addObserver : selector : name : object : suspensionBehavior :)] pub unsafe fn addObserver_selector_name_object_suspensionBehavior( &self, observer: &Object, @@ -33,99 +29,54 @@ extern_methods!( name: Option<&NSNotificationName>, object: Option<&NSString>, suspensionBehavior: NSNotificationSuspensionBehavior, - ) { - msg_send![ - self, - addObserver: observer, - selector: selector, - name: name, - object: object, - suspensionBehavior: suspensionBehavior - ] - } + ); + # [method (postNotificationName : object : userInfo : deliverImmediately :)] pub unsafe fn postNotificationName_object_userInfo_deliverImmediately( &self, name: &NSNotificationName, object: Option<&NSString>, userInfo: Option<&NSDictionary>, deliverImmediately: bool, - ) { - msg_send![ - self, - postNotificationName: name, - object: object, - userInfo: userInfo, - deliverImmediately: deliverImmediately - ] - } + ); + # [method (postNotificationName : object : userInfo : options :)] pub unsafe fn postNotificationName_object_userInfo_options( &self, name: &NSNotificationName, object: Option<&NSString>, userInfo: Option<&NSDictionary>, options: NSDistributedNotificationOptions, - ) { - msg_send![ - self, - postNotificationName: name, - object: object, - userInfo: userInfo, - options: options - ] - } - pub unsafe fn suspended(&self) -> bool { - msg_send![self, suspended] - } - pub unsafe fn setSuspended(&self, suspended: bool) { - msg_send![self, setSuspended: suspended] - } + ); + #[method(suspended)] + pub unsafe fn suspended(&self) -> bool; + # [method (setSuspended :)] + pub unsafe fn setSuspended(&self, suspended: bool); + # [method (addObserver : selector : name : object :)] pub unsafe fn addObserver_selector_name_object( &self, observer: &Object, aSelector: Sel, aName: Option<&NSNotificationName>, anObject: Option<&NSString>, - ) { - msg_send![ - self, - addObserver: observer, - selector: aSelector, - name: aName, - object: anObject - ] - } + ); + # [method (postNotificationName : object :)] pub unsafe fn postNotificationName_object( &self, aName: &NSNotificationName, anObject: Option<&NSString>, - ) { - msg_send![self, postNotificationName: aName, object: anObject] - } + ); + # [method (postNotificationName : object : userInfo :)] pub unsafe fn postNotificationName_object_userInfo( &self, aName: &NSNotificationName, anObject: Option<&NSString>, aUserInfo: Option<&NSDictionary>, - ) { - msg_send![ - self, - postNotificationName: aName, - object: anObject, - userInfo: aUserInfo - ] - } + ); + # [method (removeObserver : name : object :)] pub unsafe fn removeObserver_name_object( &self, observer: &Object, aName: Option<&NSNotificationName>, anObject: Option<&NSString>, - ) { - msg_send![ - self, - removeObserver: observer, - name: aName, - object: anObject - ] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSEnergyFormatter.rs b/icrate/src/Foundation/generated/NSEnergyFormatter.rs index 812933d0e..91c865e3d 100644 --- a/icrate/src/Foundation/generated/NSEnergyFormatter.rs +++ b/icrate/src/Foundation/generated/NSEnergyFormatter.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::Foundation::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSEnergyFormatter; @@ -12,60 +12,44 @@ extern_class!( ); extern_methods!( unsafe impl NSEnergyFormatter { - pub unsafe fn numberFormatter(&self) -> Id { - msg_send_id![self, numberFormatter] - } - pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>) { - msg_send![self, setNumberFormatter: numberFormatter] - } - pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle { - msg_send![self, unitStyle] - } - pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle) { - msg_send![self, setUnitStyle: unitStyle] - } - pub unsafe fn isForFoodEnergyUse(&self) -> bool { - msg_send![self, isForFoodEnergyUse] - } - pub unsafe fn setForFoodEnergyUse(&self, forFoodEnergyUse: bool) { - msg_send![self, setForFoodEnergyUse: forFoodEnergyUse] - } + #[method_id(numberFormatter)] + pub unsafe fn numberFormatter(&self) -> Id; + # [method (setNumberFormatter :)] + pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>); + #[method(unitStyle)] + pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle; + # [method (setUnitStyle :)] + pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle); + #[method(isForFoodEnergyUse)] + pub unsafe fn isForFoodEnergyUse(&self) -> bool; + # [method (setForFoodEnergyUse :)] + pub unsafe fn setForFoodEnergyUse(&self, forFoodEnergyUse: bool); + # [method_id (stringFromValue : unit :)] pub unsafe fn stringFromValue_unit( &self, value: c_double, unit: NSEnergyFormatterUnit, - ) -> Id { - msg_send_id![self, stringFromValue: value, unit: unit] - } - pub unsafe fn stringFromJoules(&self, numberInJoules: c_double) -> Id { - msg_send_id![self, stringFromJoules: numberInJoules] - } + ) -> Id; + # [method_id (stringFromJoules :)] + pub unsafe fn stringFromJoules(&self, numberInJoules: c_double) -> Id; + # [method_id (unitStringFromValue : unit :)] pub unsafe fn unitStringFromValue_unit( &self, value: c_double, unit: NSEnergyFormatterUnit, - ) -> Id { - msg_send_id![self, unitStringFromValue: value, unit: unit] - } + ) -> Id; + # [method_id (unitStringFromJoules : usedUnit :)] pub unsafe fn unitStringFromJoules_usedUnit( &self, numberInJoules: c_double, unitp: *mut NSEnergyFormatterUnit, - ) -> Id { - msg_send_id![self, unitStringFromJoules: numberInJoules, usedUnit: unitp] - } + ) -> Id; + # [method (getObjectValue : forString : errorDescription :)] pub unsafe fn getObjectValue_forString_errorDescription( &self, obj: Option<&mut Option>>, string: &NSString, error: Option<&mut Option>>, - ) -> bool { - msg_send![ - self, - getObjectValue: obj, - forString: string, - errorDescription: error - ] - } + ) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSEnumerator.rs b/icrate/src/Foundation/generated/NSEnumerator.rs index 44d9be9c8..3bfee3523 100644 --- a/icrate/src/Foundation/generated/NSEnumerator.rs +++ b/icrate/src/Foundation/generated/NSEnumerator.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSFastEnumeration = NSObject; __inner_extern_class!( #[derive(Debug)] @@ -14,16 +14,14 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSEnumerator { - pub unsafe fn nextObject(&self) -> Option> { - msg_send_id![self, nextObject] - } + #[method_id(nextObject)] + pub unsafe fn nextObject(&self) -> Option>; } ); extern_methods!( #[doc = "NSExtendedEnumerator"] unsafe impl NSEnumerator { - pub unsafe fn allObjects(&self) -> Id, Shared> { - msg_send_id![self, allObjects] - } + #[method_id(allObjects)] + pub unsafe fn allObjects(&self) -> Id, Shared>; } ); diff --git a/icrate/src/Foundation/generated/NSError.rs b/icrate/src/Foundation/generated/NSError.rs index d64e1b386..151e3b049 100644 --- a/icrate/src/Foundation/generated/NSError.rs +++ b/icrate/src/Foundation/generated/NSError.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSErrorDomain = NSString; pub type NSErrorUserInfoKey = NSString; extern_class!( @@ -17,74 +17,52 @@ extern_class!( ); extern_methods!( unsafe impl NSError { + # [method_id (initWithDomain : code : userInfo :)] pub unsafe fn initWithDomain_code_userInfo( &self, domain: &NSErrorDomain, code: NSInteger, dict: Option<&NSDictionary>, - ) -> Id { - msg_send_id![self, initWithDomain: domain, code: code, userInfo: dict] - } + ) -> Id; + # [method_id (errorWithDomain : code : userInfo :)] pub unsafe fn errorWithDomain_code_userInfo( domain: &NSErrorDomain, code: NSInteger, dict: Option<&NSDictionary>, - ) -> Id { - msg_send_id![ - Self::class(), - errorWithDomain: domain, - code: code, - userInfo: dict - ] - } - pub unsafe fn domain(&self) -> Id { - msg_send_id![self, domain] - } - pub unsafe fn code(&self) -> NSInteger { - msg_send![self, code] - } - pub unsafe fn userInfo(&self) -> Id, Shared> { - msg_send_id![self, userInfo] - } - pub unsafe fn localizedDescription(&self) -> Id { - msg_send_id![self, localizedDescription] - } - pub unsafe fn localizedFailureReason(&self) -> Option> { - msg_send_id![self, localizedFailureReason] - } - pub unsafe fn localizedRecoverySuggestion(&self) -> Option> { - msg_send_id![self, localizedRecoverySuggestion] - } - pub unsafe fn localizedRecoveryOptions(&self) -> Option, Shared>> { - msg_send_id![self, localizedRecoveryOptions] - } - pub unsafe fn recoveryAttempter(&self) -> Option> { - msg_send_id![self, recoveryAttempter] - } - pub unsafe fn helpAnchor(&self) -> Option> { - msg_send_id![self, helpAnchor] - } - pub unsafe fn underlyingErrors(&self) -> Id, Shared> { - msg_send_id![self, underlyingErrors] - } + ) -> Id; + #[method_id(domain)] + pub unsafe fn domain(&self) -> Id; + #[method(code)] + pub unsafe fn code(&self) -> NSInteger; + #[method_id(userInfo)] + pub unsafe fn userInfo(&self) -> Id, Shared>; + #[method_id(localizedDescription)] + pub unsafe fn localizedDescription(&self) -> Id; + #[method_id(localizedFailureReason)] + pub unsafe fn localizedFailureReason(&self) -> Option>; + #[method_id(localizedRecoverySuggestion)] + pub unsafe fn localizedRecoverySuggestion(&self) -> Option>; + #[method_id(localizedRecoveryOptions)] + pub unsafe fn localizedRecoveryOptions(&self) -> Option, Shared>>; + #[method_id(recoveryAttempter)] + pub unsafe fn recoveryAttempter(&self) -> Option>; + #[method_id(helpAnchor)] + pub unsafe fn helpAnchor(&self) -> Option>; + #[method_id(underlyingErrors)] + pub unsafe fn underlyingErrors(&self) -> Id, Shared>; + # [method (setUserInfoValueProviderForDomain : provider :)] pub unsafe fn setUserInfoValueProviderForDomain_provider( errorDomain: &NSErrorDomain, provider: TodoBlock, - ) { - msg_send![ - Self::class(), - setUserInfoValueProviderForDomain: errorDomain, - provider: provider - ] - } - pub unsafe fn userInfoValueProviderForDomain(errorDomain: &NSErrorDomain) -> TodoBlock { - msg_send![Self::class(), userInfoValueProviderForDomain: errorDomain] - } + ); + # [method (userInfoValueProviderForDomain :)] + pub unsafe fn userInfoValueProviderForDomain(errorDomain: &NSErrorDomain) -> TodoBlock; } ); extern_methods!( #[doc = "NSErrorRecoveryAttempting"] unsafe impl NSObject { + # [method (attemptRecoveryFromError : optionIndex : delegate : didRecoverSelector : contextInfo :)] pub unsafe fn attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo( &self, error: &NSError, @@ -92,26 +70,12 @@ extern_methods!( delegate: Option<&Object>, didRecoverSelector: Option, contextInfo: *mut c_void, - ) { - msg_send![ - self, - attemptRecoveryFromError: error, - optionIndex: recoveryOptionIndex, - delegate: delegate, - didRecoverSelector: didRecoverSelector, - contextInfo: contextInfo - ] - } + ); + # [method (attemptRecoveryFromError : optionIndex :)] pub unsafe fn attemptRecoveryFromError_optionIndex( &self, error: &NSError, recoveryOptionIndex: NSUInteger, - ) -> bool { - msg_send![ - self, - attemptRecoveryFromError: error, - optionIndex: recoveryOptionIndex - ] - } + ) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSException.rs b/icrate/src/Foundation/generated/NSException.rs index 3d9dca65c..6deb87c7f 100644 --- a/icrate/src/Foundation/generated/NSException.rs +++ b/icrate/src/Foundation/generated/NSException.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSString::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSException; @@ -17,66 +17,42 @@ extern_class!( ); extern_methods!( unsafe impl NSException { + # [method_id (exceptionWithName : reason : userInfo :)] pub unsafe fn exceptionWithName_reason_userInfo( name: &NSExceptionName, reason: Option<&NSString>, userInfo: Option<&NSDictionary>, - ) -> Id { - msg_send_id![ - Self::class(), - exceptionWithName: name, - reason: reason, - userInfo: userInfo - ] - } + ) -> Id; + # [method_id (initWithName : reason : userInfo :)] pub unsafe fn initWithName_reason_userInfo( &self, aName: &NSExceptionName, aReason: Option<&NSString>, aUserInfo: Option<&NSDictionary>, - ) -> Id { - msg_send_id![ - self, - initWithName: aName, - reason: aReason, - userInfo: aUserInfo - ] - } - pub unsafe fn name(&self) -> Id { - msg_send_id![self, name] - } - pub unsafe fn reason(&self) -> Option> { - msg_send_id![self, reason] - } - pub unsafe fn userInfo(&self) -> Option> { - msg_send_id![self, userInfo] - } - pub unsafe fn callStackReturnAddresses(&self) -> Id, Shared> { - msg_send_id![self, callStackReturnAddresses] - } - pub unsafe fn callStackSymbols(&self) -> Id, Shared> { - msg_send_id![self, callStackSymbols] - } - pub unsafe fn raise(&self) { - msg_send![self, raise] - } + ) -> Id; + #[method_id(name)] + pub unsafe fn name(&self) -> Id; + #[method_id(reason)] + pub unsafe fn reason(&self) -> Option>; + #[method_id(userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + #[method_id(callStackReturnAddresses)] + pub unsafe fn callStackReturnAddresses(&self) -> Id, Shared>; + #[method_id(callStackSymbols)] + pub unsafe fn callStackSymbols(&self) -> Id, Shared>; + #[method(raise)] + pub unsafe fn raise(&self); } ); extern_methods!( #[doc = "NSExceptionRaisingConveniences"] unsafe impl NSException { + # [method (raise : format : arguments :)] pub unsafe fn raise_format_arguments( name: &NSExceptionName, format: &NSString, argList: va_list, - ) { - msg_send![ - Self::class(), - raise: name, - format: format, - arguments: argList - ] - } + ); } ); extern_class!( @@ -88,8 +64,7 @@ extern_class!( ); extern_methods!( unsafe impl NSAssertionHandler { - pub unsafe fn currentHandler() -> Id { - msg_send_id![Self::class(), currentHandler] - } + #[method_id(currentHandler)] + pub unsafe fn currentHandler() -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSExpression.rs b/icrate/src/Foundation/generated/NSExpression.rs index 6522ab851..c69e2f257 100644 --- a/icrate/src/Foundation/generated/NSExpression.rs +++ b/icrate/src/Foundation/generated/NSExpression.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSExpression; @@ -16,177 +16,112 @@ extern_class!( ); extern_methods!( unsafe impl NSExpression { + # [method_id (expressionWithFormat : argumentArray :)] pub unsafe fn expressionWithFormat_argumentArray( expressionFormat: &NSString, arguments: &NSArray, - ) -> Id { - msg_send_id![ - Self::class(), - expressionWithFormat: expressionFormat, - argumentArray: arguments - ] - } + ) -> Id; + # [method_id (expressionWithFormat : arguments :)] pub unsafe fn expressionWithFormat_arguments( expressionFormat: &NSString, argList: va_list, - ) -> Id { - msg_send_id![ - Self::class(), - expressionWithFormat: expressionFormat, - arguments: argList - ] - } - pub unsafe fn expressionForConstantValue(obj: Option<&Object>) -> Id { - msg_send_id![Self::class(), expressionForConstantValue: obj] - } - pub unsafe fn expressionForEvaluatedObject() -> Id { - msg_send_id![Self::class(), expressionForEvaluatedObject] - } - pub unsafe fn expressionForVariable(string: &NSString) -> Id { - msg_send_id![Self::class(), expressionForVariable: string] - } - pub unsafe fn expressionForKeyPath(keyPath: &NSString) -> Id { - msg_send_id![Self::class(), expressionForKeyPath: keyPath] - } + ) -> Id; + # [method_id (expressionForConstantValue :)] + pub unsafe fn expressionForConstantValue(obj: Option<&Object>) -> Id; + #[method_id(expressionForEvaluatedObject)] + pub unsafe fn expressionForEvaluatedObject() -> Id; + # [method_id (expressionForVariable :)] + pub unsafe fn expressionForVariable(string: &NSString) -> Id; + # [method_id (expressionForKeyPath :)] + pub unsafe fn expressionForKeyPath(keyPath: &NSString) -> Id; + # [method_id (expressionForFunction : arguments :)] pub unsafe fn expressionForFunction_arguments( name: &NSString, parameters: &NSArray, - ) -> Id { - msg_send_id![ - Self::class(), - expressionForFunction: name, - arguments: parameters - ] - } + ) -> Id; + # [method_id (expressionForAggregate :)] pub unsafe fn expressionForAggregate( subexpressions: &NSArray, - ) -> Id { - msg_send_id![Self::class(), expressionForAggregate: subexpressions] - } + ) -> Id; + # [method_id (expressionForUnionSet : with :)] pub unsafe fn expressionForUnionSet_with( left: &NSExpression, right: &NSExpression, - ) -> Id { - msg_send_id![Self::class(), expressionForUnionSet: left, with: right] - } + ) -> Id; + # [method_id (expressionForIntersectSet : with :)] pub unsafe fn expressionForIntersectSet_with( left: &NSExpression, right: &NSExpression, - ) -> Id { - msg_send_id![Self::class(), expressionForIntersectSet: left, with: right] - } + ) -> Id; + # [method_id (expressionForMinusSet : with :)] pub unsafe fn expressionForMinusSet_with( left: &NSExpression, right: &NSExpression, - ) -> Id { - msg_send_id![Self::class(), expressionForMinusSet: left, with: right] - } + ) -> Id; + # [method_id (expressionForSubquery : usingIteratorVariable : predicate :)] pub unsafe fn expressionForSubquery_usingIteratorVariable_predicate( expression: &NSExpression, variable: &NSString, predicate: &NSPredicate, - ) -> Id { - msg_send_id![ - Self::class(), - expressionForSubquery: expression, - usingIteratorVariable: variable, - predicate: predicate - ] - } + ) -> Id; + # [method_id (expressionForFunction : selectorName : arguments :)] pub unsafe fn expressionForFunction_selectorName_arguments( target: &NSExpression, name: &NSString, parameters: Option<&NSArray>, - ) -> Id { - msg_send_id![ - Self::class(), - expressionForFunction: target, - selectorName: name, - arguments: parameters - ] - } - pub unsafe fn expressionForAnyKey() -> Id { - msg_send_id![Self::class(), expressionForAnyKey] - } + ) -> Id; + #[method_id(expressionForAnyKey)] + pub unsafe fn expressionForAnyKey() -> Id; + # [method_id (expressionForBlock : arguments :)] pub unsafe fn expressionForBlock_arguments( block: TodoBlock, arguments: Option<&NSArray>, - ) -> Id { - msg_send_id![ - Self::class(), - expressionForBlock: block, - arguments: arguments - ] - } + ) -> Id; + # [method_id (expressionForConditional : trueExpression : falseExpression :)] pub unsafe fn expressionForConditional_trueExpression_falseExpression( predicate: &NSPredicate, trueExpression: &NSExpression, falseExpression: &NSExpression, - ) -> Id { - msg_send_id![ - Self::class(), - expressionForConditional: predicate, - trueExpression: trueExpression, - falseExpression: falseExpression - ] - } - pub unsafe fn initWithExpressionType(&self, type_: NSExpressionType) -> Id { - msg_send_id![self, initWithExpressionType: type_] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } - pub unsafe fn expressionType(&self) -> NSExpressionType { - msg_send![self, expressionType] - } - pub unsafe fn constantValue(&self) -> Option> { - msg_send_id![self, constantValue] - } - pub unsafe fn keyPath(&self) -> Id { - msg_send_id![self, keyPath] - } - pub unsafe fn function(&self) -> Id { - msg_send_id![self, function] - } - pub unsafe fn variable(&self) -> Id { - msg_send_id![self, variable] - } - pub unsafe fn operand(&self) -> Id { - msg_send_id![self, operand] - } - pub unsafe fn arguments(&self) -> Option, Shared>> { - msg_send_id![self, arguments] - } - pub unsafe fn collection(&self) -> Id { - msg_send_id![self, collection] - } - pub unsafe fn predicate(&self) -> Id { - msg_send_id![self, predicate] - } - pub unsafe fn leftExpression(&self) -> Id { - msg_send_id![self, leftExpression] - } - pub unsafe fn rightExpression(&self) -> Id { - msg_send_id![self, rightExpression] - } - pub unsafe fn trueExpression(&self) -> Id { - msg_send_id![self, trueExpression] - } - pub unsafe fn falseExpression(&self) -> Id { - msg_send_id![self, falseExpression] - } - pub unsafe fn expressionBlock(&self) -> TodoBlock { - msg_send![self, expressionBlock] - } + ) -> Id; + # [method_id (initWithExpressionType :)] + pub unsafe fn initWithExpressionType(&self, type_: NSExpressionType) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; + #[method(expressionType)] + pub unsafe fn expressionType(&self) -> NSExpressionType; + #[method_id(constantValue)] + pub unsafe fn constantValue(&self) -> Option>; + #[method_id(keyPath)] + pub unsafe fn keyPath(&self) -> Id; + #[method_id(function)] + pub unsafe fn function(&self) -> Id; + #[method_id(variable)] + pub unsafe fn variable(&self) -> Id; + #[method_id(operand)] + pub unsafe fn operand(&self) -> Id; + #[method_id(arguments)] + pub unsafe fn arguments(&self) -> Option, Shared>>; + #[method_id(collection)] + pub unsafe fn collection(&self) -> Id; + #[method_id(predicate)] + pub unsafe fn predicate(&self) -> Id; + #[method_id(leftExpression)] + pub unsafe fn leftExpression(&self) -> Id; + #[method_id(rightExpression)] + pub unsafe fn rightExpression(&self) -> Id; + #[method_id(trueExpression)] + pub unsafe fn trueExpression(&self) -> Id; + #[method_id(falseExpression)] + pub unsafe fn falseExpression(&self) -> Id; + #[method(expressionBlock)] + pub unsafe fn expressionBlock(&self) -> TodoBlock; + # [method_id (expressionValueWithObject : context :)] pub unsafe fn expressionValueWithObject_context( &self, object: Option<&Object>, context: Option<&NSMutableDictionary>, - ) -> Option> { - msg_send_id![self, expressionValueWithObject: object, context: context] - } - pub unsafe fn allowEvaluation(&self) { - msg_send![self, allowEvaluation] - } + ) -> Option>; + #[method(allowEvaluation)] + pub unsafe fn allowEvaluation(&self); } ); diff --git a/icrate/src/Foundation/generated/NSExtensionContext.rs b/icrate/src/Foundation/generated/NSExtensionContext.rs index 8ba02b6fc..e8c017410 100644 --- a/icrate/src/Foundation/generated/NSExtensionContext.rs +++ b/icrate/src/Foundation/generated/NSExtensionContext.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::Foundation::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSExtensionContext; @@ -12,25 +12,17 @@ extern_class!( ); extern_methods!( unsafe impl NSExtensionContext { - pub unsafe fn inputItems(&self) -> Id { - msg_send_id![self, inputItems] - } + #[method_id(inputItems)] + pub unsafe fn inputItems(&self) -> Id; + # [method (completeRequestReturningItems : completionHandler :)] pub unsafe fn completeRequestReturningItems_completionHandler( &self, items: Option<&NSArray>, completionHandler: TodoBlock, - ) { - msg_send![ - self, - completeRequestReturningItems: items, - completionHandler: completionHandler - ] - } - pub unsafe fn cancelRequestWithError(&self, error: &NSError) { - msg_send![self, cancelRequestWithError: error] - } - pub unsafe fn openURL_completionHandler(&self, URL: &NSURL, completionHandler: TodoBlock) { - msg_send![self, openURL: URL, completionHandler: completionHandler] - } + ); + # [method (cancelRequestWithError :)] + pub unsafe fn cancelRequestWithError(&self, error: &NSError); + # [method (openURL : completionHandler :)] + pub unsafe fn openURL_completionHandler(&self, URL: &NSURL, completionHandler: TodoBlock); } ); diff --git a/icrate/src/Foundation/generated/NSExtensionItem.rs b/icrate/src/Foundation/generated/NSExtensionItem.rs index 9b6e9ad21..f45fe5c9e 100644 --- a/icrate/src/Foundation/generated/NSExtensionItem.rs +++ b/icrate/src/Foundation/generated/NSExtensionItem.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSItemProvider::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSExtensionItem; @@ -13,32 +13,24 @@ extern_class!( ); extern_methods!( unsafe impl NSExtensionItem { - pub unsafe fn attributedTitle(&self) -> Option> { - msg_send_id![self, attributedTitle] - } - pub unsafe fn setAttributedTitle(&self, attributedTitle: Option<&NSAttributedString>) { - msg_send![self, setAttributedTitle: attributedTitle] - } - pub unsafe fn attributedContentText(&self) -> Option> { - msg_send_id![self, attributedContentText] - } + #[method_id(attributedTitle)] + pub unsafe fn attributedTitle(&self) -> Option>; + # [method (setAttributedTitle :)] + pub unsafe fn setAttributedTitle(&self, attributedTitle: Option<&NSAttributedString>); + #[method_id(attributedContentText)] + pub unsafe fn attributedContentText(&self) -> Option>; + # [method (setAttributedContentText :)] pub unsafe fn setAttributedContentText( &self, attributedContentText: Option<&NSAttributedString>, - ) { - msg_send![self, setAttributedContentText: attributedContentText] - } - pub unsafe fn attachments(&self) -> Option, Shared>> { - msg_send_id![self, attachments] - } - pub unsafe fn setAttachments(&self, attachments: Option<&NSArray>) { - msg_send![self, setAttachments: attachments] - } - pub unsafe fn userInfo(&self) -> Option> { - msg_send_id![self, userInfo] - } - pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>) { - msg_send![self, setUserInfo: userInfo] - } + ); + #[method_id(attachments)] + pub unsafe fn attachments(&self) -> Option, Shared>>; + # [method (setAttachments :)] + pub unsafe fn setAttachments(&self, attachments: Option<&NSArray>); + #[method_id(userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + # [method (setUserInfo :)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); } ); diff --git a/icrate/src/Foundation/generated/NSExtensionRequestHandling.rs b/icrate/src/Foundation/generated/NSExtensionRequestHandling.rs index 339014c66..cdad7804f 100644 --- a/icrate/src/Foundation/generated/NSExtensionRequestHandling.rs +++ b/icrate/src/Foundation/generated/NSExtensionRequestHandling.rs @@ -3,5 +3,5 @@ use crate::Foundation::generated::Foundation::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSExtensionRequestHandling = NSObject; diff --git a/icrate/src/Foundation/generated/NSFileCoordinator.rs b/icrate/src/Foundation/generated/NSFileCoordinator.rs index 28d845024..f2bd1bd27 100644 --- a/icrate/src/Foundation/generated/NSFileCoordinator.rs +++ b/icrate/src/Foundation/generated/NSFileCoordinator.rs @@ -9,7 +9,7 @@ use crate::Foundation::generated::NSURL::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSFileAccessIntent; @@ -19,21 +19,18 @@ extern_class!( ); extern_methods!( unsafe impl NSFileAccessIntent { + # [method_id (readingIntentWithURL : options :)] pub unsafe fn readingIntentWithURL_options( url: &NSURL, options: NSFileCoordinatorReadingOptions, - ) -> Id { - msg_send_id![Self::class(), readingIntentWithURL: url, options: options] - } + ) -> Id; + # [method_id (writingIntentWithURL : options :)] pub unsafe fn writingIntentWithURL_options( url: &NSURL, options: NSFileCoordinatorWritingOptions, - ) -> Id { - msg_send_id![Self::class(), writingIntentWithURL: url, options: options] - } - pub unsafe fn URL(&self) -> Id { - msg_send_id![self, URL] - } + ) -> Id; + #[method_id(URL)] + pub unsafe fn URL(&self) -> Id; } ); extern_class!( @@ -45,70 +42,45 @@ extern_class!( ); extern_methods!( unsafe impl NSFileCoordinator { - pub unsafe fn addFilePresenter(filePresenter: &NSFilePresenter) { - msg_send![Self::class(), addFilePresenter: filePresenter] - } - pub unsafe fn removeFilePresenter(filePresenter: &NSFilePresenter) { - msg_send![Self::class(), removeFilePresenter: filePresenter] - } - pub unsafe fn filePresenters() -> Id, Shared> { - msg_send_id![Self::class(), filePresenters] - } + # [method (addFilePresenter :)] + pub unsafe fn addFilePresenter(filePresenter: &NSFilePresenter); + # [method (removeFilePresenter :)] + pub unsafe fn removeFilePresenter(filePresenter: &NSFilePresenter); + #[method_id(filePresenters)] + pub unsafe fn filePresenters() -> Id, Shared>; + # [method_id (initWithFilePresenter :)] pub unsafe fn initWithFilePresenter( &self, filePresenterOrNil: Option<&NSFilePresenter>, - ) -> Id { - msg_send_id![self, initWithFilePresenter: filePresenterOrNil] - } - pub unsafe fn purposeIdentifier(&self) -> Id { - msg_send_id![self, purposeIdentifier] - } - pub unsafe fn setPurposeIdentifier(&self, purposeIdentifier: &NSString) { - msg_send![self, setPurposeIdentifier: purposeIdentifier] - } + ) -> Id; + #[method_id(purposeIdentifier)] + pub unsafe fn purposeIdentifier(&self) -> Id; + # [method (setPurposeIdentifier :)] + pub unsafe fn setPurposeIdentifier(&self, purposeIdentifier: &NSString); + # [method (coordinateAccessWithIntents : queue : byAccessor :)] pub unsafe fn coordinateAccessWithIntents_queue_byAccessor( &self, intents: &NSArray, queue: &NSOperationQueue, accessor: TodoBlock, - ) { - msg_send![ - self, - coordinateAccessWithIntents: intents, - queue: queue, - byAccessor: accessor - ] - } + ); + # [method (coordinateReadingItemAtURL : options : error : byAccessor :)] pub unsafe fn coordinateReadingItemAtURL_options_error_byAccessor( &self, url: &NSURL, options: NSFileCoordinatorReadingOptions, outError: *mut *mut NSError, reader: TodoBlock, - ) { - msg_send![ - self, - coordinateReadingItemAtURL: url, - options: options, - error: outError, - byAccessor: reader - ] - } + ); + # [method (coordinateWritingItemAtURL : options : error : byAccessor :)] pub unsafe fn coordinateWritingItemAtURL_options_error_byAccessor( &self, url: &NSURL, options: NSFileCoordinatorWritingOptions, outError: *mut *mut NSError, writer: TodoBlock, - ) { - msg_send![ - self, - coordinateWritingItemAtURL: url, - options: options, - error: outError, - byAccessor: writer - ] - } + ); + # [method (coordinateReadingItemAtURL : options : writingItemAtURL : options : error : byAccessor :)] pub unsafe fn coordinateReadingItemAtURL_options_writingItemAtURL_options_error_byAccessor( &self, readingURL: &NSURL, @@ -117,17 +89,8 @@ extern_methods!( writingOptions: NSFileCoordinatorWritingOptions, outError: *mut *mut NSError, readerWriter: TodoBlock, - ) { - msg_send![ - self, - coordinateReadingItemAtURL: readingURL, - options: readingOptions, - writingItemAtURL: writingURL, - options: writingOptions, - error: outError, - byAccessor: readerWriter - ] - } + ); + # [method (coordinateWritingItemAtURL : options : writingItemAtURL : options : error : byAccessor :)] pub unsafe fn coordinateWritingItemAtURL_options_writingItemAtURL_options_error_byAccessor( &self, url1: &NSURL, @@ -136,17 +99,8 @@ extern_methods!( options2: NSFileCoordinatorWritingOptions, outError: *mut *mut NSError, writer: TodoBlock, - ) { - msg_send![ - self, - coordinateWritingItemAtURL: url1, - options: options1, - writingItemAtURL: url2, - options: options2, - error: outError, - byAccessor: writer - ] - } + ); + # [method (prepareForReadingItemsAtURLs : options : writingItemsAtURLs : options : error : byAccessor :)] pub unsafe fn prepareForReadingItemsAtURLs_options_writingItemsAtURLs_options_error_byAccessor( &self, readingURLs: &NSArray, @@ -155,36 +109,18 @@ extern_methods!( writingOptions: NSFileCoordinatorWritingOptions, outError: *mut *mut NSError, batchAccessor: TodoBlock, - ) { - msg_send![ - self, - prepareForReadingItemsAtURLs: readingURLs, - options: readingOptions, - writingItemsAtURLs: writingURLs, - options: writingOptions, - error: outError, - byAccessor: batchAccessor - ] - } - pub unsafe fn itemAtURL_willMoveToURL(&self, oldURL: &NSURL, newURL: &NSURL) { - msg_send![self, itemAtURL: oldURL, willMoveToURL: newURL] - } - pub unsafe fn itemAtURL_didMoveToURL(&self, oldURL: &NSURL, newURL: &NSURL) { - msg_send![self, itemAtURL: oldURL, didMoveToURL: newURL] - } + ); + # [method (itemAtURL : willMoveToURL :)] + pub unsafe fn itemAtURL_willMoveToURL(&self, oldURL: &NSURL, newURL: &NSURL); + # [method (itemAtURL : didMoveToURL :)] + pub unsafe fn itemAtURL_didMoveToURL(&self, oldURL: &NSURL, newURL: &NSURL); + # [method (itemAtURL : didChangeUbiquityAttributes :)] pub unsafe fn itemAtURL_didChangeUbiquityAttributes( &self, url: &NSURL, attributes: &NSSet, - ) { - msg_send![ - self, - itemAtURL: url, - didChangeUbiquityAttributes: attributes - ] - } - pub unsafe fn cancel(&self) { - msg_send![self, cancel] - } + ); + #[method(cancel)] + pub unsafe fn cancel(&self); } ); diff --git a/icrate/src/Foundation/generated/NSFileHandle.rs b/icrate/src/Foundation/generated/NSFileHandle.rs index df342edd6..7089140fb 100644 --- a/icrate/src/Foundation/generated/NSFileHandle.rs +++ b/icrate/src/Foundation/generated/NSFileHandle.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSRunLoop::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSFileHandle; @@ -20,199 +20,154 @@ extern_class!( ); extern_methods!( unsafe impl NSFileHandle { - pub unsafe fn availableData(&self) -> Id { - msg_send_id![self, availableData] - } + #[method_id(availableData)] + pub unsafe fn availableData(&self) -> Id; + # [method_id (initWithFileDescriptor : closeOnDealloc :)] pub unsafe fn initWithFileDescriptor_closeOnDealloc( &self, fd: c_int, closeopt: bool, - ) -> Id { - msg_send_id![self, initWithFileDescriptor: fd, closeOnDealloc: closeopt] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; + # [method_id (readDataToEndOfFileAndReturnError :)] pub unsafe fn readDataToEndOfFileAndReturnError( &self, - ) -> Result, Id> { - msg_send_id![self, readDataToEndOfFileAndReturnError: _] - } + ) -> Result, Id>; + # [method_id (readDataUpToLength : error :)] pub unsafe fn readDataUpToLength_error( &self, length: NSUInteger, - ) -> Result, Id> { - msg_send_id![self, readDataUpToLength: length, error: _] - } - pub unsafe fn writeData_error(&self, data: &NSData) -> Result<(), Id> { - msg_send![self, writeData: data, error: _] - } + ) -> Result, Id>; + # [method (writeData : error :)] + pub unsafe fn writeData_error(&self, data: &NSData) -> Result<(), Id>; + # [method (getOffset : error :)] pub unsafe fn getOffset_error( &self, offsetInFile: NonNull, - ) -> Result<(), Id> { - msg_send![self, getOffset: offsetInFile, error: _] - } + ) -> Result<(), Id>; + # [method (seekToEndReturningOffset : error :)] pub unsafe fn seekToEndReturningOffset_error( &self, offsetInFile: *mut c_ulonglong, - ) -> Result<(), Id> { - msg_send![self, seekToEndReturningOffset: offsetInFile, error: _] - } + ) -> Result<(), Id>; + # [method (seekToOffset : error :)] pub unsafe fn seekToOffset_error( &self, offset: c_ulonglong, - ) -> Result<(), Id> { - msg_send![self, seekToOffset: offset, error: _] - } + ) -> Result<(), Id>; + # [method (truncateAtOffset : error :)] pub unsafe fn truncateAtOffset_error( &self, offset: c_ulonglong, - ) -> Result<(), Id> { - msg_send![self, truncateAtOffset: offset, error: _] - } - pub unsafe fn synchronizeAndReturnError(&self) -> Result<(), Id> { - msg_send![self, synchronizeAndReturnError: _] - } - pub unsafe fn closeAndReturnError(&self) -> Result<(), Id> { - msg_send![self, closeAndReturnError: _] - } + ) -> Result<(), Id>; + # [method (synchronizeAndReturnError :)] + pub unsafe fn synchronizeAndReturnError(&self) -> Result<(), Id>; + # [method (closeAndReturnError :)] + pub unsafe fn closeAndReturnError(&self) -> Result<(), Id>; } ); extern_methods!( #[doc = "NSFileHandleCreation"] unsafe impl NSFileHandle { - pub unsafe fn fileHandleWithStandardInput() -> Id { - msg_send_id![Self::class(), fileHandleWithStandardInput] - } - pub unsafe fn fileHandleWithStandardOutput() -> Id { - msg_send_id![Self::class(), fileHandleWithStandardOutput] - } - pub unsafe fn fileHandleWithStandardError() -> Id { - msg_send_id![Self::class(), fileHandleWithStandardError] - } - pub unsafe fn fileHandleWithNullDevice() -> Id { - msg_send_id![Self::class(), fileHandleWithNullDevice] - } - pub unsafe fn fileHandleForReadingAtPath(path: &NSString) -> Option> { - msg_send_id![Self::class(), fileHandleForReadingAtPath: path] - } - pub unsafe fn fileHandleForWritingAtPath(path: &NSString) -> Option> { - msg_send_id![Self::class(), fileHandleForWritingAtPath: path] - } - pub unsafe fn fileHandleForUpdatingAtPath(path: &NSString) -> Option> { - msg_send_id![Self::class(), fileHandleForUpdatingAtPath: path] - } + #[method_id(fileHandleWithStandardInput)] + pub unsafe fn fileHandleWithStandardInput() -> Id; + #[method_id(fileHandleWithStandardOutput)] + pub unsafe fn fileHandleWithStandardOutput() -> Id; + #[method_id(fileHandleWithStandardError)] + pub unsafe fn fileHandleWithStandardError() -> Id; + #[method_id(fileHandleWithNullDevice)] + pub unsafe fn fileHandleWithNullDevice() -> Id; + # [method_id (fileHandleForReadingAtPath :)] + pub unsafe fn fileHandleForReadingAtPath(path: &NSString) -> Option>; + # [method_id (fileHandleForWritingAtPath :)] + pub unsafe fn fileHandleForWritingAtPath(path: &NSString) -> Option>; + # [method_id (fileHandleForUpdatingAtPath :)] + pub unsafe fn fileHandleForUpdatingAtPath(path: &NSString) -> Option>; + # [method_id (fileHandleForReadingFromURL : error :)] pub unsafe fn fileHandleForReadingFromURL_error( url: &NSURL, - ) -> Result, Id> { - msg_send_id![Self::class(), fileHandleForReadingFromURL: url, error: _] - } + ) -> Result, Id>; + # [method_id (fileHandleForWritingToURL : error :)] pub unsafe fn fileHandleForWritingToURL_error( url: &NSURL, - ) -> Result, Id> { - msg_send_id![Self::class(), fileHandleForWritingToURL: url, error: _] - } + ) -> Result, Id>; + # [method_id (fileHandleForUpdatingURL : error :)] pub unsafe fn fileHandleForUpdatingURL_error( url: &NSURL, - ) -> Result, Id> { - msg_send_id![Self::class(), fileHandleForUpdatingURL: url, error: _] - } + ) -> Result, Id>; } ); extern_methods!( #[doc = "NSFileHandleAsynchronousAccess"] unsafe impl NSFileHandle { + # [method (readInBackgroundAndNotifyForModes :)] pub unsafe fn readInBackgroundAndNotifyForModes( &self, modes: Option<&NSArray>, - ) { - msg_send![self, readInBackgroundAndNotifyForModes: modes] - } - pub unsafe fn readInBackgroundAndNotify(&self) { - msg_send![self, readInBackgroundAndNotify] - } + ); + #[method(readInBackgroundAndNotify)] + pub unsafe fn readInBackgroundAndNotify(&self); + # [method (readToEndOfFileInBackgroundAndNotifyForModes :)] pub unsafe fn readToEndOfFileInBackgroundAndNotifyForModes( &self, modes: Option<&NSArray>, - ) { - msg_send![self, readToEndOfFileInBackgroundAndNotifyForModes: modes] - } - pub unsafe fn readToEndOfFileInBackgroundAndNotify(&self) { - msg_send![self, readToEndOfFileInBackgroundAndNotify] - } + ); + #[method(readToEndOfFileInBackgroundAndNotify)] + pub unsafe fn readToEndOfFileInBackgroundAndNotify(&self); + # [method (acceptConnectionInBackgroundAndNotifyForModes :)] pub unsafe fn acceptConnectionInBackgroundAndNotifyForModes( &self, modes: Option<&NSArray>, - ) { - msg_send![self, acceptConnectionInBackgroundAndNotifyForModes: modes] - } - pub unsafe fn acceptConnectionInBackgroundAndNotify(&self) { - msg_send![self, acceptConnectionInBackgroundAndNotify] - } + ); + #[method(acceptConnectionInBackgroundAndNotify)] + pub unsafe fn acceptConnectionInBackgroundAndNotify(&self); + # [method (waitForDataInBackgroundAndNotifyForModes :)] pub unsafe fn waitForDataInBackgroundAndNotifyForModes( &self, modes: Option<&NSArray>, - ) { - msg_send![self, waitForDataInBackgroundAndNotifyForModes: modes] - } - pub unsafe fn waitForDataInBackgroundAndNotify(&self) { - msg_send![self, waitForDataInBackgroundAndNotify] - } - pub unsafe fn readabilityHandler(&self) -> TodoBlock { - msg_send![self, readabilityHandler] - } - pub unsafe fn setReadabilityHandler(&self, readabilityHandler: TodoBlock) { - msg_send![self, setReadabilityHandler: readabilityHandler] - } - pub unsafe fn writeabilityHandler(&self) -> TodoBlock { - msg_send![self, writeabilityHandler] - } - pub unsafe fn setWriteabilityHandler(&self, writeabilityHandler: TodoBlock) { - msg_send![self, setWriteabilityHandler: writeabilityHandler] - } + ); + #[method(waitForDataInBackgroundAndNotify)] + pub unsafe fn waitForDataInBackgroundAndNotify(&self); + #[method(readabilityHandler)] + pub unsafe fn readabilityHandler(&self) -> TodoBlock; + # [method (setReadabilityHandler :)] + pub unsafe fn setReadabilityHandler(&self, readabilityHandler: TodoBlock); + #[method(writeabilityHandler)] + pub unsafe fn writeabilityHandler(&self) -> TodoBlock; + # [method (setWriteabilityHandler :)] + pub unsafe fn setWriteabilityHandler(&self, writeabilityHandler: TodoBlock); } ); extern_methods!( #[doc = "NSFileHandlePlatformSpecific"] unsafe impl NSFileHandle { - pub unsafe fn initWithFileDescriptor(&self, fd: c_int) -> Id { - msg_send_id![self, initWithFileDescriptor: fd] - } - pub unsafe fn fileDescriptor(&self) -> c_int { - msg_send![self, fileDescriptor] - } + # [method_id (initWithFileDescriptor :)] + pub unsafe fn initWithFileDescriptor(&self, fd: c_int) -> Id; + #[method(fileDescriptor)] + pub unsafe fn fileDescriptor(&self) -> c_int; } ); extern_methods!( unsafe impl NSFileHandle { - pub unsafe fn readDataToEndOfFile(&self) -> Id { - msg_send_id![self, readDataToEndOfFile] - } - pub unsafe fn readDataOfLength(&self, length: NSUInteger) -> Id { - msg_send_id![self, readDataOfLength: length] - } - pub unsafe fn writeData(&self, data: &NSData) { - msg_send![self, writeData: data] - } - pub unsafe fn offsetInFile(&self) -> c_ulonglong { - msg_send![self, offsetInFile] - } - pub unsafe fn seekToEndOfFile(&self) -> c_ulonglong { - msg_send![self, seekToEndOfFile] - } - pub unsafe fn seekToFileOffset(&self, offset: c_ulonglong) { - msg_send![self, seekToFileOffset: offset] - } - pub unsafe fn truncateFileAtOffset(&self, offset: c_ulonglong) { - msg_send![self, truncateFileAtOffset: offset] - } - pub unsafe fn synchronizeFile(&self) { - msg_send![self, synchronizeFile] - } - pub unsafe fn closeFile(&self) { - msg_send![self, closeFile] - } + #[method_id(readDataToEndOfFile)] + pub unsafe fn readDataToEndOfFile(&self) -> Id; + # [method_id (readDataOfLength :)] + pub unsafe fn readDataOfLength(&self, length: NSUInteger) -> Id; + # [method (writeData :)] + pub unsafe fn writeData(&self, data: &NSData); + #[method(offsetInFile)] + pub unsafe fn offsetInFile(&self) -> c_ulonglong; + #[method(seekToEndOfFile)] + pub unsafe fn seekToEndOfFile(&self) -> c_ulonglong; + # [method (seekToFileOffset :)] + pub unsafe fn seekToFileOffset(&self, offset: c_ulonglong); + # [method (truncateFileAtOffset :)] + pub unsafe fn truncateFileAtOffset(&self, offset: c_ulonglong); + #[method(synchronizeFile)] + pub unsafe fn synchronizeFile(&self); + #[method(closeFile)] + pub unsafe fn closeFile(&self); } ); extern_class!( @@ -224,14 +179,11 @@ extern_class!( ); extern_methods!( unsafe impl NSPipe { - pub unsafe fn fileHandleForReading(&self) -> Id { - msg_send_id![self, fileHandleForReading] - } - pub unsafe fn fileHandleForWriting(&self) -> Id { - msg_send_id![self, fileHandleForWriting] - } - pub unsafe fn pipe() -> Id { - msg_send_id![Self::class(), pipe] - } + #[method_id(fileHandleForReading)] + pub unsafe fn fileHandleForReading(&self) -> Id; + #[method_id(fileHandleForWriting)] + pub unsafe fn fileHandleForWriting(&self) -> Id; + #[method_id(pipe)] + pub unsafe fn pipe() -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSFileManager.rs b/icrate/src/Foundation/generated/NSFileManager.rs index 11207c9b2..116a2af4b 100644 --- a/icrate/src/Foundation/generated/NSFileManager.rs +++ b/icrate/src/Foundation/generated/NSFileManager.rs @@ -17,7 +17,7 @@ use crate::Foundation::generated::NSURL::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSFileAttributeKey = NSString; pub type NSFileAttributeType = NSString; pub type NSFileProtectionType = NSString; @@ -31,439 +31,302 @@ extern_class!( ); extern_methods!( unsafe impl NSFileManager { - pub unsafe fn defaultManager() -> Id { - msg_send_id![Self::class(), defaultManager] - } + #[method_id(defaultManager)] + pub unsafe fn defaultManager() -> Id; + # [method_id (mountedVolumeURLsIncludingResourceValuesForKeys : options :)] pub unsafe fn mountedVolumeURLsIncludingResourceValuesForKeys_options( &self, propertyKeys: Option<&NSArray>, options: NSVolumeEnumerationOptions, - ) -> Option, Shared>> { - msg_send_id![ - self, - mountedVolumeURLsIncludingResourceValuesForKeys: propertyKeys, - options: options - ] - } + ) -> Option, Shared>>; + # [method (unmountVolumeAtURL : options : completionHandler :)] pub unsafe fn unmountVolumeAtURL_options_completionHandler( &self, url: &NSURL, mask: NSFileManagerUnmountOptions, completionHandler: TodoBlock, - ) { - msg_send![ - self, - unmountVolumeAtURL: url, - options: mask, - completionHandler: completionHandler - ] - } + ); + # [method_id (contentsOfDirectoryAtURL : includingPropertiesForKeys : options : error :)] pub unsafe fn contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error( &self, url: &NSURL, keys: Option<&NSArray>, mask: NSDirectoryEnumerationOptions, - ) -> Result, Shared>, Id> { - msg_send_id![ - self, - contentsOfDirectoryAtURL: url, - includingPropertiesForKeys: keys, - options: mask, - error: _ - ] - } + ) -> Result, Shared>, Id>; + # [method_id (URLsForDirectory : inDomains :)] pub unsafe fn URLsForDirectory_inDomains( &self, directory: NSSearchPathDirectory, domainMask: NSSearchPathDomainMask, - ) -> Id, Shared> { - msg_send_id![self, URLsForDirectory: directory, inDomains: domainMask] - } + ) -> Id, Shared>; + # [method_id (URLForDirectory : inDomain : appropriateForURL : create : error :)] pub unsafe fn URLForDirectory_inDomain_appropriateForURL_create_error( &self, directory: NSSearchPathDirectory, domain: NSSearchPathDomainMask, url: Option<&NSURL>, shouldCreate: bool, - ) -> Result, Id> { - msg_send_id![ - self, - URLForDirectory: directory, - inDomain: domain, - appropriateForURL: url, - create: shouldCreate, - error: _ - ] - } + ) -> Result, Id>; + # [method (getRelationship : ofDirectoryAtURL : toItemAtURL : error :)] pub unsafe fn getRelationship_ofDirectoryAtURL_toItemAtURL_error( &self, outRelationship: NonNull, directoryURL: &NSURL, otherURL: &NSURL, - ) -> Result<(), Id> { - msg_send![ - self, - getRelationship: outRelationship, - ofDirectoryAtURL: directoryURL, - toItemAtURL: otherURL, - error: _ - ] - } + ) -> Result<(), Id>; + # [method (getRelationship : ofDirectory : inDomain : toItemAtURL : error :)] pub unsafe fn getRelationship_ofDirectory_inDomain_toItemAtURL_error( &self, outRelationship: NonNull, directory: NSSearchPathDirectory, domainMask: NSSearchPathDomainMask, url: &NSURL, - ) -> Result<(), Id> { - msg_send![ - self, - getRelationship: outRelationship, - ofDirectory: directory, - inDomain: domainMask, - toItemAtURL: url, - error: _ - ] - } + ) -> Result<(), Id>; + # [method (createDirectoryAtURL : withIntermediateDirectories : attributes : error :)] pub unsafe fn createDirectoryAtURL_withIntermediateDirectories_attributes_error( &self, url: &NSURL, createIntermediates: bool, attributes: Option<&NSDictionary>, - ) -> Result<(), Id> { - msg_send![ - self, - createDirectoryAtURL: url, - withIntermediateDirectories: createIntermediates, - attributes: attributes, - error: _ - ] - } + ) -> Result<(), Id>; + # [method (createSymbolicLinkAtURL : withDestinationURL : error :)] pub unsafe fn createSymbolicLinkAtURL_withDestinationURL_error( &self, url: &NSURL, destURL: &NSURL, - ) -> Result<(), Id> { - msg_send![ - self, - createSymbolicLinkAtURL: url, - withDestinationURL: destURL, - error: _ - ] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSFileManagerDelegate>) { - msg_send![self, setDelegate: delegate] - } + ) -> Result<(), Id>; + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSFileManagerDelegate>); + # [method (setAttributes : ofItemAtPath : error :)] pub unsafe fn setAttributes_ofItemAtPath_error( &self, attributes: &NSDictionary, path: &NSString, - ) -> Result<(), Id> { - msg_send![ - self, - setAttributes: attributes, - ofItemAtPath: path, - error: _ - ] - } + ) -> Result<(), Id>; + # [method (createDirectoryAtPath : withIntermediateDirectories : attributes : error :)] pub unsafe fn createDirectoryAtPath_withIntermediateDirectories_attributes_error( &self, path: &NSString, createIntermediates: bool, attributes: Option<&NSDictionary>, - ) -> Result<(), Id> { - msg_send![ - self, - createDirectoryAtPath: path, - withIntermediateDirectories: createIntermediates, - attributes: attributes, - error: _ - ] - } + ) -> Result<(), Id>; + # [method_id (contentsOfDirectoryAtPath : error :)] pub unsafe fn contentsOfDirectoryAtPath_error( &self, path: &NSString, - ) -> Result, Shared>, Id> { - msg_send_id![self, contentsOfDirectoryAtPath: path, error: _] - } + ) -> Result, Shared>, Id>; + # [method_id (subpathsOfDirectoryAtPath : error :)] pub unsafe fn subpathsOfDirectoryAtPath_error( &self, path: &NSString, - ) -> Result, Shared>, Id> { - msg_send_id![self, subpathsOfDirectoryAtPath: path, error: _] - } + ) -> Result, Shared>, Id>; + # [method_id (attributesOfItemAtPath : error :)] pub unsafe fn attributesOfItemAtPath_error( &self, path: &NSString, - ) -> Result, Shared>, Id> - { - msg_send_id![self, attributesOfItemAtPath: path, error: _] - } + ) -> Result, Shared>, Id>; + # [method_id (attributesOfFileSystemForPath : error :)] pub unsafe fn attributesOfFileSystemForPath_error( &self, path: &NSString, - ) -> Result, Shared>, Id> - { - msg_send_id![self, attributesOfFileSystemForPath: path, error: _] - } + ) -> Result, Shared>, Id>; + # [method (createSymbolicLinkAtPath : withDestinationPath : error :)] pub unsafe fn createSymbolicLinkAtPath_withDestinationPath_error( &self, path: &NSString, destPath: &NSString, - ) -> Result<(), Id> { - msg_send![ - self, - createSymbolicLinkAtPath: path, - withDestinationPath: destPath, - error: _ - ] - } + ) -> Result<(), Id>; + # [method_id (destinationOfSymbolicLinkAtPath : error :)] pub unsafe fn destinationOfSymbolicLinkAtPath_error( &self, path: &NSString, - ) -> Result, Id> { - msg_send_id![self, destinationOfSymbolicLinkAtPath: path, error: _] - } + ) -> Result, Id>; + # [method (copyItemAtPath : toPath : error :)] pub unsafe fn copyItemAtPath_toPath_error( &self, srcPath: &NSString, dstPath: &NSString, - ) -> Result<(), Id> { - msg_send![self, copyItemAtPath: srcPath, toPath: dstPath, error: _] - } + ) -> Result<(), Id>; + # [method (moveItemAtPath : toPath : error :)] pub unsafe fn moveItemAtPath_toPath_error( &self, srcPath: &NSString, dstPath: &NSString, - ) -> Result<(), Id> { - msg_send![self, moveItemAtPath: srcPath, toPath: dstPath, error: _] - } + ) -> Result<(), Id>; + # [method (linkItemAtPath : toPath : error :)] pub unsafe fn linkItemAtPath_toPath_error( &self, srcPath: &NSString, dstPath: &NSString, - ) -> Result<(), Id> { - msg_send![self, linkItemAtPath: srcPath, toPath: dstPath, error: _] - } + ) -> Result<(), Id>; + # [method (removeItemAtPath : error :)] pub unsafe fn removeItemAtPath_error( &self, path: &NSString, - ) -> Result<(), Id> { - msg_send![self, removeItemAtPath: path, error: _] - } + ) -> Result<(), Id>; + # [method (copyItemAtURL : toURL : error :)] pub unsafe fn copyItemAtURL_toURL_error( &self, srcURL: &NSURL, dstURL: &NSURL, - ) -> Result<(), Id> { - msg_send![self, copyItemAtURL: srcURL, toURL: dstURL, error: _] - } + ) -> Result<(), Id>; + # [method (moveItemAtURL : toURL : error :)] pub unsafe fn moveItemAtURL_toURL_error( &self, srcURL: &NSURL, dstURL: &NSURL, - ) -> Result<(), Id> { - msg_send![self, moveItemAtURL: srcURL, toURL: dstURL, error: _] - } + ) -> Result<(), Id>; + # [method (linkItemAtURL : toURL : error :)] pub unsafe fn linkItemAtURL_toURL_error( &self, srcURL: &NSURL, dstURL: &NSURL, - ) -> Result<(), Id> { - msg_send![self, linkItemAtURL: srcURL, toURL: dstURL, error: _] - } - pub unsafe fn removeItemAtURL_error(&self, URL: &NSURL) -> Result<(), Id> { - msg_send![self, removeItemAtURL: URL, error: _] - } + ) -> Result<(), Id>; + # [method (removeItemAtURL : error :)] + pub unsafe fn removeItemAtURL_error(&self, URL: &NSURL) -> Result<(), Id>; + # [method (trashItemAtURL : resultingItemURL : error :)] pub unsafe fn trashItemAtURL_resultingItemURL_error( &self, url: &NSURL, outResultingURL: Option<&mut Option>>, - ) -> Result<(), Id> { - msg_send![ - self, - trashItemAtURL: url, - resultingItemURL: outResultingURL, - error: _ - ] - } + ) -> Result<(), Id>; + # [method_id (fileAttributesAtPath : traverseLink :)] pub unsafe fn fileAttributesAtPath_traverseLink( &self, path: &NSString, yorn: bool, - ) -> Option> { - msg_send_id![self, fileAttributesAtPath: path, traverseLink: yorn] - } + ) -> Option>; + # [method (changeFileAttributes : atPath :)] pub unsafe fn changeFileAttributes_atPath( &self, attributes: &NSDictionary, path: &NSString, - ) -> bool { - msg_send![self, changeFileAttributes: attributes, atPath: path] - } + ) -> bool; + # [method_id (directoryContentsAtPath :)] pub unsafe fn directoryContentsAtPath( &self, path: &NSString, - ) -> Option> { - msg_send_id![self, directoryContentsAtPath: path] - } + ) -> Option>; + # [method_id (fileSystemAttributesAtPath :)] pub unsafe fn fileSystemAttributesAtPath( &self, path: &NSString, - ) -> Option> { - msg_send_id![self, fileSystemAttributesAtPath: path] - } + ) -> Option>; + # [method_id (pathContentOfSymbolicLinkAtPath :)] pub unsafe fn pathContentOfSymbolicLinkAtPath( &self, path: &NSString, - ) -> Option> { - msg_send_id![self, pathContentOfSymbolicLinkAtPath: path] - } + ) -> Option>; + # [method (createSymbolicLinkAtPath : pathContent :)] pub unsafe fn createSymbolicLinkAtPath_pathContent( &self, path: &NSString, otherpath: &NSString, - ) -> bool { - msg_send![self, createSymbolicLinkAtPath: path, pathContent: otherpath] - } + ) -> bool; + # [method (createDirectoryAtPath : attributes :)] pub unsafe fn createDirectoryAtPath_attributes( &self, path: &NSString, attributes: &NSDictionary, - ) -> bool { - msg_send![self, createDirectoryAtPath: path, attributes: attributes] - } + ) -> bool; + # [method (linkPath : toPath : handler :)] pub unsafe fn linkPath_toPath_handler( &self, src: &NSString, dest: &NSString, handler: Option<&Object>, - ) -> bool { - msg_send![self, linkPath: src, toPath: dest, handler: handler] - } + ) -> bool; + # [method (copyPath : toPath : handler :)] pub unsafe fn copyPath_toPath_handler( &self, src: &NSString, dest: &NSString, handler: Option<&Object>, - ) -> bool { - msg_send![self, copyPath: src, toPath: dest, handler: handler] - } + ) -> bool; + # [method (movePath : toPath : handler :)] pub unsafe fn movePath_toPath_handler( &self, src: &NSString, dest: &NSString, handler: Option<&Object>, - ) -> bool { - msg_send![self, movePath: src, toPath: dest, handler: handler] - } + ) -> bool; + # [method (removeFileAtPath : handler :)] pub unsafe fn removeFileAtPath_handler( &self, path: &NSString, handler: Option<&Object>, - ) -> bool { - msg_send![self, removeFileAtPath: path, handler: handler] - } - pub unsafe fn currentDirectoryPath(&self) -> Id { - msg_send_id![self, currentDirectoryPath] - } - pub unsafe fn changeCurrentDirectoryPath(&self, path: &NSString) -> bool { - msg_send![self, changeCurrentDirectoryPath: path] - } - pub unsafe fn fileExistsAtPath(&self, path: &NSString) -> bool { - msg_send![self, fileExistsAtPath: path] - } + ) -> bool; + #[method_id(currentDirectoryPath)] + pub unsafe fn currentDirectoryPath(&self) -> Id; + # [method (changeCurrentDirectoryPath :)] + pub unsafe fn changeCurrentDirectoryPath(&self, path: &NSString) -> bool; + # [method (fileExistsAtPath :)] + pub unsafe fn fileExistsAtPath(&self, path: &NSString) -> bool; + # [method (fileExistsAtPath : isDirectory :)] pub unsafe fn fileExistsAtPath_isDirectory( &self, path: &NSString, isDirectory: *mut bool, - ) -> bool { - msg_send![self, fileExistsAtPath: path, isDirectory: isDirectory] - } - pub unsafe fn isReadableFileAtPath(&self, path: &NSString) -> bool { - msg_send![self, isReadableFileAtPath: path] - } - pub unsafe fn isWritableFileAtPath(&self, path: &NSString) -> bool { - msg_send![self, isWritableFileAtPath: path] - } - pub unsafe fn isExecutableFileAtPath(&self, path: &NSString) -> bool { - msg_send![self, isExecutableFileAtPath: path] - } - pub unsafe fn isDeletableFileAtPath(&self, path: &NSString) -> bool { - msg_send![self, isDeletableFileAtPath: path] - } + ) -> bool; + # [method (isReadableFileAtPath :)] + pub unsafe fn isReadableFileAtPath(&self, path: &NSString) -> bool; + # [method (isWritableFileAtPath :)] + pub unsafe fn isWritableFileAtPath(&self, path: &NSString) -> bool; + # [method (isExecutableFileAtPath :)] + pub unsafe fn isExecutableFileAtPath(&self, path: &NSString) -> bool; + # [method (isDeletableFileAtPath :)] + pub unsafe fn isDeletableFileAtPath(&self, path: &NSString) -> bool; + # [method (contentsEqualAtPath : andPath :)] pub unsafe fn contentsEqualAtPath_andPath( &self, path1: &NSString, path2: &NSString, - ) -> bool { - msg_send![self, contentsEqualAtPath: path1, andPath: path2] - } - pub unsafe fn displayNameAtPath(&self, path: &NSString) -> Id { - msg_send_id![self, displayNameAtPath: path] - } + ) -> bool; + # [method_id (displayNameAtPath :)] + pub unsafe fn displayNameAtPath(&self, path: &NSString) -> Id; + # [method_id (componentsToDisplayForPath :)] pub unsafe fn componentsToDisplayForPath( &self, path: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, componentsToDisplayForPath: path] - } + ) -> Option, Shared>>; + # [method_id (enumeratorAtPath :)] pub unsafe fn enumeratorAtPath( &self, path: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, enumeratorAtPath: path] - } + ) -> Option, Shared>>; + # [method_id (enumeratorAtURL : includingPropertiesForKeys : options : errorHandler :)] pub unsafe fn enumeratorAtURL_includingPropertiesForKeys_options_errorHandler( &self, url: &NSURL, keys: Option<&NSArray>, mask: NSDirectoryEnumerationOptions, handler: TodoBlock, - ) -> Option, Shared>> { - msg_send_id![ - self, - enumeratorAtURL: url, - includingPropertiesForKeys: keys, - options: mask, - errorHandler: handler - ] - } + ) -> Option, Shared>>; + # [method_id (subpathsAtPath :)] pub unsafe fn subpathsAtPath( &self, path: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, subpathsAtPath: path] - } - pub unsafe fn contentsAtPath(&self, path: &NSString) -> Option> { - msg_send_id![self, contentsAtPath: path] - } + ) -> Option, Shared>>; + # [method_id (contentsAtPath :)] + pub unsafe fn contentsAtPath(&self, path: &NSString) -> Option>; + # [method (createFileAtPath : contents : attributes :)] pub unsafe fn createFileAtPath_contents_attributes( &self, path: &NSString, data: Option<&NSData>, attr: Option<&NSDictionary>, - ) -> bool { - msg_send![ - self, - createFileAtPath: path, - contents: data, - attributes: attr - ] - } - pub unsafe fn fileSystemRepresentationWithPath(&self, path: &NSString) -> NonNull { - msg_send![self, fileSystemRepresentationWithPath: path] - } + ) -> bool; + # [method (fileSystemRepresentationWithPath :)] + pub unsafe fn fileSystemRepresentationWithPath(&self, path: &NSString) -> NonNull; + # [method_id (stringWithFileSystemRepresentation : length :)] pub unsafe fn stringWithFileSystemRepresentation_length( &self, str: NonNull, len: NSUInteger, - ) -> Id { - msg_send_id![self, stringWithFileSystemRepresentation: str, length: len] - } + ) -> Id; + # [method (replaceItemAtURL : withItemAtURL : backupItemName : options : resultingItemURL : error :)] pub unsafe fn replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error( &self, originalItemURL: &NSURL, @@ -471,119 +334,75 @@ extern_methods!( backupItemName: Option<&NSString>, options: NSFileManagerItemReplacementOptions, resultingURL: Option<&mut Option>>, - ) -> Result<(), Id> { - msg_send![ - self, - replaceItemAtURL: originalItemURL, - withItemAtURL: newItemURL, - backupItemName: backupItemName, - options: options, - resultingItemURL: resultingURL, - error: _ - ] - } + ) -> Result<(), Id>; + # [method (setUbiquitous : itemAtURL : destinationURL : error :)] pub unsafe fn setUbiquitous_itemAtURL_destinationURL_error( &self, flag: bool, url: &NSURL, destinationURL: &NSURL, - ) -> Result<(), Id> { - msg_send![ - self, - setUbiquitous: flag, - itemAtURL: url, - destinationURL: destinationURL, - error: _ - ] - } - pub unsafe fn isUbiquitousItemAtURL(&self, url: &NSURL) -> bool { - msg_send![self, isUbiquitousItemAtURL: url] - } + ) -> Result<(), Id>; + # [method (isUbiquitousItemAtURL :)] + pub unsafe fn isUbiquitousItemAtURL(&self, url: &NSURL) -> bool; + # [method (startDownloadingUbiquitousItemAtURL : error :)] pub unsafe fn startDownloadingUbiquitousItemAtURL_error( &self, url: &NSURL, - ) -> Result<(), Id> { - msg_send![self, startDownloadingUbiquitousItemAtURL: url, error: _] - } + ) -> Result<(), Id>; + # [method (evictUbiquitousItemAtURL : error :)] pub unsafe fn evictUbiquitousItemAtURL_error( &self, url: &NSURL, - ) -> Result<(), Id> { - msg_send![self, evictUbiquitousItemAtURL: url, error: _] - } + ) -> Result<(), Id>; + # [method_id (URLForUbiquityContainerIdentifier :)] pub unsafe fn URLForUbiquityContainerIdentifier( &self, containerIdentifier: Option<&NSString>, - ) -> Option> { - msg_send_id![self, URLForUbiquityContainerIdentifier: containerIdentifier] - } + ) -> Option>; + # [method_id (URLForPublishingUbiquitousItemAtURL : expirationDate : error :)] pub unsafe fn URLForPublishingUbiquitousItemAtURL_expirationDate_error( &self, url: &NSURL, outDate: Option<&mut Option>>, - ) -> Result, Id> { - msg_send_id![ - self, - URLForPublishingUbiquitousItemAtURL: url, - expirationDate: outDate, - error: _ - ] - } - pub unsafe fn ubiquityIdentityToken(&self) -> Option> { - msg_send_id![self, ubiquityIdentityToken] - } + ) -> Result, Id>; + #[method_id(ubiquityIdentityToken)] + pub unsafe fn ubiquityIdentityToken(&self) -> Option>; + # [method (getFileProviderServicesForItemAtURL : completionHandler :)] pub unsafe fn getFileProviderServicesForItemAtURL_completionHandler( &self, url: &NSURL, completionHandler: TodoBlock, - ) { - msg_send![ - self, - getFileProviderServicesForItemAtURL: url, - completionHandler: completionHandler - ] - } + ); + # [method_id (containerURLForSecurityApplicationGroupIdentifier :)] pub unsafe fn containerURLForSecurityApplicationGroupIdentifier( &self, groupIdentifier: &NSString, - ) -> Option> { - msg_send_id![ - self, - containerURLForSecurityApplicationGroupIdentifier: groupIdentifier - ] - } + ) -> Option>; } ); extern_methods!( #[doc = "NSUserInformation"] unsafe impl NSFileManager { - pub unsafe fn homeDirectoryForCurrentUser(&self) -> Id { - msg_send_id![self, homeDirectoryForCurrentUser] - } - pub unsafe fn temporaryDirectory(&self) -> Id { - msg_send_id![self, temporaryDirectory] - } - pub unsafe fn homeDirectoryForUser( - &self, - userName: &NSString, - ) -> Option> { - msg_send_id![self, homeDirectoryForUser: userName] - } + #[method_id(homeDirectoryForCurrentUser)] + pub unsafe fn homeDirectoryForCurrentUser(&self) -> Id; + #[method_id(temporaryDirectory)] + pub unsafe fn temporaryDirectory(&self) -> Id; + # [method_id (homeDirectoryForUser :)] + pub unsafe fn homeDirectoryForUser(&self, userName: &NSString) + -> Option>; } ); extern_methods!( #[doc = "NSCopyLinkMoveHandler"] unsafe impl NSObject { + # [method (fileManager : shouldProceedAfterError :)] pub unsafe fn fileManager_shouldProceedAfterError( &self, fm: &NSFileManager, errorInfo: &NSDictionary, - ) -> bool { - msg_send![self, fileManager: fm, shouldProceedAfterError: errorInfo] - } - pub unsafe fn fileManager_willProcessPath(&self, fm: &NSFileManager, path: &NSString) { - msg_send![self, fileManager: fm, willProcessPath: path] - } + ) -> bool; + # [method (fileManager : willProcessPath :)] + pub unsafe fn fileManager_willProcessPath(&self, fm: &NSFileManager, path: &NSString); } ); pub type NSFileManagerDelegate = NSObject; @@ -596,28 +415,22 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSDirectoryEnumerator { + #[method_id(fileAttributes)] pub unsafe fn fileAttributes( &self, - ) -> Option, Shared>> { - msg_send_id![self, fileAttributes] - } + ) -> Option, Shared>>; + #[method_id(directoryAttributes)] pub unsafe fn directoryAttributes( &self, - ) -> Option, Shared>> { - msg_send_id![self, directoryAttributes] - } - pub unsafe fn isEnumeratingDirectoryPostOrder(&self) -> bool { - msg_send![self, isEnumeratingDirectoryPostOrder] - } - pub unsafe fn skipDescendents(&self) { - msg_send![self, skipDescendents] - } - pub unsafe fn level(&self) -> NSUInteger { - msg_send![self, level] - } - pub unsafe fn skipDescendants(&self) { - msg_send![self, skipDescendants] - } + ) -> Option, Shared>>; + #[method(isEnumeratingDirectoryPostOrder)] + pub unsafe fn isEnumeratingDirectoryPostOrder(&self) -> bool; + #[method(skipDescendents)] + pub unsafe fn skipDescendents(&self); + #[method(level)] + pub unsafe fn level(&self) -> NSUInteger; + #[method(skipDescendants)] + pub unsafe fn skipDescendants(&self); } ); extern_class!( @@ -629,70 +442,49 @@ extern_class!( ); extern_methods!( unsafe impl NSFileProviderService { + # [method (getFileProviderConnectionWithCompletionHandler :)] pub unsafe fn getFileProviderConnectionWithCompletionHandler( &self, completionHandler: TodoBlock, - ) { - msg_send![ - self, - getFileProviderConnectionWithCompletionHandler: completionHandler - ] - } - pub unsafe fn name(&self) -> Id { - msg_send_id![self, name] - } + ); + #[method_id(name)] + pub unsafe fn name(&self) -> Id; } ); extern_methods!( #[doc = "NSFileAttributes"] unsafe impl NSDictionary { - pub unsafe fn fileSize(&self) -> c_ulonglong { - msg_send![self, fileSize] - } - pub unsafe fn fileModificationDate(&self) -> Option> { - msg_send_id![self, fileModificationDate] - } - pub unsafe fn fileType(&self) -> Option> { - msg_send_id![self, fileType] - } - pub unsafe fn filePosixPermissions(&self) -> NSUInteger { - msg_send![self, filePosixPermissions] - } - pub unsafe fn fileOwnerAccountName(&self) -> Option> { - msg_send_id![self, fileOwnerAccountName] - } - pub unsafe fn fileGroupOwnerAccountName(&self) -> Option> { - msg_send_id![self, fileGroupOwnerAccountName] - } - pub unsafe fn fileSystemNumber(&self) -> NSInteger { - msg_send![self, fileSystemNumber] - } - pub unsafe fn fileSystemFileNumber(&self) -> NSUInteger { - msg_send![self, fileSystemFileNumber] - } - pub unsafe fn fileExtensionHidden(&self) -> bool { - msg_send![self, fileExtensionHidden] - } - pub unsafe fn fileHFSCreatorCode(&self) -> OSType { - msg_send![self, fileHFSCreatorCode] - } - pub unsafe fn fileHFSTypeCode(&self) -> OSType { - msg_send![self, fileHFSTypeCode] - } - pub unsafe fn fileIsImmutable(&self) -> bool { - msg_send![self, fileIsImmutable] - } - pub unsafe fn fileIsAppendOnly(&self) -> bool { - msg_send![self, fileIsAppendOnly] - } - pub unsafe fn fileCreationDate(&self) -> Option> { - msg_send_id![self, fileCreationDate] - } - pub unsafe fn fileOwnerAccountID(&self) -> Option> { - msg_send_id![self, fileOwnerAccountID] - } - pub unsafe fn fileGroupOwnerAccountID(&self) -> Option> { - msg_send_id![self, fileGroupOwnerAccountID] - } + #[method(fileSize)] + pub unsafe fn fileSize(&self) -> c_ulonglong; + #[method_id(fileModificationDate)] + pub unsafe fn fileModificationDate(&self) -> Option>; + #[method_id(fileType)] + pub unsafe fn fileType(&self) -> Option>; + #[method(filePosixPermissions)] + pub unsafe fn filePosixPermissions(&self) -> NSUInteger; + #[method_id(fileOwnerAccountName)] + pub unsafe fn fileOwnerAccountName(&self) -> Option>; + #[method_id(fileGroupOwnerAccountName)] + pub unsafe fn fileGroupOwnerAccountName(&self) -> Option>; + #[method(fileSystemNumber)] + pub unsafe fn fileSystemNumber(&self) -> NSInteger; + #[method(fileSystemFileNumber)] + pub unsafe fn fileSystemFileNumber(&self) -> NSUInteger; + #[method(fileExtensionHidden)] + pub unsafe fn fileExtensionHidden(&self) -> bool; + #[method(fileHFSCreatorCode)] + pub unsafe fn fileHFSCreatorCode(&self) -> OSType; + #[method(fileHFSTypeCode)] + pub unsafe fn fileHFSTypeCode(&self) -> OSType; + #[method(fileIsImmutable)] + pub unsafe fn fileIsImmutable(&self) -> bool; + #[method(fileIsAppendOnly)] + pub unsafe fn fileIsAppendOnly(&self) -> bool; + #[method_id(fileCreationDate)] + pub unsafe fn fileCreationDate(&self) -> Option>; + #[method_id(fileOwnerAccountID)] + pub unsafe fn fileOwnerAccountID(&self) -> Option>; + #[method_id(fileGroupOwnerAccountID)] + pub unsafe fn fileGroupOwnerAccountID(&self) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSFilePresenter.rs b/icrate/src/Foundation/generated/NSFilePresenter.rs index 84aba91c0..65db8e4fd 100644 --- a/icrate/src/Foundation/generated/NSFilePresenter.rs +++ b/icrate/src/Foundation/generated/NSFilePresenter.rs @@ -7,5 +7,5 @@ use crate::Foundation::generated::NSURL::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSFilePresenter = NSObject; diff --git a/icrate/src/Foundation/generated/NSFileVersion.rs b/icrate/src/Foundation/generated/NSFileVersion.rs index b48f7e8c8..eb183b7a0 100644 --- a/icrate/src/Foundation/generated/NSFileVersion.rs +++ b/icrate/src/Foundation/generated/NSFileVersion.rs @@ -9,7 +9,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSFileVersion; @@ -19,115 +19,74 @@ extern_class!( ); extern_methods!( unsafe impl NSFileVersion { - pub unsafe fn currentVersionOfItemAtURL(url: &NSURL) -> Option> { - msg_send_id![Self::class(), currentVersionOfItemAtURL: url] - } + # [method_id (currentVersionOfItemAtURL :)] + pub unsafe fn currentVersionOfItemAtURL(url: &NSURL) -> Option>; + # [method_id (otherVersionsOfItemAtURL :)] pub unsafe fn otherVersionsOfItemAtURL( url: &NSURL, - ) -> Option, Shared>> { - msg_send_id![Self::class(), otherVersionsOfItemAtURL: url] - } + ) -> Option, Shared>>; + # [method_id (unresolvedConflictVersionsOfItemAtURL :)] pub unsafe fn unresolvedConflictVersionsOfItemAtURL( url: &NSURL, - ) -> Option, Shared>> { - msg_send_id![Self::class(), unresolvedConflictVersionsOfItemAtURL: url] - } + ) -> Option, Shared>>; + # [method (getNonlocalVersionsOfItemAtURL : completionHandler :)] pub unsafe fn getNonlocalVersionsOfItemAtURL_completionHandler( url: &NSURL, completionHandler: TodoBlock, - ) { - msg_send![ - Self::class(), - getNonlocalVersionsOfItemAtURL: url, - completionHandler: completionHandler - ] - } + ); + # [method_id (versionOfItemAtURL : forPersistentIdentifier :)] pub unsafe fn versionOfItemAtURL_forPersistentIdentifier( url: &NSURL, persistentIdentifier: &Object, - ) -> Option> { - msg_send_id![ - Self::class(), - versionOfItemAtURL: url, - forPersistentIdentifier: persistentIdentifier - ] - } + ) -> Option>; + # [method_id (addVersionOfItemAtURL : withContentsOfURL : options : error :)] pub unsafe fn addVersionOfItemAtURL_withContentsOfURL_options_error( url: &NSURL, contentsURL: &NSURL, options: NSFileVersionAddingOptions, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - addVersionOfItemAtURL: url, - withContentsOfURL: contentsURL, - options: options, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (temporaryDirectoryURLForNewVersionOfItemAtURL :)] pub unsafe fn temporaryDirectoryURLForNewVersionOfItemAtURL( url: &NSURL, - ) -> Id { - msg_send_id![ - Self::class(), - temporaryDirectoryURLForNewVersionOfItemAtURL: url - ] - } - pub unsafe fn URL(&self) -> Id { - msg_send_id![self, URL] - } - pub unsafe fn localizedName(&self) -> Option> { - msg_send_id![self, localizedName] - } - pub unsafe fn localizedNameOfSavingComputer(&self) -> Option> { - msg_send_id![self, localizedNameOfSavingComputer] - } - pub unsafe fn originatorNameComponents( - &self, - ) -> Option> { - msg_send_id![self, originatorNameComponents] - } - pub unsafe fn modificationDate(&self) -> Option> { - msg_send_id![self, modificationDate] - } - pub unsafe fn persistentIdentifier(&self) -> Id { - msg_send_id![self, persistentIdentifier] - } - pub unsafe fn isConflict(&self) -> bool { - msg_send![self, isConflict] - } - pub unsafe fn isResolved(&self) -> bool { - msg_send![self, isResolved] - } - pub unsafe fn setResolved(&self, resolved: bool) { - msg_send![self, setResolved: resolved] - } - pub unsafe fn isDiscardable(&self) -> bool { - msg_send![self, isDiscardable] - } - pub unsafe fn setDiscardable(&self, discardable: bool) { - msg_send![self, setDiscardable: discardable] - } - pub unsafe fn hasLocalContents(&self) -> bool { - msg_send![self, hasLocalContents] - } - pub unsafe fn hasThumbnail(&self) -> bool { - msg_send![self, hasThumbnail] - } + ) -> Id; + #[method_id(URL)] + pub unsafe fn URL(&self) -> Id; + #[method_id(localizedName)] + pub unsafe fn localizedName(&self) -> Option>; + #[method_id(localizedNameOfSavingComputer)] + pub unsafe fn localizedNameOfSavingComputer(&self) -> Option>; + #[method_id(originatorNameComponents)] + pub unsafe fn originatorNameComponents(&self) + -> Option>; + #[method_id(modificationDate)] + pub unsafe fn modificationDate(&self) -> Option>; + #[method_id(persistentIdentifier)] + pub unsafe fn persistentIdentifier(&self) -> Id; + #[method(isConflict)] + pub unsafe fn isConflict(&self) -> bool; + #[method(isResolved)] + pub unsafe fn isResolved(&self) -> bool; + # [method (setResolved :)] + pub unsafe fn setResolved(&self, resolved: bool); + #[method(isDiscardable)] + pub unsafe fn isDiscardable(&self) -> bool; + # [method (setDiscardable :)] + pub unsafe fn setDiscardable(&self, discardable: bool); + #[method(hasLocalContents)] + pub unsafe fn hasLocalContents(&self) -> bool; + #[method(hasThumbnail)] + pub unsafe fn hasThumbnail(&self) -> bool; + # [method_id (replaceItemAtURL : options : error :)] pub unsafe fn replaceItemAtURL_options_error( &self, url: &NSURL, options: NSFileVersionReplacingOptions, - ) -> Result, Id> { - msg_send_id![self, replaceItemAtURL: url, options: options, error: _] - } - pub unsafe fn removeAndReturnError(&self) -> Result<(), Id> { - msg_send![self, removeAndReturnError: _] - } + ) -> Result, Id>; + # [method (removeAndReturnError :)] + pub unsafe fn removeAndReturnError(&self) -> Result<(), Id>; + # [method (removeOtherVersionsOfItemAtURL : error :)] pub unsafe fn removeOtherVersionsOfItemAtURL_error( url: &NSURL, - ) -> Result<(), Id> { - msg_send![Self::class(), removeOtherVersionsOfItemAtURL: url, error: _] - } + ) -> Result<(), Id>; } ); diff --git a/icrate/src/Foundation/generated/NSFileWrapper.rs b/icrate/src/Foundation/generated/NSFileWrapper.rs index d0f2e665f..3d27c1798 100644 --- a/icrate/src/Foundation/generated/NSFileWrapper.rs +++ b/icrate/src/Foundation/generated/NSFileWrapper.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSFileWrapper; @@ -17,174 +17,116 @@ extern_class!( ); extern_methods!( unsafe impl NSFileWrapper { + # [method_id (initWithURL : options : error :)] pub unsafe fn initWithURL_options_error( &self, url: &NSURL, options: NSFileWrapperReadingOptions, - ) -> Result, Id> { - msg_send_id![self, initWithURL: url, options: options, error: _] - } + ) -> Result, Id>; + # [method_id (initDirectoryWithFileWrappers :)] pub unsafe fn initDirectoryWithFileWrappers( &self, childrenByPreferredName: &NSDictionary, - ) -> Id { - msg_send_id![self, initDirectoryWithFileWrappers: childrenByPreferredName] - } - pub unsafe fn initRegularFileWithContents(&self, contents: &NSData) -> Id { - msg_send_id![self, initRegularFileWithContents: contents] - } - pub unsafe fn initSymbolicLinkWithDestinationURL(&self, url: &NSURL) -> Id { - msg_send_id![self, initSymbolicLinkWithDestinationURL: url] - } + ) -> Id; + # [method_id (initRegularFileWithContents :)] + pub unsafe fn initRegularFileWithContents(&self, contents: &NSData) -> Id; + # [method_id (initSymbolicLinkWithDestinationURL :)] + pub unsafe fn initSymbolicLinkWithDestinationURL(&self, url: &NSURL) -> Id; + # [method_id (initWithSerializedRepresentation :)] pub unsafe fn initWithSerializedRepresentation( &self, serializeRepresentation: &NSData, - ) -> Option> { - msg_send_id![ - self, - initWithSerializedRepresentation: serializeRepresentation - ] - } - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } - pub unsafe fn isDirectory(&self) -> bool { - msg_send![self, isDirectory] - } - pub unsafe fn isRegularFile(&self) -> bool { - msg_send![self, isRegularFile] - } - pub unsafe fn isSymbolicLink(&self) -> bool { - msg_send![self, isSymbolicLink] - } - pub unsafe fn preferredFilename(&self) -> Option> { - msg_send_id![self, preferredFilename] - } - pub unsafe fn setPreferredFilename(&self, preferredFilename: Option<&NSString>) { - msg_send![self, setPreferredFilename: preferredFilename] - } - pub unsafe fn filename(&self) -> Option> { - msg_send_id![self, filename] - } - pub unsafe fn setFilename(&self, filename: Option<&NSString>) { - msg_send![self, setFilename: filename] - } - pub unsafe fn fileAttributes(&self) -> Id, Shared> { - msg_send_id![self, fileAttributes] - } - pub unsafe fn setFileAttributes(&self, fileAttributes: &NSDictionary) { - msg_send![self, setFileAttributes: fileAttributes] - } - pub unsafe fn matchesContentsOfURL(&self, url: &NSURL) -> bool { - msg_send![self, matchesContentsOfURL: url] - } + ) -> Option>; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + #[method(isDirectory)] + pub unsafe fn isDirectory(&self) -> bool; + #[method(isRegularFile)] + pub unsafe fn isRegularFile(&self) -> bool; + #[method(isSymbolicLink)] + pub unsafe fn isSymbolicLink(&self) -> bool; + #[method_id(preferredFilename)] + pub unsafe fn preferredFilename(&self) -> Option>; + # [method (setPreferredFilename :)] + pub unsafe fn setPreferredFilename(&self, preferredFilename: Option<&NSString>); + #[method_id(filename)] + pub unsafe fn filename(&self) -> Option>; + # [method (setFilename :)] + pub unsafe fn setFilename(&self, filename: Option<&NSString>); + #[method_id(fileAttributes)] + pub unsafe fn fileAttributes(&self) -> Id, Shared>; + # [method (setFileAttributes :)] + pub unsafe fn setFileAttributes(&self, fileAttributes: &NSDictionary); + # [method (matchesContentsOfURL :)] + pub unsafe fn matchesContentsOfURL(&self, url: &NSURL) -> bool; + # [method (readFromURL : options : error :)] pub unsafe fn readFromURL_options_error( &self, url: &NSURL, options: NSFileWrapperReadingOptions, - ) -> Result<(), Id> { - msg_send![self, readFromURL: url, options: options, error: _] - } + ) -> Result<(), Id>; + # [method (writeToURL : options : originalContentsURL : error :)] pub unsafe fn writeToURL_options_originalContentsURL_error( &self, url: &NSURL, options: NSFileWrapperWritingOptions, originalContentsURL: Option<&NSURL>, - ) -> Result<(), Id> { - msg_send![ - self, - writeToURL: url, - options: options, - originalContentsURL: originalContentsURL, - error: _ - ] - } - pub unsafe fn serializedRepresentation(&self) -> Option> { - msg_send_id![self, serializedRepresentation] - } - pub unsafe fn addFileWrapper(&self, child: &NSFileWrapper) -> Id { - msg_send_id![self, addFileWrapper: child] - } + ) -> Result<(), Id>; + #[method_id(serializedRepresentation)] + pub unsafe fn serializedRepresentation(&self) -> Option>; + # [method_id (addFileWrapper :)] + pub unsafe fn addFileWrapper(&self, child: &NSFileWrapper) -> Id; + # [method_id (addRegularFileWithContents : preferredFilename :)] pub unsafe fn addRegularFileWithContents_preferredFilename( &self, data: &NSData, fileName: &NSString, - ) -> Id { - msg_send_id![ - self, - addRegularFileWithContents: data, - preferredFilename: fileName - ] - } - pub unsafe fn removeFileWrapper(&self, child: &NSFileWrapper) { - msg_send![self, removeFileWrapper: child] - } + ) -> Id; + # [method (removeFileWrapper :)] + pub unsafe fn removeFileWrapper(&self, child: &NSFileWrapper); + #[method_id(fileWrappers)] pub unsafe fn fileWrappers( &self, - ) -> Option, Shared>> { - msg_send_id![self, fileWrappers] - } + ) -> Option, Shared>>; + # [method_id (keyForFileWrapper :)] pub unsafe fn keyForFileWrapper( &self, child: &NSFileWrapper, - ) -> Option> { - msg_send_id![self, keyForFileWrapper: child] - } - pub unsafe fn regularFileContents(&self) -> Option> { - msg_send_id![self, regularFileContents] - } - pub unsafe fn symbolicLinkDestinationURL(&self) -> Option> { - msg_send_id![self, symbolicLinkDestinationURL] - } + ) -> Option>; + #[method_id(regularFileContents)] + pub unsafe fn regularFileContents(&self) -> Option>; + #[method_id(symbolicLinkDestinationURL)] + pub unsafe fn symbolicLinkDestinationURL(&self) -> Option>; } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSFileWrapper { - pub unsafe fn initWithPath(&self, path: &NSString) -> Option> { - msg_send_id![self, initWithPath: path] - } - pub unsafe fn initSymbolicLinkWithDestination( - &self, - path: &NSString, - ) -> Id { - msg_send_id![self, initSymbolicLinkWithDestination: path] - } - pub unsafe fn needsToBeUpdatedFromPath(&self, path: &NSString) -> bool { - msg_send![self, needsToBeUpdatedFromPath: path] - } - pub unsafe fn updateFromPath(&self, path: &NSString) -> bool { - msg_send![self, updateFromPath: path] - } + # [method_id (initWithPath :)] + pub unsafe fn initWithPath(&self, path: &NSString) -> Option>; + # [method_id (initSymbolicLinkWithDestination :)] + pub unsafe fn initSymbolicLinkWithDestination(&self, path: &NSString) + -> Id; + # [method (needsToBeUpdatedFromPath :)] + pub unsafe fn needsToBeUpdatedFromPath(&self, path: &NSString) -> bool; + # [method (updateFromPath :)] + pub unsafe fn updateFromPath(&self, path: &NSString) -> bool; + # [method (writeToFile : atomically : updateFilenames :)] pub unsafe fn writeToFile_atomically_updateFilenames( &self, path: &NSString, atomicFlag: bool, updateFilenamesFlag: bool, - ) -> bool { - msg_send![ - self, - writeToFile: path, - atomically: atomicFlag, - updateFilenames: updateFilenamesFlag - ] - } - pub unsafe fn addFileWithPath(&self, path: &NSString) -> Id { - msg_send_id![self, addFileWithPath: path] - } + ) -> bool; + # [method_id (addFileWithPath :)] + pub unsafe fn addFileWithPath(&self, path: &NSString) -> Id; + # [method_id (addSymbolicLinkWithDestination : preferredFilename :)] pub unsafe fn addSymbolicLinkWithDestination_preferredFilename( &self, path: &NSString, filename: &NSString, - ) -> Id { - msg_send_id![ - self, - addSymbolicLinkWithDestination: path, - preferredFilename: filename - ] - } - pub unsafe fn symbolicLinkDestination(&self) -> Id { - msg_send_id![self, symbolicLinkDestination] - } + ) -> Id; + #[method_id(symbolicLinkDestination)] + pub unsafe fn symbolicLinkDestination(&self) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSFormatter.rs b/icrate/src/Foundation/generated/NSFormatter.rs index 44215812a..b01e49750 100644 --- a/icrate/src/Foundation/generated/NSFormatter.rs +++ b/icrate/src/Foundation/generated/NSFormatter.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSRange::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSFormatter; @@ -17,55 +17,37 @@ extern_class!( ); extern_methods!( unsafe impl NSFormatter { + # [method_id (stringForObjectValue :)] pub unsafe fn stringForObjectValue( &self, obj: Option<&Object>, - ) -> Option> { - msg_send_id![self, stringForObjectValue: obj] - } + ) -> Option>; + # [method_id (attributedStringForObjectValue : withDefaultAttributes :)] pub unsafe fn attributedStringForObjectValue_withDefaultAttributes( &self, obj: &Object, attrs: Option<&NSDictionary>, - ) -> Option> { - msg_send_id![ - self, - attributedStringForObjectValue: obj, - withDefaultAttributes: attrs - ] - } + ) -> Option>; + # [method_id (editingStringForObjectValue :)] pub unsafe fn editingStringForObjectValue( &self, obj: &Object, - ) -> Option> { - msg_send_id![self, editingStringForObjectValue: obj] - } + ) -> Option>; + # [method (getObjectValue : forString : errorDescription :)] pub unsafe fn getObjectValue_forString_errorDescription( &self, obj: Option<&mut Option>>, string: &NSString, error: Option<&mut Option>>, - ) -> bool { - msg_send![ - self, - getObjectValue: obj, - forString: string, - errorDescription: error - ] - } + ) -> bool; + # [method (isPartialStringValid : newEditingString : errorDescription :)] pub unsafe fn isPartialStringValid_newEditingString_errorDescription( &self, partialString: &NSString, newString: Option<&mut Option>>, error: Option<&mut Option>>, - ) -> bool { - msg_send![ - self, - isPartialStringValid: partialString, - newEditingString: newString, - errorDescription: error - ] - } + ) -> bool; + # [method (isPartialStringValid : proposedSelectedRange : originalString : originalSelectedRange : errorDescription :)] pub unsafe fn isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription( &self, partialStringPtr: &mut Id, @@ -73,15 +55,6 @@ extern_methods!( origString: &NSString, origSelRange: NSRange, error: Option<&mut Option>>, - ) -> bool { - msg_send![ - self, - isPartialStringValid: partialStringPtr, - proposedSelectedRange: proposedSelRangePtr, - originalString: origString, - originalSelectedRange: origSelRange, - errorDescription: error - ] - } + ) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSGarbageCollector.rs b/icrate/src/Foundation/generated/NSGarbageCollector.rs index ff664530b..0c092f5b1 100644 --- a/icrate/src/Foundation/generated/NSGarbageCollector.rs +++ b/icrate/src/Foundation/generated/NSGarbageCollector.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSGarbageCollector; @@ -12,35 +12,25 @@ extern_class!( ); extern_methods!( unsafe impl NSGarbageCollector { - pub unsafe fn defaultCollector() -> Id { - msg_send_id![Self::class(), defaultCollector] - } - pub unsafe fn isCollecting(&self) -> bool { - msg_send![self, isCollecting] - } - pub unsafe fn disable(&self) { - msg_send![self, disable] - } - pub unsafe fn enable(&self) { - msg_send![self, enable] - } - pub unsafe fn isEnabled(&self) -> bool { - msg_send![self, isEnabled] - } - pub unsafe fn collectIfNeeded(&self) { - msg_send![self, collectIfNeeded] - } - pub unsafe fn collectExhaustively(&self) { - msg_send![self, collectExhaustively] - } - pub unsafe fn disableCollectorForPointer(&self, ptr: NonNull) { - msg_send![self, disableCollectorForPointer: ptr] - } - pub unsafe fn enableCollectorForPointer(&self, ptr: NonNull) { - msg_send![self, enableCollectorForPointer: ptr] - } - pub unsafe fn zone(&self) -> NonNull { - msg_send![self, zone] - } + #[method_id(defaultCollector)] + pub unsafe fn defaultCollector() -> Id; + #[method(isCollecting)] + pub unsafe fn isCollecting(&self) -> bool; + #[method(disable)] + pub unsafe fn disable(&self); + #[method(enable)] + pub unsafe fn enable(&self); + #[method(isEnabled)] + pub unsafe fn isEnabled(&self) -> bool; + #[method(collectIfNeeded)] + pub unsafe fn collectIfNeeded(&self); + #[method(collectExhaustively)] + pub unsafe fn collectExhaustively(&self); + # [method (disableCollectorForPointer :)] + pub unsafe fn disableCollectorForPointer(&self, ptr: NonNull); + # [method (enableCollectorForPointer :)] + pub unsafe fn enableCollectorForPointer(&self, ptr: NonNull); + #[method(zone)] + pub unsafe fn zone(&self) -> NonNull; } ); diff --git a/icrate/src/Foundation/generated/NSGeometry.rs b/icrate/src/Foundation/generated/NSGeometry.rs index 2d77b74ad..7c8b1515e 100644 --- a/icrate/src/Foundation/generated/NSGeometry.rs +++ b/icrate/src/Foundation/generated/NSGeometry.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSValue::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSPoint = CGPoint; pub type NSSize = CGSize; pub type NSRect = CGRect; @@ -13,75 +13,55 @@ use super::__exported::NSString; extern_methods!( #[doc = "NSValueGeometryExtensions"] unsafe impl NSValue { - pub unsafe fn valueWithPoint(point: NSPoint) -> Id { - msg_send_id![Self::class(), valueWithPoint: point] - } - pub unsafe fn valueWithSize(size: NSSize) -> Id { - msg_send_id![Self::class(), valueWithSize: size] - } - pub unsafe fn valueWithRect(rect: NSRect) -> Id { - msg_send_id![Self::class(), valueWithRect: rect] - } - pub unsafe fn valueWithEdgeInsets(insets: NSEdgeInsets) -> Id { - msg_send_id![Self::class(), valueWithEdgeInsets: insets] - } - pub unsafe fn pointValue(&self) -> NSPoint { - msg_send![self, pointValue] - } - pub unsafe fn sizeValue(&self) -> NSSize { - msg_send![self, sizeValue] - } - pub unsafe fn rectValue(&self) -> NSRect { - msg_send![self, rectValue] - } - pub unsafe fn edgeInsetsValue(&self) -> NSEdgeInsets { - msg_send![self, edgeInsetsValue] - } + # [method_id (valueWithPoint :)] + pub unsafe fn valueWithPoint(point: NSPoint) -> Id; + # [method_id (valueWithSize :)] + pub unsafe fn valueWithSize(size: NSSize) -> Id; + # [method_id (valueWithRect :)] + pub unsafe fn valueWithRect(rect: NSRect) -> Id; + # [method_id (valueWithEdgeInsets :)] + pub unsafe fn valueWithEdgeInsets(insets: NSEdgeInsets) -> Id; + #[method(pointValue)] + pub unsafe fn pointValue(&self) -> NSPoint; + #[method(sizeValue)] + pub unsafe fn sizeValue(&self) -> NSSize; + #[method(rectValue)] + pub unsafe fn rectValue(&self) -> NSRect; + #[method(edgeInsetsValue)] + pub unsafe fn edgeInsetsValue(&self) -> NSEdgeInsets; } ); extern_methods!( #[doc = "NSGeometryCoding"] unsafe impl NSCoder { - pub unsafe fn encodePoint(&self, point: NSPoint) { - msg_send![self, encodePoint: point] - } - pub unsafe fn decodePoint(&self) -> NSPoint { - msg_send![self, decodePoint] - } - pub unsafe fn encodeSize(&self, size: NSSize) { - msg_send![self, encodeSize: size] - } - pub unsafe fn decodeSize(&self) -> NSSize { - msg_send![self, decodeSize] - } - pub unsafe fn encodeRect(&self, rect: NSRect) { - msg_send![self, encodeRect: rect] - } - pub unsafe fn decodeRect(&self) -> NSRect { - msg_send![self, decodeRect] - } + # [method (encodePoint :)] + pub unsafe fn encodePoint(&self, point: NSPoint); + #[method(decodePoint)] + pub unsafe fn decodePoint(&self) -> NSPoint; + # [method (encodeSize :)] + pub unsafe fn encodeSize(&self, size: NSSize); + #[method(decodeSize)] + pub unsafe fn decodeSize(&self) -> NSSize; + # [method (encodeRect :)] + pub unsafe fn encodeRect(&self, rect: NSRect); + #[method(decodeRect)] + pub unsafe fn decodeRect(&self) -> NSRect; } ); extern_methods!( #[doc = "NSGeometryKeyedCoding"] unsafe impl NSCoder { - pub unsafe fn encodePoint_forKey(&self, point: NSPoint, key: &NSString) { - msg_send![self, encodePoint: point, forKey: key] - } - pub unsafe fn encodeSize_forKey(&self, size: NSSize, key: &NSString) { - msg_send![self, encodeSize: size, forKey: key] - } - pub unsafe fn encodeRect_forKey(&self, rect: NSRect, key: &NSString) { - msg_send![self, encodeRect: rect, forKey: key] - } - pub unsafe fn decodePointForKey(&self, key: &NSString) -> NSPoint { - msg_send![self, decodePointForKey: key] - } - pub unsafe fn decodeSizeForKey(&self, key: &NSString) -> NSSize { - msg_send![self, decodeSizeForKey: key] - } - pub unsafe fn decodeRectForKey(&self, key: &NSString) -> NSRect { - msg_send![self, decodeRectForKey: key] - } + # [method (encodePoint : forKey :)] + pub unsafe fn encodePoint_forKey(&self, point: NSPoint, key: &NSString); + # [method (encodeSize : forKey :)] + pub unsafe fn encodeSize_forKey(&self, size: NSSize, key: &NSString); + # [method (encodeRect : forKey :)] + pub unsafe fn encodeRect_forKey(&self, rect: NSRect, key: &NSString); + # [method (decodePointForKey :)] + pub unsafe fn decodePointForKey(&self, key: &NSString) -> NSPoint; + # [method (decodeSizeForKey :)] + pub unsafe fn decodeSizeForKey(&self, key: &NSString) -> NSSize; + # [method (decodeRectForKey :)] + pub unsafe fn decodeRectForKey(&self, key: &NSString) -> NSRect; } ); diff --git a/icrate/src/Foundation/generated/NSHFSFileTypes.rs b/icrate/src/Foundation/generated/NSHFSFileTypes.rs index 3df022269..d7522e9d6 100644 --- a/icrate/src/Foundation/generated/NSHFSFileTypes.rs +++ b/icrate/src/Foundation/generated/NSHFSFileTypes.rs @@ -4,4 +4,4 @@ use crate::Foundation::generated::NSObjCRuntime::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; diff --git a/icrate/src/Foundation/generated/NSHTTPCookie.rs b/icrate/src/Foundation/generated/NSHTTPCookie.rs index 859f2fae5..b9a136118 100644 --- a/icrate/src/Foundation/generated/NSHTTPCookie.rs +++ b/icrate/src/Foundation/generated/NSHTTPCookie.rs @@ -8,7 +8,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSHTTPCookiePropertyKey = NSString; pub type NSHTTPCookieStringPolicy = NSString; use super::__exported::NSHTTPCookieInternal; @@ -21,75 +21,53 @@ extern_class!( ); extern_methods!( unsafe impl NSHTTPCookie { + # [method_id (initWithProperties :)] pub unsafe fn initWithProperties( &self, properties: &NSDictionary, - ) -> Option> { - msg_send_id![self, initWithProperties: properties] - } + ) -> Option>; + # [method_id (cookieWithProperties :)] pub unsafe fn cookieWithProperties( properties: &NSDictionary, - ) -> Option> { - msg_send_id![Self::class(), cookieWithProperties: properties] - } + ) -> Option>; + # [method_id (requestHeaderFieldsWithCookies :)] pub unsafe fn requestHeaderFieldsWithCookies( cookies: &NSArray, - ) -> Id, Shared> { - msg_send_id![Self::class(), requestHeaderFieldsWithCookies: cookies] - } + ) -> Id, Shared>; + # [method_id (cookiesWithResponseHeaderFields : forURL :)] pub unsafe fn cookiesWithResponseHeaderFields_forURL( headerFields: &NSDictionary, URL: &NSURL, - ) -> Id, Shared> { - msg_send_id![ - Self::class(), - cookiesWithResponseHeaderFields: headerFields, - forURL: URL - ] - } + ) -> Id, Shared>; + #[method_id(properties)] pub unsafe fn properties( &self, - ) -> Option, Shared>> { - msg_send_id![self, properties] - } - pub unsafe fn version(&self) -> NSUInteger { - msg_send![self, version] - } - pub unsafe fn name(&self) -> Id { - msg_send_id![self, name] - } - pub unsafe fn value(&self) -> Id { - msg_send_id![self, value] - } - pub unsafe fn expiresDate(&self) -> Option> { - msg_send_id![self, expiresDate] - } - pub unsafe fn isSessionOnly(&self) -> bool { - msg_send![self, isSessionOnly] - } - pub unsafe fn domain(&self) -> Id { - msg_send_id![self, domain] - } - pub unsafe fn path(&self) -> Id { - msg_send_id![self, path] - } - pub unsafe fn isSecure(&self) -> bool { - msg_send![self, isSecure] - } - pub unsafe fn isHTTPOnly(&self) -> bool { - msg_send![self, isHTTPOnly] - } - pub unsafe fn comment(&self) -> Option> { - msg_send_id![self, comment] - } - pub unsafe fn commentURL(&self) -> Option> { - msg_send_id![self, commentURL] - } - pub unsafe fn portList(&self) -> Option, Shared>> { - msg_send_id![self, portList] - } - pub unsafe fn sameSitePolicy(&self) -> Option> { - msg_send_id![self, sameSitePolicy] - } + ) -> Option, Shared>>; + #[method(version)] + pub unsafe fn version(&self) -> NSUInteger; + #[method_id(name)] + pub unsafe fn name(&self) -> Id; + #[method_id(value)] + pub unsafe fn value(&self) -> Id; + #[method_id(expiresDate)] + pub unsafe fn expiresDate(&self) -> Option>; + #[method(isSessionOnly)] + pub unsafe fn isSessionOnly(&self) -> bool; + #[method_id(domain)] + pub unsafe fn domain(&self) -> Id; + #[method_id(path)] + pub unsafe fn path(&self) -> Id; + #[method(isSecure)] + pub unsafe fn isSecure(&self) -> bool; + #[method(isHTTPOnly)] + pub unsafe fn isHTTPOnly(&self) -> bool; + #[method_id(comment)] + pub unsafe fn comment(&self) -> Option>; + #[method_id(commentURL)] + pub unsafe fn commentURL(&self) -> Option>; + #[method_id(portList)] + pub unsafe fn portList(&self) -> Option, Shared>>; + #[method_id(sameSitePolicy)] + pub unsafe fn sameSitePolicy(&self) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSHTTPCookieStorage.rs b/icrate/src/Foundation/generated/NSHTTPCookieStorage.rs index 0b41795e1..aea6e31dd 100644 --- a/icrate/src/Foundation/generated/NSHTTPCookieStorage.rs +++ b/icrate/src/Foundation/generated/NSHTTPCookieStorage.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSHTTPCookieStorage; @@ -20,82 +20,57 @@ extern_class!( ); extern_methods!( unsafe impl NSHTTPCookieStorage { - pub unsafe fn sharedHTTPCookieStorage() -> Id { - msg_send_id![Self::class(), sharedHTTPCookieStorage] - } + #[method_id(sharedHTTPCookieStorage)] + pub unsafe fn sharedHTTPCookieStorage() -> Id; + # [method_id (sharedCookieStorageForGroupContainerIdentifier :)] pub unsafe fn sharedCookieStorageForGroupContainerIdentifier( identifier: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - sharedCookieStorageForGroupContainerIdentifier: identifier - ] - } - pub unsafe fn cookies(&self) -> Option, Shared>> { - msg_send_id![self, cookies] - } - pub unsafe fn setCookie(&self, cookie: &NSHTTPCookie) { - msg_send![self, setCookie: cookie] - } - pub unsafe fn deleteCookie(&self, cookie: &NSHTTPCookie) { - msg_send![self, deleteCookie: cookie] - } - pub unsafe fn removeCookiesSinceDate(&self, date: &NSDate) { - msg_send![self, removeCookiesSinceDate: date] - } + ) -> Id; + #[method_id(cookies)] + pub unsafe fn cookies(&self) -> Option, Shared>>; + # [method (setCookie :)] + pub unsafe fn setCookie(&self, cookie: &NSHTTPCookie); + # [method (deleteCookie :)] + pub unsafe fn deleteCookie(&self, cookie: &NSHTTPCookie); + # [method (removeCookiesSinceDate :)] + pub unsafe fn removeCookiesSinceDate(&self, date: &NSDate); + # [method_id (cookiesForURL :)] pub unsafe fn cookiesForURL( &self, URL: &NSURL, - ) -> Option, Shared>> { - msg_send_id![self, cookiesForURL: URL] - } + ) -> Option, Shared>>; + # [method (setCookies : forURL : mainDocumentURL :)] pub unsafe fn setCookies_forURL_mainDocumentURL( &self, cookies: &NSArray, URL: Option<&NSURL>, mainDocumentURL: Option<&NSURL>, - ) { - msg_send![ - self, - setCookies: cookies, - forURL: URL, - mainDocumentURL: mainDocumentURL - ] - } - pub unsafe fn cookieAcceptPolicy(&self) -> NSHTTPCookieAcceptPolicy { - msg_send![self, cookieAcceptPolicy] - } - pub unsafe fn setCookieAcceptPolicy(&self, cookieAcceptPolicy: NSHTTPCookieAcceptPolicy) { - msg_send![self, setCookieAcceptPolicy: cookieAcceptPolicy] - } + ); + #[method(cookieAcceptPolicy)] + pub unsafe fn cookieAcceptPolicy(&self) -> NSHTTPCookieAcceptPolicy; + # [method (setCookieAcceptPolicy :)] + pub unsafe fn setCookieAcceptPolicy(&self, cookieAcceptPolicy: NSHTTPCookieAcceptPolicy); + # [method_id (sortedCookiesUsingDescriptors :)] pub unsafe fn sortedCookiesUsingDescriptors( &self, sortOrder: &NSArray, - ) -> Id, Shared> { - msg_send_id![self, sortedCookiesUsingDescriptors: sortOrder] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSURLSessionTaskAdditions"] unsafe impl NSHTTPCookieStorage { + # [method (storeCookies : forTask :)] pub unsafe fn storeCookies_forTask( &self, cookies: &NSArray, task: &NSURLSessionTask, - ) { - msg_send![self, storeCookies: cookies, forTask: task] - } + ); + # [method (getCookiesForTask : completionHandler :)] pub unsafe fn getCookiesForTask_completionHandler( &self, task: &NSURLSessionTask, completionHandler: TodoBlock, - ) { - msg_send![ - self, - getCookiesForTask: task, - completionHandler: completionHandler - ] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSHashTable.rs b/icrate/src/Foundation/generated/NSHashTable.rs index ecbeaf0d9..9125844e0 100644 --- a/icrate/src/Foundation/generated/NSHashTable.rs +++ b/icrate/src/Foundation/generated/NSHashTable.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSString::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSHashTableOptions = NSUInteger; __inner_extern_class!( #[derive(Debug)] @@ -17,85 +17,59 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSHashTable { + # [method_id (initWithOptions : capacity :)] pub unsafe fn initWithOptions_capacity( &self, options: NSPointerFunctionsOptions, initialCapacity: NSUInteger, - ) -> Id { - msg_send_id![self, initWithOptions: options, capacity: initialCapacity] - } + ) -> Id; + # [method_id (initWithPointerFunctions : capacity :)] pub unsafe fn initWithPointerFunctions_capacity( &self, functions: &NSPointerFunctions, initialCapacity: NSUInteger, - ) -> Id { - msg_send_id![ - self, - initWithPointerFunctions: functions, - capacity: initialCapacity - ] - } + ) -> Id; + # [method_id (hashTableWithOptions :)] pub unsafe fn hashTableWithOptions( options: NSPointerFunctionsOptions, - ) -> Id, Shared> { - msg_send_id![Self::class(), hashTableWithOptions: options] - } - pub unsafe fn hashTableWithWeakObjects() -> Id { - msg_send_id![Self::class(), hashTableWithWeakObjects] - } - pub unsafe fn weakObjectsHashTable() -> Id, Shared> { - msg_send_id![Self::class(), weakObjectsHashTable] - } - pub unsafe fn pointerFunctions(&self) -> Id { - msg_send_id![self, pointerFunctions] - } - pub unsafe fn count(&self) -> NSUInteger { - msg_send![self, count] - } - pub unsafe fn member(&self, object: Option<&ObjectType>) -> Option> { - msg_send_id![self, member: object] - } - pub unsafe fn objectEnumerator(&self) -> Id, Shared> { - msg_send_id![self, objectEnumerator] - } - pub unsafe fn addObject(&self, object: Option<&ObjectType>) { - msg_send![self, addObject: object] - } - pub unsafe fn removeObject(&self, object: Option<&ObjectType>) { - msg_send![self, removeObject: object] - } - pub unsafe fn removeAllObjects(&self) { - msg_send![self, removeAllObjects] - } - pub unsafe fn allObjects(&self) -> Id, Shared> { - msg_send_id![self, allObjects] - } - pub unsafe fn anyObject(&self) -> Option> { - msg_send_id![self, anyObject] - } - pub unsafe fn containsObject(&self, anObject: Option<&ObjectType>) -> bool { - msg_send![self, containsObject: anObject] - } - pub unsafe fn intersectsHashTable(&self, other: &NSHashTable) -> bool { - msg_send![self, intersectsHashTable: other] - } - pub unsafe fn isEqualToHashTable(&self, other: &NSHashTable) -> bool { - msg_send![self, isEqualToHashTable: other] - } - pub unsafe fn isSubsetOfHashTable(&self, other: &NSHashTable) -> bool { - msg_send![self, isSubsetOfHashTable: other] - } - pub unsafe fn intersectHashTable(&self, other: &NSHashTable) { - msg_send![self, intersectHashTable: other] - } - pub unsafe fn unionHashTable(&self, other: &NSHashTable) { - msg_send![self, unionHashTable: other] - } - pub unsafe fn minusHashTable(&self, other: &NSHashTable) { - msg_send![self, minusHashTable: other] - } - pub unsafe fn setRepresentation(&self) -> Id, Shared> { - msg_send_id![self, setRepresentation] - } + ) -> Id, Shared>; + #[method_id(hashTableWithWeakObjects)] + pub unsafe fn hashTableWithWeakObjects() -> Id; + #[method_id(weakObjectsHashTable)] + pub unsafe fn weakObjectsHashTable() -> Id, Shared>; + #[method_id(pointerFunctions)] + pub unsafe fn pointerFunctions(&self) -> Id; + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + # [method_id (member :)] + pub unsafe fn member(&self, object: Option<&ObjectType>) -> Option>; + #[method_id(objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + # [method (addObject :)] + pub unsafe fn addObject(&self, object: Option<&ObjectType>); + # [method (removeObject :)] + pub unsafe fn removeObject(&self, object: Option<&ObjectType>); + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + #[method_id(allObjects)] + pub unsafe fn allObjects(&self) -> Id, Shared>; + #[method_id(anyObject)] + pub unsafe fn anyObject(&self) -> Option>; + # [method (containsObject :)] + pub unsafe fn containsObject(&self, anObject: Option<&ObjectType>) -> bool; + # [method (intersectsHashTable :)] + pub unsafe fn intersectsHashTable(&self, other: &NSHashTable) -> bool; + # [method (isEqualToHashTable :)] + pub unsafe fn isEqualToHashTable(&self, other: &NSHashTable) -> bool; + # [method (isSubsetOfHashTable :)] + pub unsafe fn isSubsetOfHashTable(&self, other: &NSHashTable) -> bool; + # [method (intersectHashTable :)] + pub unsafe fn intersectHashTable(&self, other: &NSHashTable); + # [method (unionHashTable :)] + pub unsafe fn unionHashTable(&self, other: &NSHashTable); + # [method (minusHashTable :)] + pub unsafe fn minusHashTable(&self, other: &NSHashTable); + #[method_id(setRepresentation)] + pub unsafe fn setRepresentation(&self) -> Id, Shared>; } ); diff --git a/icrate/src/Foundation/generated/NSHost.rs b/icrate/src/Foundation/generated/NSHost.rs index 6a6b74fe0..2403d90eb 100644 --- a/icrate/src/Foundation/generated/NSHost.rs +++ b/icrate/src/Foundation/generated/NSHost.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSHost; @@ -15,41 +15,29 @@ extern_class!( ); extern_methods!( unsafe impl NSHost { - pub unsafe fn currentHost() -> Id { - msg_send_id![Self::class(), currentHost] - } - pub unsafe fn hostWithName(name: Option<&NSString>) -> Id { - msg_send_id![Self::class(), hostWithName: name] - } - pub unsafe fn hostWithAddress(address: &NSString) -> Id { - msg_send_id![Self::class(), hostWithAddress: address] - } - pub unsafe fn isEqualToHost(&self, aHost: &NSHost) -> bool { - msg_send![self, isEqualToHost: aHost] - } - pub unsafe fn name(&self) -> Option> { - msg_send_id![self, name] - } - pub unsafe fn names(&self) -> Id, Shared> { - msg_send_id![self, names] - } - pub unsafe fn address(&self) -> Option> { - msg_send_id![self, address] - } - pub unsafe fn addresses(&self) -> Id, Shared> { - msg_send_id![self, addresses] - } - pub unsafe fn localizedName(&self) -> Option> { - msg_send_id![self, localizedName] - } - pub unsafe fn setHostCacheEnabled(flag: bool) { - msg_send![Self::class(), setHostCacheEnabled: flag] - } - pub unsafe fn isHostCacheEnabled() -> bool { - msg_send![Self::class(), isHostCacheEnabled] - } - pub unsafe fn flushHostCache() { - msg_send![Self::class(), flushHostCache] - } + #[method_id(currentHost)] + pub unsafe fn currentHost() -> Id; + # [method_id (hostWithName :)] + pub unsafe fn hostWithName(name: Option<&NSString>) -> Id; + # [method_id (hostWithAddress :)] + pub unsafe fn hostWithAddress(address: &NSString) -> Id; + # [method (isEqualToHost :)] + pub unsafe fn isEqualToHost(&self, aHost: &NSHost) -> bool; + #[method_id(name)] + pub unsafe fn name(&self) -> Option>; + #[method_id(names)] + pub unsafe fn names(&self) -> Id, Shared>; + #[method_id(address)] + pub unsafe fn address(&self) -> Option>; + #[method_id(addresses)] + pub unsafe fn addresses(&self) -> Id, Shared>; + #[method_id(localizedName)] + pub unsafe fn localizedName(&self) -> Option>; + # [method (setHostCacheEnabled :)] + pub unsafe fn setHostCacheEnabled(flag: bool); + #[method(isHostCacheEnabled)] + pub unsafe fn isHostCacheEnabled() -> bool; + #[method(flushHostCache)] + pub unsafe fn flushHostCache(); } ); diff --git a/icrate/src/Foundation/generated/NSISO8601DateFormatter.rs b/icrate/src/Foundation/generated/NSISO8601DateFormatter.rs index cb65c83d2..d201dd830 100644 --- a/icrate/src/Foundation/generated/NSISO8601DateFormatter.rs +++ b/icrate/src/Foundation/generated/NSISO8601DateFormatter.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSFormatter::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSISO8601DateFormatter; @@ -16,38 +16,25 @@ extern_class!( ); extern_methods!( unsafe impl NSISO8601DateFormatter { - pub unsafe fn timeZone(&self) -> Id { - msg_send_id![self, timeZone] - } - pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>) { - msg_send![self, setTimeZone: timeZone] - } - pub unsafe fn formatOptions(&self) -> NSISO8601DateFormatOptions { - msg_send![self, formatOptions] - } - pub unsafe fn setFormatOptions(&self, formatOptions: NSISO8601DateFormatOptions) { - msg_send![self, setFormatOptions: formatOptions] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn stringFromDate(&self, date: &NSDate) -> Id { - msg_send_id![self, stringFromDate: date] - } - pub unsafe fn dateFromString(&self, string: &NSString) -> Option> { - msg_send_id![self, dateFromString: string] - } + #[method_id(timeZone)] + pub unsafe fn timeZone(&self) -> Id; + # [method (setTimeZone :)] + pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>); + #[method(formatOptions)] + pub unsafe fn formatOptions(&self) -> NSISO8601DateFormatOptions; + # [method (setFormatOptions :)] + pub unsafe fn setFormatOptions(&self, formatOptions: NSISO8601DateFormatOptions); + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (stringFromDate :)] + pub unsafe fn stringFromDate(&self, date: &NSDate) -> Id; + # [method_id (dateFromString :)] + pub unsafe fn dateFromString(&self, string: &NSString) -> Option>; + # [method_id (stringFromDate : timeZone : formatOptions :)] pub unsafe fn stringFromDate_timeZone_formatOptions( date: &NSDate, timeZone: &NSTimeZone, formatOptions: NSISO8601DateFormatOptions, - ) -> Id { - msg_send_id![ - Self::class(), - stringFromDate: date, - timeZone: timeZone, - formatOptions: formatOptions - ] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSIndexPath.rs b/icrate/src/Foundation/generated/NSIndexPath.rs index 6335f4478..6a7aaa05c 100644 --- a/icrate/src/Foundation/generated/NSIndexPath.rs +++ b/icrate/src/Foundation/generated/NSIndexPath.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSRange::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSIndexPath; @@ -13,54 +13,39 @@ extern_class!( ); extern_methods!( unsafe impl NSIndexPath { - pub unsafe fn indexPathWithIndex(index: NSUInteger) -> Id { - msg_send_id![Self::class(), indexPathWithIndex: index] - } + # [method_id (indexPathWithIndex :)] + pub unsafe fn indexPathWithIndex(index: NSUInteger) -> Id; + # [method_id (indexPathWithIndexes : length :)] pub unsafe fn indexPathWithIndexes_length( indexes: TodoArray, length: NSUInteger, - ) -> Id { - msg_send_id![Self::class(), indexPathWithIndexes: indexes, length: length] - } + ) -> Id; + # [method_id (initWithIndexes : length :)] pub unsafe fn initWithIndexes_length( &self, indexes: TodoArray, length: NSUInteger, - ) -> Id { - msg_send_id![self, initWithIndexes: indexes, length: length] - } - pub unsafe fn initWithIndex(&self, index: NSUInteger) -> Id { - msg_send_id![self, initWithIndex: index] - } - pub unsafe fn indexPathByAddingIndex(&self, index: NSUInteger) -> Id { - msg_send_id![self, indexPathByAddingIndex: index] - } - pub unsafe fn indexPathByRemovingLastIndex(&self) -> Id { - msg_send_id![self, indexPathByRemovingLastIndex] - } - pub unsafe fn indexAtPosition(&self, position: NSUInteger) -> NSUInteger { - msg_send![self, indexAtPosition: position] - } - pub unsafe fn length(&self) -> NSUInteger { - msg_send![self, length] - } - pub unsafe fn getIndexes_range( - &self, - indexes: NonNull, - positionRange: NSRange, - ) { - msg_send![self, getIndexes: indexes, range: positionRange] - } - pub unsafe fn compare(&self, otherObject: &NSIndexPath) -> NSComparisonResult { - msg_send![self, compare: otherObject] - } + ) -> Id; + # [method_id (initWithIndex :)] + pub unsafe fn initWithIndex(&self, index: NSUInteger) -> Id; + # [method_id (indexPathByAddingIndex :)] + pub unsafe fn indexPathByAddingIndex(&self, index: NSUInteger) -> Id; + #[method_id(indexPathByRemovingLastIndex)] + pub unsafe fn indexPathByRemovingLastIndex(&self) -> Id; + # [method (indexAtPosition :)] + pub unsafe fn indexAtPosition(&self, position: NSUInteger) -> NSUInteger; + #[method(length)] + pub unsafe fn length(&self) -> NSUInteger; + # [method (getIndexes : range :)] + pub unsafe fn getIndexes_range(&self, indexes: NonNull, positionRange: NSRange); + # [method (compare :)] + pub unsafe fn compare(&self, otherObject: &NSIndexPath) -> NSComparisonResult; } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSIndexPath { - pub unsafe fn getIndexes(&self, indexes: NonNull) { - msg_send![self, getIndexes: indexes] - } + # [method (getIndexes :)] + pub unsafe fn getIndexes(&self, indexes: NonNull); } ); diff --git a/icrate/src/Foundation/generated/NSIndexSet.rs b/icrate/src/Foundation/generated/NSIndexSet.rs index fd4ab5675..9188d6eb7 100644 --- a/icrate/src/Foundation/generated/NSIndexSet.rs +++ b/icrate/src/Foundation/generated/NSIndexSet.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSRange::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSIndexSet; @@ -13,168 +13,111 @@ extern_class!( ); extern_methods!( unsafe impl NSIndexSet { - pub unsafe fn indexSet() -> Id { - msg_send_id![Self::class(), indexSet] - } - pub unsafe fn indexSetWithIndex(value: NSUInteger) -> Id { - msg_send_id![Self::class(), indexSetWithIndex: value] - } - pub unsafe fn indexSetWithIndexesInRange(range: NSRange) -> Id { - msg_send_id![Self::class(), indexSetWithIndexesInRange: range] - } - pub unsafe fn initWithIndexesInRange(&self, range: NSRange) -> Id { - msg_send_id![self, initWithIndexesInRange: range] - } - pub unsafe fn initWithIndexSet(&self, indexSet: &NSIndexSet) -> Id { - msg_send_id![self, initWithIndexSet: indexSet] - } - pub unsafe fn initWithIndex(&self, value: NSUInteger) -> Id { - msg_send_id![self, initWithIndex: value] - } - pub unsafe fn isEqualToIndexSet(&self, indexSet: &NSIndexSet) -> bool { - msg_send![self, isEqualToIndexSet: indexSet] - } - pub unsafe fn count(&self) -> NSUInteger { - msg_send![self, count] - } - pub unsafe fn firstIndex(&self) -> NSUInteger { - msg_send![self, firstIndex] - } - pub unsafe fn lastIndex(&self) -> NSUInteger { - msg_send![self, lastIndex] - } - pub unsafe fn indexGreaterThanIndex(&self, value: NSUInteger) -> NSUInteger { - msg_send![self, indexGreaterThanIndex: value] - } - pub unsafe fn indexLessThanIndex(&self, value: NSUInteger) -> NSUInteger { - msg_send![self, indexLessThanIndex: value] - } - pub unsafe fn indexGreaterThanOrEqualToIndex(&self, value: NSUInteger) -> NSUInteger { - msg_send![self, indexGreaterThanOrEqualToIndex: value] - } - pub unsafe fn indexLessThanOrEqualToIndex(&self, value: NSUInteger) -> NSUInteger { - msg_send![self, indexLessThanOrEqualToIndex: value] - } + #[method_id(indexSet)] + pub unsafe fn indexSet() -> Id; + # [method_id (indexSetWithIndex :)] + pub unsafe fn indexSetWithIndex(value: NSUInteger) -> Id; + # [method_id (indexSetWithIndexesInRange :)] + pub unsafe fn indexSetWithIndexesInRange(range: NSRange) -> Id; + # [method_id (initWithIndexesInRange :)] + pub unsafe fn initWithIndexesInRange(&self, range: NSRange) -> Id; + # [method_id (initWithIndexSet :)] + pub unsafe fn initWithIndexSet(&self, indexSet: &NSIndexSet) -> Id; + # [method_id (initWithIndex :)] + pub unsafe fn initWithIndex(&self, value: NSUInteger) -> Id; + # [method (isEqualToIndexSet :)] + pub unsafe fn isEqualToIndexSet(&self, indexSet: &NSIndexSet) -> bool; + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + #[method(firstIndex)] + pub unsafe fn firstIndex(&self) -> NSUInteger; + #[method(lastIndex)] + pub unsafe fn lastIndex(&self) -> NSUInteger; + # [method (indexGreaterThanIndex :)] + pub unsafe fn indexGreaterThanIndex(&self, value: NSUInteger) -> NSUInteger; + # [method (indexLessThanIndex :)] + pub unsafe fn indexLessThanIndex(&self, value: NSUInteger) -> NSUInteger; + # [method (indexGreaterThanOrEqualToIndex :)] + pub unsafe fn indexGreaterThanOrEqualToIndex(&self, value: NSUInteger) -> NSUInteger; + # [method (indexLessThanOrEqualToIndex :)] + pub unsafe fn indexLessThanOrEqualToIndex(&self, value: NSUInteger) -> NSUInteger; + # [method (getIndexes : maxCount : inIndexRange :)] pub unsafe fn getIndexes_maxCount_inIndexRange( &self, indexBuffer: NonNull, bufferSize: NSUInteger, range: NSRangePointer, - ) -> NSUInteger { - msg_send![ - self, - getIndexes: indexBuffer, - maxCount: bufferSize, - inIndexRange: range - ] - } - pub unsafe fn countOfIndexesInRange(&self, range: NSRange) -> NSUInteger { - msg_send![self, countOfIndexesInRange: range] - } - pub unsafe fn containsIndex(&self, value: NSUInteger) -> bool { - msg_send![self, containsIndex: value] - } - pub unsafe fn containsIndexesInRange(&self, range: NSRange) -> bool { - msg_send![self, containsIndexesInRange: range] - } - pub unsafe fn containsIndexes(&self, indexSet: &NSIndexSet) -> bool { - msg_send![self, containsIndexes: indexSet] - } - pub unsafe fn intersectsIndexesInRange(&self, range: NSRange) -> bool { - msg_send![self, intersectsIndexesInRange: range] - } - pub unsafe fn enumerateIndexesUsingBlock(&self, block: TodoBlock) { - msg_send![self, enumerateIndexesUsingBlock: block] - } + ) -> NSUInteger; + # [method (countOfIndexesInRange :)] + pub unsafe fn countOfIndexesInRange(&self, range: NSRange) -> NSUInteger; + # [method (containsIndex :)] + pub unsafe fn containsIndex(&self, value: NSUInteger) -> bool; + # [method (containsIndexesInRange :)] + pub unsafe fn containsIndexesInRange(&self, range: NSRange) -> bool; + # [method (containsIndexes :)] + pub unsafe fn containsIndexes(&self, indexSet: &NSIndexSet) -> bool; + # [method (intersectsIndexesInRange :)] + pub unsafe fn intersectsIndexesInRange(&self, range: NSRange) -> bool; + # [method (enumerateIndexesUsingBlock :)] + pub unsafe fn enumerateIndexesUsingBlock(&self, block: TodoBlock); + # [method (enumerateIndexesWithOptions : usingBlock :)] pub unsafe fn enumerateIndexesWithOptions_usingBlock( &self, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![self, enumerateIndexesWithOptions: opts, usingBlock: block] - } + ); + # [method (enumerateIndexesInRange : options : usingBlock :)] pub unsafe fn enumerateIndexesInRange_options_usingBlock( &self, range: NSRange, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateIndexesInRange: range, - options: opts, - usingBlock: block - ] - } - pub unsafe fn indexPassingTest(&self, predicate: TodoBlock) -> NSUInteger { - msg_send![self, indexPassingTest: predicate] - } + ); + # [method (indexPassingTest :)] + pub unsafe fn indexPassingTest(&self, predicate: TodoBlock) -> NSUInteger; + # [method (indexWithOptions : passingTest :)] pub unsafe fn indexWithOptions_passingTest( &self, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> NSUInteger { - msg_send![self, indexWithOptions: opts, passingTest: predicate] - } + ) -> NSUInteger; + # [method (indexInRange : options : passingTest :)] pub unsafe fn indexInRange_options_passingTest( &self, range: NSRange, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> NSUInteger { - msg_send![ - self, - indexInRange: range, - options: opts, - passingTest: predicate - ] - } - pub unsafe fn indexesPassingTest(&self, predicate: TodoBlock) -> Id { - msg_send_id![self, indexesPassingTest: predicate] - } + ) -> NSUInteger; + # [method_id (indexesPassingTest :)] + pub unsafe fn indexesPassingTest(&self, predicate: TodoBlock) -> Id; + # [method_id (indexesWithOptions : passingTest :)] pub unsafe fn indexesWithOptions_passingTest( &self, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> Id { - msg_send_id![self, indexesWithOptions: opts, passingTest: predicate] - } + ) -> Id; + # [method_id (indexesInRange : options : passingTest :)] pub unsafe fn indexesInRange_options_passingTest( &self, range: NSRange, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> Id { - msg_send_id![ - self, - indexesInRange: range, - options: opts, - passingTest: predicate - ] - } - pub unsafe fn enumerateRangesUsingBlock(&self, block: TodoBlock) { - msg_send![self, enumerateRangesUsingBlock: block] - } + ) -> Id; + # [method (enumerateRangesUsingBlock :)] + pub unsafe fn enumerateRangesUsingBlock(&self, block: TodoBlock); + # [method (enumerateRangesWithOptions : usingBlock :)] pub unsafe fn enumerateRangesWithOptions_usingBlock( &self, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![self, enumerateRangesWithOptions: opts, usingBlock: block] - } + ); + # [method (enumerateRangesInRange : options : usingBlock :)] pub unsafe fn enumerateRangesInRange_options_usingBlock( &self, range: NSRange, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateRangesInRange: range, - options: opts, - usingBlock: block - ] - } + ); } ); extern_class!( @@ -186,29 +129,21 @@ extern_class!( ); extern_methods!( unsafe impl NSMutableIndexSet { - pub unsafe fn addIndexes(&self, indexSet: &NSIndexSet) { - msg_send![self, addIndexes: indexSet] - } - pub unsafe fn removeIndexes(&self, indexSet: &NSIndexSet) { - msg_send![self, removeIndexes: indexSet] - } - pub unsafe fn removeAllIndexes(&self) { - msg_send![self, removeAllIndexes] - } - pub unsafe fn addIndex(&self, value: NSUInteger) { - msg_send![self, addIndex: value] - } - pub unsafe fn removeIndex(&self, value: NSUInteger) { - msg_send![self, removeIndex: value] - } - pub unsafe fn addIndexesInRange(&self, range: NSRange) { - msg_send![self, addIndexesInRange: range] - } - pub unsafe fn removeIndexesInRange(&self, range: NSRange) { - msg_send![self, removeIndexesInRange: range] - } - pub unsafe fn shiftIndexesStartingAtIndex_by(&self, index: NSUInteger, delta: NSInteger) { - msg_send![self, shiftIndexesStartingAtIndex: index, by: delta] - } + # [method (addIndexes :)] + pub unsafe fn addIndexes(&self, indexSet: &NSIndexSet); + # [method (removeIndexes :)] + pub unsafe fn removeIndexes(&self, indexSet: &NSIndexSet); + #[method(removeAllIndexes)] + pub unsafe fn removeAllIndexes(&self); + # [method (addIndex :)] + pub unsafe fn addIndex(&self, value: NSUInteger); + # [method (removeIndex :)] + pub unsafe fn removeIndex(&self, value: NSUInteger); + # [method (addIndexesInRange :)] + pub unsafe fn addIndexesInRange(&self, range: NSRange); + # [method (removeIndexesInRange :)] + pub unsafe fn removeIndexesInRange(&self, range: NSRange); + # [method (shiftIndexesStartingAtIndex : by :)] + pub unsafe fn shiftIndexesStartingAtIndex_by(&self, index: NSUInteger, delta: NSInteger); } ); diff --git a/icrate/src/Foundation/generated/NSInflectionRule.rs b/icrate/src/Foundation/generated/NSInflectionRule.rs index 794f16a5a..5c205de5a 100644 --- a/icrate/src/Foundation/generated/NSInflectionRule.rs +++ b/icrate/src/Foundation/generated/NSInflectionRule.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSInflectionRule; @@ -13,12 +13,10 @@ extern_class!( ); extern_methods!( unsafe impl NSInflectionRule { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn automaticRule() -> Id { - msg_send_id![Self::class(), automaticRule] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(automaticRule)] + pub unsafe fn automaticRule() -> Id; } ); extern_class!( @@ -30,22 +28,18 @@ extern_class!( ); extern_methods!( unsafe impl NSInflectionRuleExplicit { - pub unsafe fn initWithMorphology(&self, morphology: &NSMorphology) -> Id { - msg_send_id![self, initWithMorphology: morphology] - } - pub unsafe fn morphology(&self) -> Id { - msg_send_id![self, morphology] - } + # [method_id (initWithMorphology :)] + pub unsafe fn initWithMorphology(&self, morphology: &NSMorphology) -> Id; + #[method_id(morphology)] + pub unsafe fn morphology(&self) -> Id; } ); extern_methods!( #[doc = "NSInflectionAvailability"] unsafe impl NSInflectionRule { - pub unsafe fn canInflectLanguage(language: &NSString) -> bool { - msg_send![Self::class(), canInflectLanguage: language] - } - pub unsafe fn canInflectPreferredLocalization() -> bool { - msg_send![Self::class(), canInflectPreferredLocalization] - } + # [method (canInflectLanguage :)] + pub unsafe fn canInflectLanguage(language: &NSString) -> bool; + #[method(canInflectPreferredLocalization)] + pub unsafe fn canInflectPreferredLocalization() -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSInvocation.rs b/icrate/src/Foundation/generated/NSInvocation.rs index 53c9c075d..60c30d123 100644 --- a/icrate/src/Foundation/generated/NSInvocation.rs +++ b/icrate/src/Foundation/generated/NSInvocation.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSInvocation; @@ -13,57 +13,35 @@ extern_class!( ); extern_methods!( unsafe impl NSInvocation { + # [method_id (invocationWithMethodSignature :)] pub unsafe fn invocationWithMethodSignature( sig: &NSMethodSignature, - ) -> Id { - msg_send_id![Self::class(), invocationWithMethodSignature: sig] - } - pub unsafe fn methodSignature(&self) -> Id { - msg_send_id![self, methodSignature] - } - pub unsafe fn retainArguments(&self) { - msg_send![self, retainArguments] - } - pub unsafe fn argumentsRetained(&self) -> bool { - msg_send![self, argumentsRetained] - } - pub unsafe fn target(&self) -> Option> { - msg_send_id![self, target] - } - pub unsafe fn setTarget(&self, target: Option<&Object>) { - msg_send![self, setTarget: target] - } - pub unsafe fn selector(&self) -> Sel { - msg_send![self, selector] - } - pub unsafe fn setSelector(&self, selector: Sel) { - msg_send![self, setSelector: selector] - } - pub unsafe fn getReturnValue(&self, retLoc: NonNull) { - msg_send![self, getReturnValue: retLoc] - } - pub unsafe fn setReturnValue(&self, retLoc: NonNull) { - msg_send![self, setReturnValue: retLoc] - } - pub unsafe fn getArgument_atIndex( - &self, - argumentLocation: NonNull, - idx: NSInteger, - ) { - msg_send![self, getArgument: argumentLocation, atIndex: idx] - } - pub unsafe fn setArgument_atIndex( - &self, - argumentLocation: NonNull, - idx: NSInteger, - ) { - msg_send![self, setArgument: argumentLocation, atIndex: idx] - } - pub unsafe fn invoke(&self) { - msg_send![self, invoke] - } - pub unsafe fn invokeWithTarget(&self, target: &Object) { - msg_send![self, invokeWithTarget: target] - } + ) -> Id; + #[method_id(methodSignature)] + pub unsafe fn methodSignature(&self) -> Id; + #[method(retainArguments)] + pub unsafe fn retainArguments(&self); + #[method(argumentsRetained)] + pub unsafe fn argumentsRetained(&self) -> bool; + #[method_id(target)] + pub unsafe fn target(&self) -> Option>; + # [method (setTarget :)] + pub unsafe fn setTarget(&self, target: Option<&Object>); + #[method(selector)] + pub unsafe fn selector(&self) -> Sel; + # [method (setSelector :)] + pub unsafe fn setSelector(&self, selector: Sel); + # [method (getReturnValue :)] + pub unsafe fn getReturnValue(&self, retLoc: NonNull); + # [method (setReturnValue :)] + pub unsafe fn setReturnValue(&self, retLoc: NonNull); + # [method (getArgument : atIndex :)] + pub unsafe fn getArgument_atIndex(&self, argumentLocation: NonNull, idx: NSInteger); + # [method (setArgument : atIndex :)] + pub unsafe fn setArgument_atIndex(&self, argumentLocation: NonNull, idx: NSInteger); + #[method(invoke)] + pub unsafe fn invoke(&self); + # [method (invokeWithTarget :)] + pub unsafe fn invokeWithTarget(&self, target: &Object); } ); diff --git a/icrate/src/Foundation/generated/NSItemProvider.rs b/icrate/src/Foundation/generated/NSItemProvider.rs index b58ee214b..9e9a454b9 100644 --- a/icrate/src/Foundation/generated/NSItemProvider.rs +++ b/icrate/src/Foundation/generated/NSItemProvider.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSArray::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSItemProviderWriting = NSObject; pub type NSItemProviderReading = NSObject; extern_class!( @@ -15,170 +15,106 @@ extern_class!( ); extern_methods!( unsafe impl NSItemProvider { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method (registerDataRepresentationForTypeIdentifier : visibility : loadHandler :)] pub unsafe fn registerDataRepresentationForTypeIdentifier_visibility_loadHandler( &self, typeIdentifier: &NSString, visibility: NSItemProviderRepresentationVisibility, loadHandler: TodoBlock, - ) { - msg_send![ - self, - registerDataRepresentationForTypeIdentifier: typeIdentifier, - visibility: visibility, - loadHandler: loadHandler - ] - } + ); + # [method (registerFileRepresentationForTypeIdentifier : fileOptions : visibility : loadHandler :)] pub unsafe fn registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler( &self, typeIdentifier: &NSString, fileOptions: NSItemProviderFileOptions, visibility: NSItemProviderRepresentationVisibility, loadHandler: TodoBlock, - ) { - msg_send![ - self, - registerFileRepresentationForTypeIdentifier: typeIdentifier, - fileOptions: fileOptions, - visibility: visibility, - loadHandler: loadHandler - ] - } - pub unsafe fn registeredTypeIdentifiers(&self) -> Id, Shared> { - msg_send_id![self, registeredTypeIdentifiers] - } + ); + #[method_id(registeredTypeIdentifiers)] + pub unsafe fn registeredTypeIdentifiers(&self) -> Id, Shared>; + # [method_id (registeredTypeIdentifiersWithFileOptions :)] pub unsafe fn registeredTypeIdentifiersWithFileOptions( &self, fileOptions: NSItemProviderFileOptions, - ) -> Id, Shared> { - msg_send_id![self, registeredTypeIdentifiersWithFileOptions: fileOptions] - } - pub unsafe fn hasItemConformingToTypeIdentifier(&self, typeIdentifier: &NSString) -> bool { - msg_send![self, hasItemConformingToTypeIdentifier: typeIdentifier] - } + ) -> Id, Shared>; + # [method (hasItemConformingToTypeIdentifier :)] + pub unsafe fn hasItemConformingToTypeIdentifier(&self, typeIdentifier: &NSString) -> bool; + # [method (hasRepresentationConformingToTypeIdentifier : fileOptions :)] pub unsafe fn hasRepresentationConformingToTypeIdentifier_fileOptions( &self, typeIdentifier: &NSString, fileOptions: NSItemProviderFileOptions, - ) -> bool { - msg_send![ - self, - hasRepresentationConformingToTypeIdentifier: typeIdentifier, - fileOptions: fileOptions - ] - } + ) -> bool; + # [method_id (loadDataRepresentationForTypeIdentifier : completionHandler :)] pub unsafe fn loadDataRepresentationForTypeIdentifier_completionHandler( &self, typeIdentifier: &NSString, completionHandler: TodoBlock, - ) -> Id { - msg_send_id![ - self, - loadDataRepresentationForTypeIdentifier: typeIdentifier, - completionHandler: completionHandler - ] - } + ) -> Id; + # [method_id (loadFileRepresentationForTypeIdentifier : completionHandler :)] pub unsafe fn loadFileRepresentationForTypeIdentifier_completionHandler( &self, typeIdentifier: &NSString, completionHandler: TodoBlock, - ) -> Id { - msg_send_id![ - self, - loadFileRepresentationForTypeIdentifier: typeIdentifier, - completionHandler: completionHandler - ] - } + ) -> Id; + # [method_id (loadInPlaceFileRepresentationForTypeIdentifier : completionHandler :)] pub unsafe fn loadInPlaceFileRepresentationForTypeIdentifier_completionHandler( &self, typeIdentifier: &NSString, completionHandler: TodoBlock, - ) -> Id { - msg_send_id![ - self, - loadInPlaceFileRepresentationForTypeIdentifier: typeIdentifier, - completionHandler: completionHandler - ] - } - pub unsafe fn suggestedName(&self) -> Option> { - msg_send_id![self, suggestedName] - } - pub unsafe fn setSuggestedName(&self, suggestedName: Option<&NSString>) { - msg_send![self, setSuggestedName: suggestedName] - } - pub unsafe fn initWithObject(&self, object: &NSItemProviderWriting) -> Id { - msg_send_id![self, initWithObject: object] - } + ) -> Id; + #[method_id(suggestedName)] + pub unsafe fn suggestedName(&self) -> Option>; + # [method (setSuggestedName :)] + pub unsafe fn setSuggestedName(&self, suggestedName: Option<&NSString>); + # [method_id (initWithObject :)] + pub unsafe fn initWithObject(&self, object: &NSItemProviderWriting) -> Id; + # [method (registerObject : visibility :)] pub unsafe fn registerObject_visibility( &self, object: &NSItemProviderWriting, visibility: NSItemProviderRepresentationVisibility, - ) { - msg_send![self, registerObject: object, visibility: visibility] - } + ); + # [method_id (initWithItem : typeIdentifier :)] pub unsafe fn initWithItem_typeIdentifier( &self, item: Option<&NSSecureCoding>, typeIdentifier: Option<&NSString>, - ) -> Id { - msg_send_id![self, initWithItem: item, typeIdentifier: typeIdentifier] - } + ) -> Id; + # [method_id (initWithContentsOfURL :)] pub unsafe fn initWithContentsOfURL( &self, fileURL: Option<&NSURL>, - ) -> Option> { - msg_send_id![self, initWithContentsOfURL: fileURL] - } + ) -> Option>; + # [method (registerItemForTypeIdentifier : loadHandler :)] pub unsafe fn registerItemForTypeIdentifier_loadHandler( &self, typeIdentifier: &NSString, loadHandler: NSItemProviderLoadHandler, - ) { - msg_send![ - self, - registerItemForTypeIdentifier: typeIdentifier, - loadHandler: loadHandler - ] - } + ); + # [method (loadItemForTypeIdentifier : options : completionHandler :)] pub unsafe fn loadItemForTypeIdentifier_options_completionHandler( &self, typeIdentifier: &NSString, options: Option<&NSDictionary>, completionHandler: NSItemProviderCompletionHandler, - ) { - msg_send![ - self, - loadItemForTypeIdentifier: typeIdentifier, - options: options, - completionHandler: completionHandler - ] - } + ); } ); extern_methods!( #[doc = "NSPreviewSupport"] unsafe impl NSItemProvider { - pub unsafe fn previewImageHandler(&self) -> NSItemProviderLoadHandler { - msg_send![self, previewImageHandler] - } - pub unsafe fn setPreviewImageHandler( - &self, - previewImageHandler: NSItemProviderLoadHandler, - ) { - msg_send![self, setPreviewImageHandler: previewImageHandler] - } + #[method(previewImageHandler)] + pub unsafe fn previewImageHandler(&self) -> NSItemProviderLoadHandler; + # [method (setPreviewImageHandler :)] + pub unsafe fn setPreviewImageHandler(&self, previewImageHandler: NSItemProviderLoadHandler); + # [method (loadPreviewImageWithOptions : completionHandler :)] pub unsafe fn loadPreviewImageWithOptions_completionHandler( &self, options: Option<&NSDictionary>, completionHandler: NSItemProviderCompletionHandler, - ) { - msg_send![ - self, - loadPreviewImageWithOptions: options, - completionHandler: completionHandler - ] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSJSONSerialization.rs b/icrate/src/Foundation/generated/NSJSONSerialization.rs index 4e6a06b09..17d02e710 100644 --- a/icrate/src/Foundation/generated/NSJSONSerialization.rs +++ b/icrate/src/Foundation/generated/NSJSONSerialization.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSJSONSerialization; @@ -16,41 +16,22 @@ extern_class!( ); extern_methods!( unsafe impl NSJSONSerialization { - pub unsafe fn isValidJSONObject(obj: &Object) -> bool { - msg_send![Self::class(), isValidJSONObject: obj] - } + # [method (isValidJSONObject :)] + pub unsafe fn isValidJSONObject(obj: &Object) -> bool; + # [method_id (dataWithJSONObject : options : error :)] pub unsafe fn dataWithJSONObject_options_error( obj: &Object, opt: NSJSONWritingOptions, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - dataWithJSONObject: obj, - options: opt, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (JSONObjectWithData : options : error :)] pub unsafe fn JSONObjectWithData_options_error( data: &NSData, opt: NSJSONReadingOptions, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - JSONObjectWithData: data, - options: opt, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (JSONObjectWithStream : options : error :)] pub unsafe fn JSONObjectWithStream_options_error( stream: &NSInputStream, opt: NSJSONReadingOptions, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - JSONObjectWithStream: stream, - options: opt, - error: _ - ] - } + ) -> Result, Id>; } ); diff --git a/icrate/src/Foundation/generated/NSKeyValueCoding.rs b/icrate/src/Foundation/generated/NSKeyValueCoding.rs index b817cad8b..c7b0cd060 100644 --- a/icrate/src/Foundation/generated/NSKeyValueCoding.rs +++ b/icrate/src/Foundation/generated/NSKeyValueCoding.rs @@ -8,182 +8,141 @@ use crate::Foundation::generated::NSSet::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSKeyValueOperator = NSString; extern_methods!( #[doc = "NSKeyValueCoding"] unsafe impl NSObject { - pub unsafe fn accessInstanceVariablesDirectly() -> bool { - msg_send![Self::class(), accessInstanceVariablesDirectly] - } - pub unsafe fn valueForKey(&self, key: &NSString) -> Option> { - msg_send_id![self, valueForKey: key] - } - pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString) { - msg_send![self, setValue: value, forKey: key] - } + #[method(accessInstanceVariablesDirectly)] + pub unsafe fn accessInstanceVariablesDirectly() -> bool; + # [method_id (valueForKey :)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Option>; + # [method (setValue : forKey :)] + pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString); + # [method (validateValue : forKey : error :)] pub unsafe fn validateValue_forKey_error( &self, ioValue: &mut Option>, inKey: &NSString, - ) -> Result<(), Id> { - msg_send![self, validateValue: ioValue, forKey: inKey, error: _] - } - pub unsafe fn mutableArrayValueForKey(&self, key: &NSString) -> Id { - msg_send_id![self, mutableArrayValueForKey: key] - } + ) -> Result<(), Id>; + # [method_id (mutableArrayValueForKey :)] + pub unsafe fn mutableArrayValueForKey(&self, key: &NSString) -> Id; + # [method_id (mutableOrderedSetValueForKey :)] pub unsafe fn mutableOrderedSetValueForKey( &self, key: &NSString, - ) -> Id { - msg_send_id![self, mutableOrderedSetValueForKey: key] - } - pub unsafe fn mutableSetValueForKey(&self, key: &NSString) -> Id { - msg_send_id![self, mutableSetValueForKey: key] - } - pub unsafe fn valueForKeyPath(&self, keyPath: &NSString) -> Option> { - msg_send_id![self, valueForKeyPath: keyPath] - } - pub unsafe fn setValue_forKeyPath(&self, value: Option<&Object>, keyPath: &NSString) { - msg_send![self, setValue: value, forKeyPath: keyPath] - } + ) -> Id; + # [method_id (mutableSetValueForKey :)] + pub unsafe fn mutableSetValueForKey(&self, key: &NSString) -> Id; + # [method_id (valueForKeyPath :)] + pub unsafe fn valueForKeyPath(&self, keyPath: &NSString) -> Option>; + # [method (setValue : forKeyPath :)] + pub unsafe fn setValue_forKeyPath(&self, value: Option<&Object>, keyPath: &NSString); + # [method (validateValue : forKeyPath : error :)] pub unsafe fn validateValue_forKeyPath_error( &self, ioValue: &mut Option>, inKeyPath: &NSString, - ) -> Result<(), Id> { - msg_send![ - self, - validateValue: ioValue, - forKeyPath: inKeyPath, - error: _ - ] - } + ) -> Result<(), Id>; + # [method_id (mutableArrayValueForKeyPath :)] pub unsafe fn mutableArrayValueForKeyPath( &self, keyPath: &NSString, - ) -> Id { - msg_send_id![self, mutableArrayValueForKeyPath: keyPath] - } + ) -> Id; + # [method_id (mutableOrderedSetValueForKeyPath :)] pub unsafe fn mutableOrderedSetValueForKeyPath( &self, keyPath: &NSString, - ) -> Id { - msg_send_id![self, mutableOrderedSetValueForKeyPath: keyPath] - } + ) -> Id; + # [method_id (mutableSetValueForKeyPath :)] pub unsafe fn mutableSetValueForKeyPath( &self, keyPath: &NSString, - ) -> Id { - msg_send_id![self, mutableSetValueForKeyPath: keyPath] - } - pub unsafe fn valueForUndefinedKey(&self, key: &NSString) -> Option> { - msg_send_id![self, valueForUndefinedKey: key] - } - pub unsafe fn setValue_forUndefinedKey(&self, value: Option<&Object>, key: &NSString) { - msg_send![self, setValue: value, forUndefinedKey: key] - } - pub unsafe fn setNilValueForKey(&self, key: &NSString) { - msg_send![self, setNilValueForKey: key] - } + ) -> Id; + # [method_id (valueForUndefinedKey :)] + pub unsafe fn valueForUndefinedKey(&self, key: &NSString) -> Option>; + # [method (setValue : forUndefinedKey :)] + pub unsafe fn setValue_forUndefinedKey(&self, value: Option<&Object>, key: &NSString); + # [method (setNilValueForKey :)] + pub unsafe fn setNilValueForKey(&self, key: &NSString); + # [method_id (dictionaryWithValuesForKeys :)] pub unsafe fn dictionaryWithValuesForKeys( &self, keys: &NSArray, - ) -> Id, Shared> { - msg_send_id![self, dictionaryWithValuesForKeys: keys] - } + ) -> Id, Shared>; + # [method (setValuesForKeysWithDictionary :)] pub unsafe fn setValuesForKeysWithDictionary( &self, keyedValues: &NSDictionary, - ) { - msg_send![self, setValuesForKeysWithDictionary: keyedValues] - } + ); } ); extern_methods!( #[doc = "NSKeyValueCoding"] unsafe impl NSArray { - pub unsafe fn valueForKey(&self, key: &NSString) -> Id { - msg_send_id![self, valueForKey: key] - } - pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString) { - msg_send![self, setValue: value, forKey: key] - } + # [method_id (valueForKey :)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Id; + # [method (setValue : forKey :)] + pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString); } ); extern_methods!( #[doc = "NSKeyValueCoding"] unsafe impl NSDictionary { - pub unsafe fn valueForKey(&self, key: &NSString) -> Option> { - msg_send_id![self, valueForKey: key] - } + # [method_id (valueForKey :)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Option>; } ); extern_methods!( #[doc = "NSKeyValueCoding"] unsafe impl NSMutableDictionary { - pub unsafe fn setValue_forKey(&self, value: Option<&ObjectType>, key: &NSString) { - msg_send![self, setValue: value, forKey: key] - } + # [method (setValue : forKey :)] + pub unsafe fn setValue_forKey(&self, value: Option<&ObjectType>, key: &NSString); } ); extern_methods!( #[doc = "NSKeyValueCoding"] unsafe impl NSOrderedSet { - pub unsafe fn valueForKey(&self, key: &NSString) -> Id { - msg_send_id![self, valueForKey: key] - } - pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString) { - msg_send![self, setValue: value, forKey: key] - } + # [method_id (valueForKey :)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Id; + # [method (setValue : forKey :)] + pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString); } ); extern_methods!( #[doc = "NSKeyValueCoding"] unsafe impl NSSet { - pub unsafe fn valueForKey(&self, key: &NSString) -> Id { - msg_send_id![self, valueForKey: key] - } - pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString) { - msg_send![self, setValue: value, forKey: key] - } + # [method_id (valueForKey :)] + pub unsafe fn valueForKey(&self, key: &NSString) -> Id; + # [method (setValue : forKey :)] + pub unsafe fn setValue_forKey(&self, value: Option<&Object>, key: &NSString); } ); extern_methods!( #[doc = "NSDeprecatedKeyValueCoding"] unsafe impl NSObject { - pub unsafe fn useStoredAccessor() -> bool { - msg_send![Self::class(), useStoredAccessor] - } - pub unsafe fn storedValueForKey(&self, key: &NSString) -> Option> { - msg_send_id![self, storedValueForKey: key] - } - pub unsafe fn takeStoredValue_forKey(&self, value: Option<&Object>, key: &NSString) { - msg_send![self, takeStoredValue: value, forKey: key] - } - pub unsafe fn takeValue_forKey(&self, value: Option<&Object>, key: &NSString) { - msg_send![self, takeValue: value, forKey: key] - } - pub unsafe fn takeValue_forKeyPath(&self, value: Option<&Object>, keyPath: &NSString) { - msg_send![self, takeValue: value, forKeyPath: keyPath] - } + #[method(useStoredAccessor)] + pub unsafe fn useStoredAccessor() -> bool; + # [method_id (storedValueForKey :)] + pub unsafe fn storedValueForKey(&self, key: &NSString) -> Option>; + # [method (takeStoredValue : forKey :)] + pub unsafe fn takeStoredValue_forKey(&self, value: Option<&Object>, key: &NSString); + # [method (takeValue : forKey :)] + pub unsafe fn takeValue_forKey(&self, value: Option<&Object>, key: &NSString); + # [method (takeValue : forKeyPath :)] + pub unsafe fn takeValue_forKeyPath(&self, value: Option<&Object>, keyPath: &NSString); + # [method_id (handleQueryWithUnboundKey :)] pub unsafe fn handleQueryWithUnboundKey( &self, key: &NSString, - ) -> Option> { - msg_send_id![self, handleQueryWithUnboundKey: key] - } - pub unsafe fn handleTakeValue_forUnboundKey(&self, value: Option<&Object>, key: &NSString) { - msg_send![self, handleTakeValue: value, forUnboundKey: key] - } - pub unsafe fn unableToSetNilForKey(&self, key: &NSString) { - msg_send![self, unableToSetNilForKey: key] - } - pub unsafe fn valuesForKeys(&self, keys: &NSArray) -> Id { - msg_send_id![self, valuesForKeys: keys] - } - pub unsafe fn takeValuesFromDictionary(&self, properties: &NSDictionary) { - msg_send![self, takeValuesFromDictionary: properties] - } + ) -> Option>; + # [method (handleTakeValue : forUnboundKey :)] + pub unsafe fn handleTakeValue_forUnboundKey(&self, value: Option<&Object>, key: &NSString); + # [method (unableToSetNilForKey :)] + pub unsafe fn unableToSetNilForKey(&self, key: &NSString); + # [method_id (valuesForKeys :)] + pub unsafe fn valuesForKeys(&self, keys: &NSArray) -> Id; + # [method (takeValuesFromDictionary :)] + pub unsafe fn takeValuesFromDictionary(&self, properties: &NSDictionary); } ); diff --git a/icrate/src/Foundation/generated/NSKeyValueObserving.rs b/icrate/src/Foundation/generated/NSKeyValueObserving.rs index b517c16b4..8d8f7b838 100644 --- a/icrate/src/Foundation/generated/NSKeyValueObserving.rs +++ b/icrate/src/Foundation/generated/NSKeyValueObserving.rs @@ -7,67 +7,47 @@ use crate::Foundation::generated::NSSet::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSKeyValueChangeKey = NSString; extern_methods!( #[doc = "NSKeyValueObserving"] unsafe impl NSObject { + # [method (observeValueForKeyPath : ofObject : change : context :)] pub unsafe fn observeValueForKeyPath_ofObject_change_context( &self, keyPath: Option<&NSString>, object: Option<&Object>, change: Option<&NSDictionary>, context: *mut c_void, - ) { - msg_send![ - self, - observeValueForKeyPath: keyPath, - ofObject: object, - change: change, - context: context - ] - } + ); } ); extern_methods!( #[doc = "NSKeyValueObserverRegistration"] unsafe impl NSObject { + # [method (addObserver : forKeyPath : options : context :)] pub unsafe fn addObserver_forKeyPath_options_context( &self, observer: &NSObject, keyPath: &NSString, options: NSKeyValueObservingOptions, context: *mut c_void, - ) { - msg_send![ - self, - addObserver: observer, - forKeyPath: keyPath, - options: options, - context: context - ] - } + ); + # [method (removeObserver : forKeyPath : context :)] pub unsafe fn removeObserver_forKeyPath_context( &self, observer: &NSObject, keyPath: &NSString, context: *mut c_void, - ) { - msg_send![ - self, - removeObserver: observer, - forKeyPath: keyPath, - context: context - ] - } - pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString) { - msg_send![self, removeObserver: observer, forKeyPath: keyPath] - } + ); + # [method (removeObserver : forKeyPath :)] + pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString); } ); extern_methods!( #[doc = "NSKeyValueObserverRegistration"] unsafe impl NSArray { + # [method (addObserver : toObjectsAtIndexes : forKeyPath : options : context :)] pub unsafe fn addObserver_toObjectsAtIndexes_forKeyPath_options_context( &self, observer: &NSObject, @@ -75,243 +55,144 @@ extern_methods!( keyPath: &NSString, options: NSKeyValueObservingOptions, context: *mut c_void, - ) { - msg_send![ - self, - addObserver: observer, - toObjectsAtIndexes: indexes, - forKeyPath: keyPath, - options: options, - context: context - ] - } + ); + # [method (removeObserver : fromObjectsAtIndexes : forKeyPath : context :)] pub unsafe fn removeObserver_fromObjectsAtIndexes_forKeyPath_context( &self, observer: &NSObject, indexes: &NSIndexSet, keyPath: &NSString, context: *mut c_void, - ) { - msg_send![ - self, - removeObserver: observer, - fromObjectsAtIndexes: indexes, - forKeyPath: keyPath, - context: context - ] - } + ); + # [method (removeObserver : fromObjectsAtIndexes : forKeyPath :)] pub unsafe fn removeObserver_fromObjectsAtIndexes_forKeyPath( &self, observer: &NSObject, indexes: &NSIndexSet, keyPath: &NSString, - ) { - msg_send![ - self, - removeObserver: observer, - fromObjectsAtIndexes: indexes, - forKeyPath: keyPath - ] - } + ); + # [method (addObserver : forKeyPath : options : context :)] pub unsafe fn addObserver_forKeyPath_options_context( &self, observer: &NSObject, keyPath: &NSString, options: NSKeyValueObservingOptions, context: *mut c_void, - ) { - msg_send![ - self, - addObserver: observer, - forKeyPath: keyPath, - options: options, - context: context - ] - } + ); + # [method (removeObserver : forKeyPath : context :)] pub unsafe fn removeObserver_forKeyPath_context( &self, observer: &NSObject, keyPath: &NSString, context: *mut c_void, - ) { - msg_send![ - self, - removeObserver: observer, - forKeyPath: keyPath, - context: context - ] - } - pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString) { - msg_send![self, removeObserver: observer, forKeyPath: keyPath] - } + ); + # [method (removeObserver : forKeyPath :)] + pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString); } ); extern_methods!( #[doc = "NSKeyValueObserverRegistration"] unsafe impl NSOrderedSet { + # [method (addObserver : forKeyPath : options : context :)] pub unsafe fn addObserver_forKeyPath_options_context( &self, observer: &NSObject, keyPath: &NSString, options: NSKeyValueObservingOptions, context: *mut c_void, - ) { - msg_send![ - self, - addObserver: observer, - forKeyPath: keyPath, - options: options, - context: context - ] - } + ); + # [method (removeObserver : forKeyPath : context :)] pub unsafe fn removeObserver_forKeyPath_context( &self, observer: &NSObject, keyPath: &NSString, context: *mut c_void, - ) { - msg_send![ - self, - removeObserver: observer, - forKeyPath: keyPath, - context: context - ] - } - pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString) { - msg_send![self, removeObserver: observer, forKeyPath: keyPath] - } + ); + # [method (removeObserver : forKeyPath :)] + pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString); } ); extern_methods!( #[doc = "NSKeyValueObserverRegistration"] unsafe impl NSSet { + # [method (addObserver : forKeyPath : options : context :)] pub unsafe fn addObserver_forKeyPath_options_context( &self, observer: &NSObject, keyPath: &NSString, options: NSKeyValueObservingOptions, context: *mut c_void, - ) { - msg_send![ - self, - addObserver: observer, - forKeyPath: keyPath, - options: options, - context: context - ] - } + ); + # [method (removeObserver : forKeyPath : context :)] pub unsafe fn removeObserver_forKeyPath_context( &self, observer: &NSObject, keyPath: &NSString, context: *mut c_void, - ) { - msg_send![ - self, - removeObserver: observer, - forKeyPath: keyPath, - context: context - ] - } - pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString) { - msg_send![self, removeObserver: observer, forKeyPath: keyPath] - } + ); + # [method (removeObserver : forKeyPath :)] + pub unsafe fn removeObserver_forKeyPath(&self, observer: &NSObject, keyPath: &NSString); } ); extern_methods!( #[doc = "NSKeyValueObserverNotification"] unsafe impl NSObject { - pub unsafe fn willChangeValueForKey(&self, key: &NSString) { - msg_send![self, willChangeValueForKey: key] - } - pub unsafe fn didChangeValueForKey(&self, key: &NSString) { - msg_send![self, didChangeValueForKey: key] - } + # [method (willChangeValueForKey :)] + pub unsafe fn willChangeValueForKey(&self, key: &NSString); + # [method (didChangeValueForKey :)] + pub unsafe fn didChangeValueForKey(&self, key: &NSString); + # [method (willChange : valuesAtIndexes : forKey :)] pub unsafe fn willChange_valuesAtIndexes_forKey( &self, changeKind: NSKeyValueChange, indexes: &NSIndexSet, key: &NSString, - ) { - msg_send![ - self, - willChange: changeKind, - valuesAtIndexes: indexes, - forKey: key - ] - } + ); + # [method (didChange : valuesAtIndexes : forKey :)] pub unsafe fn didChange_valuesAtIndexes_forKey( &self, changeKind: NSKeyValueChange, indexes: &NSIndexSet, key: &NSString, - ) { - msg_send![ - self, - didChange: changeKind, - valuesAtIndexes: indexes, - forKey: key - ] - } + ); + # [method (willChangeValueForKey : withSetMutation : usingObjects :)] pub unsafe fn willChangeValueForKey_withSetMutation_usingObjects( &self, key: &NSString, mutationKind: NSKeyValueSetMutationKind, objects: &NSSet, - ) { - msg_send![ - self, - willChangeValueForKey: key, - withSetMutation: mutationKind, - usingObjects: objects - ] - } + ); + # [method (didChangeValueForKey : withSetMutation : usingObjects :)] pub unsafe fn didChangeValueForKey_withSetMutation_usingObjects( &self, key: &NSString, mutationKind: NSKeyValueSetMutationKind, objects: &NSSet, - ) { - msg_send![ - self, - didChangeValueForKey: key, - withSetMutation: mutationKind, - usingObjects: objects - ] - } + ); } ); extern_methods!( #[doc = "NSKeyValueObservingCustomization"] unsafe impl NSObject { + # [method_id (keyPathsForValuesAffectingValueForKey :)] pub unsafe fn keyPathsForValuesAffectingValueForKey( key: &NSString, - ) -> Id, Shared> { - msg_send_id![Self::class(), keyPathsForValuesAffectingValueForKey: key] - } - pub unsafe fn automaticallyNotifiesObserversForKey(key: &NSString) -> bool { - msg_send![Self::class(), automaticallyNotifiesObserversForKey: key] - } - pub unsafe fn observationInfo(&self) -> *mut c_void { - msg_send![self, observationInfo] - } - pub unsafe fn setObservationInfo(&self, observationInfo: *mut c_void) { - msg_send![self, setObservationInfo: observationInfo] - } + ) -> Id, Shared>; + # [method (automaticallyNotifiesObserversForKey :)] + pub unsafe fn automaticallyNotifiesObserversForKey(key: &NSString) -> bool; + #[method(observationInfo)] + pub unsafe fn observationInfo(&self) -> *mut c_void; + # [method (setObservationInfo :)] + pub unsafe fn setObservationInfo(&self, observationInfo: *mut c_void); } ); extern_methods!( #[doc = "NSDeprecatedKeyValueObservingCustomization"] unsafe impl NSObject { + # [method (setKeys : triggerChangeNotificationsForDependentKey :)] pub unsafe fn setKeys_triggerChangeNotificationsForDependentKey( keys: &NSArray, dependentKey: &NSString, - ) { - msg_send![ - Self::class(), - setKeys: keys, - triggerChangeNotificationsForDependentKey: dependentKey - ] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSKeyedArchiver.rs b/icrate/src/Foundation/generated/NSKeyedArchiver.rs index 35e24be58..ccb0d3ff0 100644 --- a/icrate/src/Foundation/generated/NSKeyedArchiver.rs +++ b/icrate/src/Foundation/generated/NSKeyedArchiver.rs @@ -9,7 +9,7 @@ use crate::Foundation::generated::NSPropertyList::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSKeyedArchiver; @@ -19,110 +19,78 @@ extern_class!( ); extern_methods!( unsafe impl NSKeyedArchiver { + # [method_id (initRequiringSecureCoding :)] pub unsafe fn initRequiringSecureCoding( &self, requiresSecureCoding: bool, - ) -> Id { - msg_send_id![self, initRequiringSecureCoding: requiresSecureCoding] - } + ) -> Id; + # [method_id (archivedDataWithRootObject : requiringSecureCoding : error :)] pub unsafe fn archivedDataWithRootObject_requiringSecureCoding_error( object: &Object, requiresSecureCoding: bool, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - archivedDataWithRootObject: object, - requiringSecureCoding: requiresSecureCoding, - error: _ - ] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + ) -> Result, Id>; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initForWritingWithMutableData :)] pub unsafe fn initForWritingWithMutableData( &self, data: &NSMutableData, - ) -> Id { - msg_send_id![self, initForWritingWithMutableData: data] - } - pub unsafe fn archivedDataWithRootObject(rootObject: &Object) -> Id { - msg_send_id![Self::class(), archivedDataWithRootObject: rootObject] - } - pub unsafe fn archiveRootObject_toFile(rootObject: &Object, path: &NSString) -> bool { - msg_send![Self::class(), archiveRootObject: rootObject, toFile: path] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSKeyedArchiverDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn outputFormat(&self) -> NSPropertyListFormat { - msg_send![self, outputFormat] - } - pub unsafe fn setOutputFormat(&self, outputFormat: NSPropertyListFormat) { - msg_send![self, setOutputFormat: outputFormat] - } - pub unsafe fn encodedData(&self) -> Id { - msg_send_id![self, encodedData] - } - pub unsafe fn finishEncoding(&self) { - msg_send![self, finishEncoding] - } - pub unsafe fn setClassName_forClass(codedName: Option<&NSString>, cls: &Class) { - msg_send![Self::class(), setClassName: codedName, forClass: cls] - } - pub unsafe fn setClassName_forClass(&self, codedName: Option<&NSString>, cls: &Class) { - msg_send![self, setClassName: codedName, forClass: cls] - } - pub unsafe fn classNameForClass(cls: &Class) -> Option> { - msg_send_id![Self::class(), classNameForClass: cls] - } - pub unsafe fn classNameForClass(&self, cls: &Class) -> Option> { - msg_send_id![self, classNameForClass: cls] - } - pub unsafe fn encodeObject_forKey(&self, object: Option<&Object>, key: &NSString) { - msg_send![self, encodeObject: object, forKey: key] - } + ) -> Id; + # [method_id (archivedDataWithRootObject :)] + pub unsafe fn archivedDataWithRootObject(rootObject: &Object) -> Id; + # [method (archiveRootObject : toFile :)] + pub unsafe fn archiveRootObject_toFile(rootObject: &Object, path: &NSString) -> bool; + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSKeyedArchiverDelegate>); + #[method(outputFormat)] + pub unsafe fn outputFormat(&self) -> NSPropertyListFormat; + # [method (setOutputFormat :)] + pub unsafe fn setOutputFormat(&self, outputFormat: NSPropertyListFormat); + #[method_id(encodedData)] + pub unsafe fn encodedData(&self) -> Id; + #[method(finishEncoding)] + pub unsafe fn finishEncoding(&self); + # [method (setClassName : forClass :)] + pub unsafe fn setClassName_forClass(codedName: Option<&NSString>, cls: &Class); + # [method (setClassName : forClass :)] + pub unsafe fn setClassName_forClass(&self, codedName: Option<&NSString>, cls: &Class); + # [method_id (classNameForClass :)] + pub unsafe fn classNameForClass(cls: &Class) -> Option>; + # [method_id (classNameForClass :)] + pub unsafe fn classNameForClass(&self, cls: &Class) -> Option>; + # [method (encodeObject : forKey :)] + pub unsafe fn encodeObject_forKey(&self, object: Option<&Object>, key: &NSString); + # [method (encodeConditionalObject : forKey :)] pub unsafe fn encodeConditionalObject_forKey( &self, object: Option<&Object>, key: &NSString, - ) { - msg_send![self, encodeConditionalObject: object, forKey: key] - } - pub unsafe fn encodeBool_forKey(&self, value: bool, key: &NSString) { - msg_send![self, encodeBool: value, forKey: key] - } - pub unsafe fn encodeInt_forKey(&self, value: c_int, key: &NSString) { - msg_send![self, encodeInt: value, forKey: key] - } - pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString) { - msg_send![self, encodeInt32: value, forKey: key] - } - pub unsafe fn encodeInt64_forKey(&self, value: int64_t, key: &NSString) { - msg_send![self, encodeInt64: value, forKey: key] - } - pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString) { - msg_send![self, encodeFloat: value, forKey: key] - } - pub unsafe fn encodeDouble_forKey(&self, value: c_double, key: &NSString) { - msg_send![self, encodeDouble: value, forKey: key] - } + ); + # [method (encodeBool : forKey :)] + pub unsafe fn encodeBool_forKey(&self, value: bool, key: &NSString); + # [method (encodeInt : forKey :)] + pub unsafe fn encodeInt_forKey(&self, value: c_int, key: &NSString); + # [method (encodeInt32 : forKey :)] + pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString); + # [method (encodeInt64 : forKey :)] + pub unsafe fn encodeInt64_forKey(&self, value: int64_t, key: &NSString); + # [method (encodeFloat : forKey :)] + pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString); + # [method (encodeDouble : forKey :)] + pub unsafe fn encodeDouble_forKey(&self, value: c_double, key: &NSString); + # [method (encodeBytes : length : forKey :)] pub unsafe fn encodeBytes_length_forKey( &self, bytes: *mut u8, length: NSUInteger, key: &NSString, - ) { - msg_send![self, encodeBytes: bytes, length: length, forKey: key] - } - pub unsafe fn requiresSecureCoding(&self) -> bool { - msg_send![self, requiresSecureCoding] - } - pub unsafe fn setRequiresSecureCoding(&self, requiresSecureCoding: bool) { - msg_send![self, setRequiresSecureCoding: requiresSecureCoding] - } + ); + #[method(requiresSecureCoding)] + pub unsafe fn requiresSecureCoding(&self) -> bool; + # [method (setRequiresSecureCoding :)] + pub unsafe fn setRequiresSecureCoding(&self, requiresSecureCoding: bool); } ); extern_class!( @@ -134,170 +102,102 @@ extern_class!( ); extern_methods!( unsafe impl NSKeyedUnarchiver { + # [method_id (initForReadingFromData : error :)] pub unsafe fn initForReadingFromData_error( &self, data: &NSData, - ) -> Result, Id> { - msg_send_id![self, initForReadingFromData: data, error: _] - } + ) -> Result, Id>; + # [method_id (unarchivedObjectOfClass : fromData : error :)] pub unsafe fn unarchivedObjectOfClass_fromData_error( cls: &Class, data: &NSData, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - unarchivedObjectOfClass: cls, - fromData: data, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (unarchivedArrayOfObjectsOfClass : fromData : error :)] pub unsafe fn unarchivedArrayOfObjectsOfClass_fromData_error( cls: &Class, data: &NSData, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - unarchivedArrayOfObjectsOfClass: cls, - fromData: data, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (unarchivedDictionaryWithKeysOfClass : objectsOfClass : fromData : error :)] pub unsafe fn unarchivedDictionaryWithKeysOfClass_objectsOfClass_fromData_error( keyCls: &Class, valueCls: &Class, data: &NSData, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - unarchivedDictionaryWithKeysOfClass: keyCls, - objectsOfClass: valueCls, - fromData: data, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (unarchivedObjectOfClasses : fromData : error :)] pub unsafe fn unarchivedObjectOfClasses_fromData_error( classes: &NSSet, data: &NSData, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - unarchivedObjectOfClasses: classes, - fromData: data, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (unarchivedArrayOfObjectsOfClasses : fromData : error :)] pub unsafe fn unarchivedArrayOfObjectsOfClasses_fromData_error( classes: &NSSet, data: &NSData, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - unarchivedArrayOfObjectsOfClasses: classes, - fromData: data, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (unarchivedDictionaryWithKeysOfClasses : objectsOfClasses : fromData : error :)] pub unsafe fn unarchivedDictionaryWithKeysOfClasses_objectsOfClasses_fromData_error( keyClasses: &NSSet, valueClasses: &NSSet, data: &NSData, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - unarchivedDictionaryWithKeysOfClasses: keyClasses, - objectsOfClasses: valueClasses, - fromData: data, - error: _ - ] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initForReadingWithData(&self, data: &NSData) -> Id { - msg_send_id![self, initForReadingWithData: data] - } - pub unsafe fn unarchiveObjectWithData(data: &NSData) -> Option> { - msg_send_id![Self::class(), unarchiveObjectWithData: data] - } + ) -> Result, Id>; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initForReadingWithData :)] + pub unsafe fn initForReadingWithData(&self, data: &NSData) -> Id; + # [method_id (unarchiveObjectWithData :)] + pub unsafe fn unarchiveObjectWithData(data: &NSData) -> Option>; + # [method_id (unarchiveTopLevelObjectWithData : error :)] pub unsafe fn unarchiveTopLevelObjectWithData_error( data: &NSData, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - unarchiveTopLevelObjectWithData: data, - error: _ - ] - } - pub unsafe fn unarchiveObjectWithFile(path: &NSString) -> Option> { - msg_send_id![Self::class(), unarchiveObjectWithFile: path] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSKeyedUnarchiverDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn finishDecoding(&self) { - msg_send![self, finishDecoding] - } - pub unsafe fn setClass_forClassName(cls: Option<&Class>, codedName: &NSString) { - msg_send![Self::class(), setClass: cls, forClassName: codedName] - } - pub unsafe fn setClass_forClassName(&self, cls: Option<&Class>, codedName: &NSString) { - msg_send![self, setClass: cls, forClassName: codedName] - } - pub unsafe fn classForClassName(codedName: &NSString) -> Option<&Class> { - msg_send![Self::class(), classForClassName: codedName] - } - pub unsafe fn classForClassName(&self, codedName: &NSString) -> Option<&Class> { - msg_send![self, classForClassName: codedName] - } - pub unsafe fn containsValueForKey(&self, key: &NSString) -> bool { - msg_send![self, containsValueForKey: key] - } - pub unsafe fn decodeObjectForKey(&self, key: &NSString) -> Option> { - msg_send_id![self, decodeObjectForKey: key] - } - pub unsafe fn decodeBoolForKey(&self, key: &NSString) -> bool { - msg_send![self, decodeBoolForKey: key] - } - pub unsafe fn decodeIntForKey(&self, key: &NSString) -> c_int { - msg_send![self, decodeIntForKey: key] - } - pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32 { - msg_send![self, decodeInt32ForKey: key] - } - pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> int64_t { - msg_send![self, decodeInt64ForKey: key] - } - pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float { - msg_send![self, decodeFloatForKey: key] - } - pub unsafe fn decodeDoubleForKey(&self, key: &NSString) -> c_double { - msg_send![self, decodeDoubleForKey: key] - } + ) -> Result, Id>; + # [method_id (unarchiveObjectWithFile :)] + pub unsafe fn unarchiveObjectWithFile(path: &NSString) -> Option>; + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSKeyedUnarchiverDelegate>); + #[method(finishDecoding)] + pub unsafe fn finishDecoding(&self); + # [method (setClass : forClassName :)] + pub unsafe fn setClass_forClassName(cls: Option<&Class>, codedName: &NSString); + # [method (setClass : forClassName :)] + pub unsafe fn setClass_forClassName(&self, cls: Option<&Class>, codedName: &NSString); + # [method (classForClassName :)] + pub unsafe fn classForClassName(codedName: &NSString) -> Option<&Class>; + # [method (classForClassName :)] + pub unsafe fn classForClassName(&self, codedName: &NSString) -> Option<&Class>; + # [method (containsValueForKey :)] + pub unsafe fn containsValueForKey(&self, key: &NSString) -> bool; + # [method_id (decodeObjectForKey :)] + pub unsafe fn decodeObjectForKey(&self, key: &NSString) -> Option>; + # [method (decodeBoolForKey :)] + pub unsafe fn decodeBoolForKey(&self, key: &NSString) -> bool; + # [method (decodeIntForKey :)] + pub unsafe fn decodeIntForKey(&self, key: &NSString) -> c_int; + # [method (decodeInt32ForKey :)] + pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32; + # [method (decodeInt64ForKey :)] + pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> int64_t; + # [method (decodeFloatForKey :)] + pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float; + # [method (decodeDoubleForKey :)] + pub unsafe fn decodeDoubleForKey(&self, key: &NSString) -> c_double; + # [method (decodeBytesForKey : returnedLength :)] pub unsafe fn decodeBytesForKey_returnedLength( &self, key: &NSString, lengthp: *mut NSUInteger, - ) -> *mut u8 { - msg_send![self, decodeBytesForKey: key, returnedLength: lengthp] - } - pub unsafe fn requiresSecureCoding(&self) -> bool { - msg_send![self, requiresSecureCoding] - } - pub unsafe fn setRequiresSecureCoding(&self, requiresSecureCoding: bool) { - msg_send![self, setRequiresSecureCoding: requiresSecureCoding] - } - pub unsafe fn decodingFailurePolicy(&self) -> NSDecodingFailurePolicy { - msg_send![self, decodingFailurePolicy] - } + ) -> *mut u8; + #[method(requiresSecureCoding)] + pub unsafe fn requiresSecureCoding(&self) -> bool; + # [method (setRequiresSecureCoding :)] + pub unsafe fn setRequiresSecureCoding(&self, requiresSecureCoding: bool); + #[method(decodingFailurePolicy)] + pub unsafe fn decodingFailurePolicy(&self) -> NSDecodingFailurePolicy; + # [method (setDecodingFailurePolicy :)] pub unsafe fn setDecodingFailurePolicy( &self, decodingFailurePolicy: NSDecodingFailurePolicy, - ) { - msg_send![self, setDecodingFailurePolicy: decodingFailurePolicy] - } + ); } ); pub type NSKeyedArchiverDelegate = NSObject; @@ -305,25 +205,21 @@ pub type NSKeyedUnarchiverDelegate = NSObject; extern_methods!( #[doc = "NSKeyedArchiverObjectSubstitution"] unsafe impl NSObject { - pub unsafe fn classForKeyedArchiver(&self) -> Option<&Class> { - msg_send![self, classForKeyedArchiver] - } + #[method(classForKeyedArchiver)] + pub unsafe fn classForKeyedArchiver(&self) -> Option<&Class>; + # [method_id (replacementObjectForKeyedArchiver :)] pub unsafe fn replacementObjectForKeyedArchiver( &self, archiver: &NSKeyedArchiver, - ) -> Option> { - msg_send_id![self, replacementObjectForKeyedArchiver: archiver] - } - pub unsafe fn classFallbacksForKeyedArchiver() -> Id, Shared> { - msg_send_id![Self::class(), classFallbacksForKeyedArchiver] - } + ) -> Option>; + #[method_id(classFallbacksForKeyedArchiver)] + pub unsafe fn classFallbacksForKeyedArchiver() -> Id, Shared>; } ); extern_methods!( #[doc = "NSKeyedUnarchiverObjectSubstitution"] unsafe impl NSObject { - pub unsafe fn classForKeyedUnarchiver() -> &Class { - msg_send![Self::class(), classForKeyedUnarchiver] - } + #[method(classForKeyedUnarchiver)] + pub unsafe fn classForKeyedUnarchiver() -> &Class; } ); diff --git a/icrate/src/Foundation/generated/NSLengthFormatter.rs b/icrate/src/Foundation/generated/NSLengthFormatter.rs index aaa2f895a..3d76af7c9 100644 --- a/icrate/src/Foundation/generated/NSLengthFormatter.rs +++ b/icrate/src/Foundation/generated/NSLengthFormatter.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::Foundation::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSLengthFormatter; @@ -12,60 +12,44 @@ extern_class!( ); extern_methods!( unsafe impl NSLengthFormatter { - pub unsafe fn numberFormatter(&self) -> Id { - msg_send_id![self, numberFormatter] - } - pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>) { - msg_send![self, setNumberFormatter: numberFormatter] - } - pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle { - msg_send![self, unitStyle] - } - pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle) { - msg_send![self, setUnitStyle: unitStyle] - } - pub unsafe fn isForPersonHeightUse(&self) -> bool { - msg_send![self, isForPersonHeightUse] - } - pub unsafe fn setForPersonHeightUse(&self, forPersonHeightUse: bool) { - msg_send![self, setForPersonHeightUse: forPersonHeightUse] - } + #[method_id(numberFormatter)] + pub unsafe fn numberFormatter(&self) -> Id; + # [method (setNumberFormatter :)] + pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>); + #[method(unitStyle)] + pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle; + # [method (setUnitStyle :)] + pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle); + #[method(isForPersonHeightUse)] + pub unsafe fn isForPersonHeightUse(&self) -> bool; + # [method (setForPersonHeightUse :)] + pub unsafe fn setForPersonHeightUse(&self, forPersonHeightUse: bool); + # [method_id (stringFromValue : unit :)] pub unsafe fn stringFromValue_unit( &self, value: c_double, unit: NSLengthFormatterUnit, - ) -> Id { - msg_send_id![self, stringFromValue: value, unit: unit] - } - pub unsafe fn stringFromMeters(&self, numberInMeters: c_double) -> Id { - msg_send_id![self, stringFromMeters: numberInMeters] - } + ) -> Id; + # [method_id (stringFromMeters :)] + pub unsafe fn stringFromMeters(&self, numberInMeters: c_double) -> Id; + # [method_id (unitStringFromValue : unit :)] pub unsafe fn unitStringFromValue_unit( &self, value: c_double, unit: NSLengthFormatterUnit, - ) -> Id { - msg_send_id![self, unitStringFromValue: value, unit: unit] - } + ) -> Id; + # [method_id (unitStringFromMeters : usedUnit :)] pub unsafe fn unitStringFromMeters_usedUnit( &self, numberInMeters: c_double, unitp: *mut NSLengthFormatterUnit, - ) -> Id { - msg_send_id![self, unitStringFromMeters: numberInMeters, usedUnit: unitp] - } + ) -> Id; + # [method (getObjectValue : forString : errorDescription :)] pub unsafe fn getObjectValue_forString_errorDescription( &self, obj: Option<&mut Option>>, string: &NSString, error: Option<&mut Option>>, - ) -> bool { - msg_send![ - self, - getObjectValue: obj, - forString: string, - errorDescription: error - ] - } + ) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSLinguisticTagger.rs b/icrate/src/Foundation/generated/NSLinguisticTagger.rs index 7a18d7e87..1fe2d6856 100644 --- a/icrate/src/Foundation/generated/NSLinguisticTagger.rs +++ b/icrate/src/Foundation/generated/NSLinguisticTagger.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSString::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSLinguisticTagScheme = NSString; pub type NSLinguisticTag = NSString; extern_class!( @@ -18,72 +18,54 @@ extern_class!( ); extern_methods!( unsafe impl NSLinguisticTagger { + # [method_id (initWithTagSchemes : options :)] pub unsafe fn initWithTagSchemes_options( &self, tagSchemes: &NSArray, opts: NSUInteger, - ) -> Id { - msg_send_id![self, initWithTagSchemes: tagSchemes, options: opts] - } - pub unsafe fn tagSchemes(&self) -> Id, Shared> { - msg_send_id![self, tagSchemes] - } - pub unsafe fn string(&self) -> Option> { - msg_send_id![self, string] - } - pub unsafe fn setString(&self, string: Option<&NSString>) { - msg_send![self, setString: string] - } + ) -> Id; + #[method_id(tagSchemes)] + pub unsafe fn tagSchemes(&self) -> Id, Shared>; + #[method_id(string)] + pub unsafe fn string(&self) -> Option>; + # [method (setString :)] + pub unsafe fn setString(&self, string: Option<&NSString>); + # [method_id (availableTagSchemesForUnit : language :)] pub unsafe fn availableTagSchemesForUnit_language( unit: NSLinguisticTaggerUnit, language: &NSString, - ) -> Id, Shared> { - msg_send_id![ - Self::class(), - availableTagSchemesForUnit: unit, - language: language - ] - } + ) -> Id, Shared>; + # [method_id (availableTagSchemesForLanguage :)] pub unsafe fn availableTagSchemesForLanguage( language: &NSString, - ) -> Id, Shared> { - msg_send_id![Self::class(), availableTagSchemesForLanguage: language] - } + ) -> Id, Shared>; + # [method (setOrthography : range :)] pub unsafe fn setOrthography_range( &self, orthography: Option<&NSOrthography>, range: NSRange, - ) { - msg_send![self, setOrthography: orthography, range: range] - } + ); + # [method_id (orthographyAtIndex : effectiveRange :)] pub unsafe fn orthographyAtIndex_effectiveRange( &self, charIndex: NSUInteger, effectiveRange: NSRangePointer, - ) -> Option> { - msg_send_id![ - self, - orthographyAtIndex: charIndex, - effectiveRange: effectiveRange - ] - } + ) -> Option>; + # [method (stringEditedInRange : changeInLength :)] pub unsafe fn stringEditedInRange_changeInLength( &self, newRange: NSRange, delta: NSInteger, - ) { - msg_send![self, stringEditedInRange: newRange, changeInLength: delta] - } + ); + # [method (tokenRangeAtIndex : unit :)] pub unsafe fn tokenRangeAtIndex_unit( &self, charIndex: NSUInteger, unit: NSLinguisticTaggerUnit, - ) -> NSRange { - msg_send![self, tokenRangeAtIndex: charIndex, unit: unit] - } - pub unsafe fn sentenceRangeForRange(&self, range: NSRange) -> NSRange { - msg_send![self, sentenceRangeForRange: range] - } + ) -> NSRange; + # [method (sentenceRangeForRange :)] + pub unsafe fn sentenceRangeForRange(&self, range: NSRange) -> NSRange; + # [method (enumerateTagsInRange : unit : scheme : options : usingBlock :)] pub unsafe fn enumerateTagsInRange_unit_scheme_options_usingBlock( &self, range: NSRange, @@ -91,31 +73,16 @@ extern_methods!( scheme: &NSLinguisticTagScheme, options: NSLinguisticTaggerOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateTagsInRange: range, - unit: unit, - scheme: scheme, - options: options, - usingBlock: block - ] - } + ); + # [method_id (tagAtIndex : unit : scheme : tokenRange :)] pub unsafe fn tagAtIndex_unit_scheme_tokenRange( &self, charIndex: NSUInteger, unit: NSLinguisticTaggerUnit, scheme: &NSLinguisticTagScheme, tokenRange: NSRangePointer, - ) -> Option> { - msg_send_id![ - self, - tagAtIndex: charIndex, - unit: unit, - scheme: scheme, - tokenRange: tokenRange - ] - } + ) -> Option>; + # [method_id (tagsInRange : unit : scheme : options : tokenRanges :)] pub unsafe fn tagsInRange_unit_scheme_options_tokenRanges( &self, range: NSRange, @@ -123,67 +90,36 @@ extern_methods!( scheme: &NSLinguisticTagScheme, options: NSLinguisticTaggerOptions, tokenRanges: Option<&mut Option, Shared>>>, - ) -> Id, Shared> { - msg_send_id![ - self, - tagsInRange: range, - unit: unit, - scheme: scheme, - options: options, - tokenRanges: tokenRanges - ] - } + ) -> Id, Shared>; + # [method (enumerateTagsInRange : scheme : options : usingBlock :)] pub unsafe fn enumerateTagsInRange_scheme_options_usingBlock( &self, range: NSRange, tagScheme: &NSLinguisticTagScheme, opts: NSLinguisticTaggerOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateTagsInRange: range, - scheme: tagScheme, - options: opts, - usingBlock: block - ] - } + ); + # [method_id (tagAtIndex : scheme : tokenRange : sentenceRange :)] pub unsafe fn tagAtIndex_scheme_tokenRange_sentenceRange( &self, charIndex: NSUInteger, scheme: &NSLinguisticTagScheme, tokenRange: NSRangePointer, sentenceRange: NSRangePointer, - ) -> Option> { - msg_send_id![ - self, - tagAtIndex: charIndex, - scheme: scheme, - tokenRange: tokenRange, - sentenceRange: sentenceRange - ] - } + ) -> Option>; + # [method_id (tagsInRange : scheme : options : tokenRanges :)] pub unsafe fn tagsInRange_scheme_options_tokenRanges( &self, range: NSRange, tagScheme: &NSString, opts: NSLinguisticTaggerOptions, tokenRanges: Option<&mut Option, Shared>>>, - ) -> Id, Shared> { - msg_send_id![ - self, - tagsInRange: range, - scheme: tagScheme, - options: opts, - tokenRanges: tokenRanges - ] - } - pub unsafe fn dominantLanguage(&self) -> Option> { - msg_send_id![self, dominantLanguage] - } - pub unsafe fn dominantLanguageForString(string: &NSString) -> Option> { - msg_send_id![Self::class(), dominantLanguageForString: string] - } + ) -> Id, Shared>; + #[method_id(dominantLanguage)] + pub unsafe fn dominantLanguage(&self) -> Option>; + # [method_id (dominantLanguageForString :)] + pub unsafe fn dominantLanguageForString(string: &NSString) -> Option>; + # [method_id (tagForString : atIndex : unit : scheme : orthography : tokenRange :)] pub unsafe fn tagForString_atIndex_unit_scheme_orthography_tokenRange( string: &NSString, charIndex: NSUInteger, @@ -191,17 +127,8 @@ extern_methods!( scheme: &NSLinguisticTagScheme, orthography: Option<&NSOrthography>, tokenRange: NSRangePointer, - ) -> Option> { - msg_send_id![ - Self::class(), - tagForString: string, - atIndex: charIndex, - unit: unit, - scheme: scheme, - orthography: orthography, - tokenRange: tokenRange - ] - } + ) -> Option>; + # [method_id (tagsForString : range : unit : scheme : options : orthography : tokenRanges :)] pub unsafe fn tagsForString_range_unit_scheme_options_orthography_tokenRanges( string: &NSString, range: NSRange, @@ -210,18 +137,8 @@ extern_methods!( options: NSLinguisticTaggerOptions, orthography: Option<&NSOrthography>, tokenRanges: Option<&mut Option, Shared>>>, - ) -> Id, Shared> { - msg_send_id![ - Self::class(), - tagsForString: string, - range: range, - unit: unit, - scheme: scheme, - options: options, - orthography: orthography, - tokenRanges: tokenRanges - ] - } + ) -> Id, Shared>; + # [method (enumerateTagsForString : range : unit : scheme : options : orthography : usingBlock :)] pub unsafe fn enumerateTagsForString_range_unit_scheme_options_orthography_usingBlock( string: &NSString, range: NSRange, @@ -230,18 +147,8 @@ extern_methods!( options: NSLinguisticTaggerOptions, orthography: Option<&NSOrthography>, block: TodoBlock, - ) { - msg_send![ - Self::class(), - enumerateTagsForString: string, - range: range, - unit: unit, - scheme: scheme, - options: options, - orthography: orthography, - usingBlock: block - ] - } + ); + # [method_id (possibleTagsAtIndex : scheme : tokenRange : sentenceRange : scores :)] pub unsafe fn possibleTagsAtIndex_scheme_tokenRange_sentenceRange_scores( &self, charIndex: NSUInteger, @@ -249,21 +156,13 @@ extern_methods!( tokenRange: NSRangePointer, sentenceRange: NSRangePointer, scores: Option<&mut Option, Shared>>>, - ) -> Option, Shared>> { - msg_send_id![ - self, - possibleTagsAtIndex: charIndex, - scheme: tagScheme, - tokenRange: tokenRange, - sentenceRange: sentenceRange, - scores: scores - ] - } + ) -> Option, Shared>>; } ); extern_methods!( #[doc = "NSLinguisticAnalysis"] unsafe impl NSString { + # [method_id (linguisticTagsInRange : scheme : options : orthography : tokenRanges :)] pub unsafe fn linguisticTagsInRange_scheme_options_orthography_tokenRanges( &self, range: NSRange, @@ -271,16 +170,8 @@ extern_methods!( options: NSLinguisticTaggerOptions, orthography: Option<&NSOrthography>, tokenRanges: Option<&mut Option, Shared>>>, - ) -> Id, Shared> { - msg_send_id![ - self, - linguisticTagsInRange: range, - scheme: scheme, - options: options, - orthography: orthography, - tokenRanges: tokenRanges - ] - } + ) -> Id, Shared>; + # [method (enumerateLinguisticTagsInRange : scheme : options : orthography : usingBlock :)] pub unsafe fn enumerateLinguisticTagsInRange_scheme_options_orthography_usingBlock( &self, range: NSRange, @@ -288,15 +179,6 @@ extern_methods!( options: NSLinguisticTaggerOptions, orthography: Option<&NSOrthography>, block: TodoBlock, - ) { - msg_send![ - self, - enumerateLinguisticTagsInRange: range, - scheme: scheme, - options: options, - orthography: orthography, - usingBlock: block - ] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSListFormatter.rs b/icrate/src/Foundation/generated/NSListFormatter.rs index c07f79add..eccc864b4 100644 --- a/icrate/src/Foundation/generated/NSListFormatter.rs +++ b/icrate/src/Foundation/generated/NSListFormatter.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSListFormatter; @@ -14,31 +14,24 @@ extern_class!( ); extern_methods!( unsafe impl NSListFormatter { - pub unsafe fn locale(&self) -> Id { - msg_send_id![self, locale] - } - pub unsafe fn setLocale(&self, locale: Option<&NSLocale>) { - msg_send![self, setLocale: locale] - } - pub unsafe fn itemFormatter(&self) -> Option> { - msg_send_id![self, itemFormatter] - } - pub unsafe fn setItemFormatter(&self, itemFormatter: Option<&NSFormatter>) { - msg_send![self, setItemFormatter: itemFormatter] - } + #[method_id(locale)] + pub unsafe fn locale(&self) -> Id; + # [method (setLocale :)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + #[method_id(itemFormatter)] + pub unsafe fn itemFormatter(&self) -> Option>; + # [method (setItemFormatter :)] + pub unsafe fn setItemFormatter(&self, itemFormatter: Option<&NSFormatter>); + # [method_id (localizedStringByJoiningStrings :)] pub unsafe fn localizedStringByJoiningStrings( strings: &NSArray, - ) -> Id { - msg_send_id![Self::class(), localizedStringByJoiningStrings: strings] - } - pub unsafe fn stringFromItems(&self, items: &NSArray) -> Option> { - msg_send_id![self, stringFromItems: items] - } + ) -> Id; + # [method_id (stringFromItems :)] + pub unsafe fn stringFromItems(&self, items: &NSArray) -> Option>; + # [method_id (stringForObjectValue :)] pub unsafe fn stringForObjectValue( &self, obj: Option<&Object>, - ) -> Option> { - msg_send_id![self, stringForObjectValue: obj] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSLocale.rs b/icrate/src/Foundation/generated/NSLocale.rs index 98c30fd4f..7ca17c40a 100644 --- a/icrate/src/Foundation/generated/NSLocale.rs +++ b/icrate/src/Foundation/generated/NSLocale.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSLocaleKey = NSString; use super::__exported::NSArray; use super::__exported::NSDictionary; @@ -19,227 +19,164 @@ extern_class!( ); extern_methods!( unsafe impl NSLocale { - pub unsafe fn objectForKey(&self, key: &NSLocaleKey) -> Option> { - msg_send_id![self, objectForKey: key] - } + # [method_id (objectForKey :)] + pub unsafe fn objectForKey(&self, key: &NSLocaleKey) -> Option>; + # [method_id (displayNameForKey : value :)] pub unsafe fn displayNameForKey_value( &self, key: &NSLocaleKey, value: &Object, - ) -> Option> { - msg_send_id![self, displayNameForKey: key, value: value] - } - pub unsafe fn initWithLocaleIdentifier(&self, string: &NSString) -> Id { - msg_send_id![self, initWithLocaleIdentifier: string] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ) -> Option>; + # [method_id (initWithLocaleIdentifier :)] + pub unsafe fn initWithLocaleIdentifier(&self, string: &NSString) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSExtendedLocale"] unsafe impl NSLocale { - pub unsafe fn localeIdentifier(&self) -> Id { - msg_send_id![self, localeIdentifier] - } + #[method_id(localeIdentifier)] + pub unsafe fn localeIdentifier(&self) -> Id; + # [method_id (localizedStringForLocaleIdentifier :)] pub unsafe fn localizedStringForLocaleIdentifier( &self, localeIdentifier: &NSString, - ) -> Id { - msg_send_id![self, localizedStringForLocaleIdentifier: localeIdentifier] - } - pub unsafe fn languageCode(&self) -> Id { - msg_send_id![self, languageCode] - } + ) -> Id; + #[method_id(languageCode)] + pub unsafe fn languageCode(&self) -> Id; + # [method_id (localizedStringForLanguageCode :)] pub unsafe fn localizedStringForLanguageCode( &self, languageCode: &NSString, - ) -> Option> { - msg_send_id![self, localizedStringForLanguageCode: languageCode] - } - pub unsafe fn countryCode(&self) -> Option> { - msg_send_id![self, countryCode] - } + ) -> Option>; + #[method_id(countryCode)] + pub unsafe fn countryCode(&self) -> Option>; + # [method_id (localizedStringForCountryCode :)] pub unsafe fn localizedStringForCountryCode( &self, countryCode: &NSString, - ) -> Option> { - msg_send_id![self, localizedStringForCountryCode: countryCode] - } - pub unsafe fn scriptCode(&self) -> Option> { - msg_send_id![self, scriptCode] - } + ) -> Option>; + #[method_id(scriptCode)] + pub unsafe fn scriptCode(&self) -> Option>; + # [method_id (localizedStringForScriptCode :)] pub unsafe fn localizedStringForScriptCode( &self, scriptCode: &NSString, - ) -> Option> { - msg_send_id![self, localizedStringForScriptCode: scriptCode] - } - pub unsafe fn variantCode(&self) -> Option> { - msg_send_id![self, variantCode] - } + ) -> Option>; + #[method_id(variantCode)] + pub unsafe fn variantCode(&self) -> Option>; + # [method_id (localizedStringForVariantCode :)] pub unsafe fn localizedStringForVariantCode( &self, variantCode: &NSString, - ) -> Option> { - msg_send_id![self, localizedStringForVariantCode: variantCode] - } - pub unsafe fn exemplarCharacterSet(&self) -> Id { - msg_send_id![self, exemplarCharacterSet] - } - pub unsafe fn calendarIdentifier(&self) -> Id { - msg_send_id![self, calendarIdentifier] - } + ) -> Option>; + #[method_id(exemplarCharacterSet)] + pub unsafe fn exemplarCharacterSet(&self) -> Id; + #[method_id(calendarIdentifier)] + pub unsafe fn calendarIdentifier(&self) -> Id; + # [method_id (localizedStringForCalendarIdentifier :)] pub unsafe fn localizedStringForCalendarIdentifier( &self, calendarIdentifier: &NSString, - ) -> Option> { - msg_send_id![ - self, - localizedStringForCalendarIdentifier: calendarIdentifier - ] - } - pub unsafe fn collationIdentifier(&self) -> Option> { - msg_send_id![self, collationIdentifier] - } + ) -> Option>; + #[method_id(collationIdentifier)] + pub unsafe fn collationIdentifier(&self) -> Option>; + # [method_id (localizedStringForCollationIdentifier :)] pub unsafe fn localizedStringForCollationIdentifier( &self, collationIdentifier: &NSString, - ) -> Option> { - msg_send_id![ - self, - localizedStringForCollationIdentifier: collationIdentifier - ] - } - pub unsafe fn usesMetricSystem(&self) -> bool { - msg_send![self, usesMetricSystem] - } - pub unsafe fn decimalSeparator(&self) -> Id { - msg_send_id![self, decimalSeparator] - } - pub unsafe fn groupingSeparator(&self) -> Id { - msg_send_id![self, groupingSeparator] - } - pub unsafe fn currencySymbol(&self) -> Id { - msg_send_id![self, currencySymbol] - } - pub unsafe fn currencyCode(&self) -> Option> { - msg_send_id![self, currencyCode] - } + ) -> Option>; + #[method(usesMetricSystem)] + pub unsafe fn usesMetricSystem(&self) -> bool; + #[method_id(decimalSeparator)] + pub unsafe fn decimalSeparator(&self) -> Id; + #[method_id(groupingSeparator)] + pub unsafe fn groupingSeparator(&self) -> Id; + #[method_id(currencySymbol)] + pub unsafe fn currencySymbol(&self) -> Id; + #[method_id(currencyCode)] + pub unsafe fn currencyCode(&self) -> Option>; + # [method_id (localizedStringForCurrencyCode :)] pub unsafe fn localizedStringForCurrencyCode( &self, currencyCode: &NSString, - ) -> Option> { - msg_send_id![self, localizedStringForCurrencyCode: currencyCode] - } - pub unsafe fn collatorIdentifier(&self) -> Id { - msg_send_id![self, collatorIdentifier] - } + ) -> Option>; + #[method_id(collatorIdentifier)] + pub unsafe fn collatorIdentifier(&self) -> Id; + # [method_id (localizedStringForCollatorIdentifier :)] pub unsafe fn localizedStringForCollatorIdentifier( &self, collatorIdentifier: &NSString, - ) -> Option> { - msg_send_id![ - self, - localizedStringForCollatorIdentifier: collatorIdentifier - ] - } - pub unsafe fn quotationBeginDelimiter(&self) -> Id { - msg_send_id![self, quotationBeginDelimiter] - } - pub unsafe fn quotationEndDelimiter(&self) -> Id { - msg_send_id![self, quotationEndDelimiter] - } - pub unsafe fn alternateQuotationBeginDelimiter(&self) -> Id { - msg_send_id![self, alternateQuotationBeginDelimiter] - } - pub unsafe fn alternateQuotationEndDelimiter(&self) -> Id { - msg_send_id![self, alternateQuotationEndDelimiter] - } + ) -> Option>; + #[method_id(quotationBeginDelimiter)] + pub unsafe fn quotationBeginDelimiter(&self) -> Id; + #[method_id(quotationEndDelimiter)] + pub unsafe fn quotationEndDelimiter(&self) -> Id; + #[method_id(alternateQuotationBeginDelimiter)] + pub unsafe fn alternateQuotationBeginDelimiter(&self) -> Id; + #[method_id(alternateQuotationEndDelimiter)] + pub unsafe fn alternateQuotationEndDelimiter(&self) -> Id; } ); extern_methods!( #[doc = "NSLocaleCreation"] unsafe impl NSLocale { - pub unsafe fn autoupdatingCurrentLocale() -> Id { - msg_send_id![Self::class(), autoupdatingCurrentLocale] - } - pub unsafe fn currentLocale() -> Id { - msg_send_id![Self::class(), currentLocale] - } - pub unsafe fn systemLocale() -> Id { - msg_send_id![Self::class(), systemLocale] - } - pub unsafe fn localeWithLocaleIdentifier(ident: &NSString) -> Id { - msg_send_id![Self::class(), localeWithLocaleIdentifier: ident] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method_id(autoupdatingCurrentLocale)] + pub unsafe fn autoupdatingCurrentLocale() -> Id; + #[method_id(currentLocale)] + pub unsafe fn currentLocale() -> Id; + #[method_id(systemLocale)] + pub unsafe fn systemLocale() -> Id; + # [method_id (localeWithLocaleIdentifier :)] + pub unsafe fn localeWithLocaleIdentifier(ident: &NSString) -> Id; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; } ); extern_methods!( #[doc = "NSLocaleGeneralInfo"] unsafe impl NSLocale { - pub unsafe fn availableLocaleIdentifiers() -> Id, Shared> { - msg_send_id![Self::class(), availableLocaleIdentifiers] - } - pub unsafe fn ISOLanguageCodes() -> Id, Shared> { - msg_send_id![Self::class(), ISOLanguageCodes] - } - pub unsafe fn ISOCountryCodes() -> Id, Shared> { - msg_send_id![Self::class(), ISOCountryCodes] - } - pub unsafe fn ISOCurrencyCodes() -> Id, Shared> { - msg_send_id![Self::class(), ISOCurrencyCodes] - } - pub unsafe fn commonISOCurrencyCodes() -> Id, Shared> { - msg_send_id![Self::class(), commonISOCurrencyCodes] - } - pub unsafe fn preferredLanguages() -> Id, Shared> { - msg_send_id![Self::class(), preferredLanguages] - } + #[method_id(availableLocaleIdentifiers)] + pub unsafe fn availableLocaleIdentifiers() -> Id, Shared>; + #[method_id(ISOLanguageCodes)] + pub unsafe fn ISOLanguageCodes() -> Id, Shared>; + #[method_id(ISOCountryCodes)] + pub unsafe fn ISOCountryCodes() -> Id, Shared>; + #[method_id(ISOCurrencyCodes)] + pub unsafe fn ISOCurrencyCodes() -> Id, Shared>; + #[method_id(commonISOCurrencyCodes)] + pub unsafe fn commonISOCurrencyCodes() -> Id, Shared>; + #[method_id(preferredLanguages)] + pub unsafe fn preferredLanguages() -> Id, Shared>; + # [method_id (componentsFromLocaleIdentifier :)] pub unsafe fn componentsFromLocaleIdentifier( string: &NSString, - ) -> Id, Shared> { - msg_send_id![Self::class(), componentsFromLocaleIdentifier: string] - } + ) -> Id, Shared>; + # [method_id (localeIdentifierFromComponents :)] pub unsafe fn localeIdentifierFromComponents( dict: &NSDictionary, - ) -> Id { - msg_send_id![Self::class(), localeIdentifierFromComponents: dict] - } + ) -> Id; + # [method_id (canonicalLocaleIdentifierFromString :)] pub unsafe fn canonicalLocaleIdentifierFromString( string: &NSString, - ) -> Id { - msg_send_id![Self::class(), canonicalLocaleIdentifierFromString: string] - } + ) -> Id; + # [method_id (canonicalLanguageIdentifierFromString :)] pub unsafe fn canonicalLanguageIdentifierFromString( string: &NSString, - ) -> Id { - msg_send_id![Self::class(), canonicalLanguageIdentifierFromString: string] - } + ) -> Id; + # [method_id (localeIdentifierFromWindowsLocaleCode :)] pub unsafe fn localeIdentifierFromWindowsLocaleCode( lcid: u32, - ) -> Option> { - msg_send_id![Self::class(), localeIdentifierFromWindowsLocaleCode: lcid] - } - pub unsafe fn windowsLocaleCodeFromLocaleIdentifier(localeIdentifier: &NSString) -> u32 { - msg_send![ - Self::class(), - windowsLocaleCodeFromLocaleIdentifier: localeIdentifier - ] - } + ) -> Option>; + # [method (windowsLocaleCodeFromLocaleIdentifier :)] + pub unsafe fn windowsLocaleCodeFromLocaleIdentifier(localeIdentifier: &NSString) -> u32; + # [method (characterDirectionForLanguage :)] pub unsafe fn characterDirectionForLanguage( isoLangCode: &NSString, - ) -> NSLocaleLanguageDirection { - msg_send![Self::class(), characterDirectionForLanguage: isoLangCode] - } - pub unsafe fn lineDirectionForLanguage( - isoLangCode: &NSString, - ) -> NSLocaleLanguageDirection { - msg_send![Self::class(), lineDirectionForLanguage: isoLangCode] - } + ) -> NSLocaleLanguageDirection; + # [method (lineDirectionForLanguage :)] + pub unsafe fn lineDirectionForLanguage(isoLangCode: &NSString) + -> NSLocaleLanguageDirection; } ); diff --git a/icrate/src/Foundation/generated/NSLock.rs b/icrate/src/Foundation/generated/NSLock.rs index 39d663984..d485b5109 100644 --- a/icrate/src/Foundation/generated/NSLock.rs +++ b/icrate/src/Foundation/generated/NSLock.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSLocking = NSObject; extern_class!( #[derive(Debug)] @@ -14,18 +14,14 @@ extern_class!( ); extern_methods!( unsafe impl NSLock { - pub unsafe fn tryLock(&self) -> bool { - msg_send![self, tryLock] - } - pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool { - msg_send![self, lockBeforeDate: limit] - } - pub unsafe fn name(&self) -> Option> { - msg_send_id![self, name] - } - pub unsafe fn setName(&self, name: Option<&NSString>) { - msg_send![self, setName: name] - } + #[method(tryLock)] + pub unsafe fn tryLock(&self) -> bool; + # [method (lockBeforeDate :)] + pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool; + #[method_id(name)] + pub unsafe fn name(&self) -> Option>; + # [method (setName :)] + pub unsafe fn setName(&self, name: Option<&NSString>); } ); extern_class!( @@ -37,40 +33,30 @@ extern_class!( ); extern_methods!( unsafe impl NSConditionLock { - pub unsafe fn initWithCondition(&self, condition: NSInteger) -> Id { - msg_send_id![self, initWithCondition: condition] - } - pub unsafe fn condition(&self) -> NSInteger { - msg_send![self, condition] - } - pub unsafe fn lockWhenCondition(&self, condition: NSInteger) { - msg_send![self, lockWhenCondition: condition] - } - pub unsafe fn tryLock(&self) -> bool { - msg_send![self, tryLock] - } - pub unsafe fn tryLockWhenCondition(&self, condition: NSInteger) -> bool { - msg_send![self, tryLockWhenCondition: condition] - } - pub unsafe fn unlockWithCondition(&self, condition: NSInteger) { - msg_send![self, unlockWithCondition: condition] - } - pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool { - msg_send![self, lockBeforeDate: limit] - } + # [method_id (initWithCondition :)] + pub unsafe fn initWithCondition(&self, condition: NSInteger) -> Id; + #[method(condition)] + pub unsafe fn condition(&self) -> NSInteger; + # [method (lockWhenCondition :)] + pub unsafe fn lockWhenCondition(&self, condition: NSInteger); + #[method(tryLock)] + pub unsafe fn tryLock(&self) -> bool; + # [method (tryLockWhenCondition :)] + pub unsafe fn tryLockWhenCondition(&self, condition: NSInteger) -> bool; + # [method (unlockWithCondition :)] + pub unsafe fn unlockWithCondition(&self, condition: NSInteger); + # [method (lockBeforeDate :)] + pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool; + # [method (lockWhenCondition : beforeDate :)] pub unsafe fn lockWhenCondition_beforeDate( &self, condition: NSInteger, limit: &NSDate, - ) -> bool { - msg_send![self, lockWhenCondition: condition, beforeDate: limit] - } - pub unsafe fn name(&self) -> Option> { - msg_send_id![self, name] - } - pub unsafe fn setName(&self, name: Option<&NSString>) { - msg_send![self, setName: name] - } + ) -> bool; + #[method_id(name)] + pub unsafe fn name(&self) -> Option>; + # [method (setName :)] + pub unsafe fn setName(&self, name: Option<&NSString>); } ); extern_class!( @@ -82,18 +68,14 @@ extern_class!( ); extern_methods!( unsafe impl NSRecursiveLock { - pub unsafe fn tryLock(&self) -> bool { - msg_send![self, tryLock] - } - pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool { - msg_send![self, lockBeforeDate: limit] - } - pub unsafe fn name(&self) -> Option> { - msg_send_id![self, name] - } - pub unsafe fn setName(&self, name: Option<&NSString>) { - msg_send![self, setName: name] - } + #[method(tryLock)] + pub unsafe fn tryLock(&self) -> bool; + # [method (lockBeforeDate :)] + pub unsafe fn lockBeforeDate(&self, limit: &NSDate) -> bool; + #[method_id(name)] + pub unsafe fn name(&self) -> Option>; + # [method (setName :)] + pub unsafe fn setName(&self, name: Option<&NSString>); } ); extern_class!( @@ -105,23 +87,17 @@ extern_class!( ); extern_methods!( unsafe impl NSCondition { - pub unsafe fn wait(&self) { - msg_send![self, wait] - } - pub unsafe fn waitUntilDate(&self, limit: &NSDate) -> bool { - msg_send![self, waitUntilDate: limit] - } - pub unsafe fn signal(&self) { - msg_send![self, signal] - } - pub unsafe fn broadcast(&self) { - msg_send![self, broadcast] - } - pub unsafe fn name(&self) -> Option> { - msg_send_id![self, name] - } - pub unsafe fn setName(&self, name: Option<&NSString>) { - msg_send![self, setName: name] - } + #[method(wait)] + pub unsafe fn wait(&self); + # [method (waitUntilDate :)] + pub unsafe fn waitUntilDate(&self, limit: &NSDate) -> bool; + #[method(signal)] + pub unsafe fn signal(&self); + #[method(broadcast)] + pub unsafe fn broadcast(&self); + #[method_id(name)] + pub unsafe fn name(&self) -> Option>; + # [method (setName :)] + pub unsafe fn setName(&self, name: Option<&NSString>); } ); diff --git a/icrate/src/Foundation/generated/NSMapTable.rs b/icrate/src/Foundation/generated/NSMapTable.rs index 161985f53..d47dcbacb 100644 --- a/icrate/src/Foundation/generated/NSMapTable.rs +++ b/icrate/src/Foundation/generated/NSMapTable.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSString::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSMapTableOptions = NSUInteger; __inner_extern_class!( #[derive(Debug)] @@ -17,105 +17,67 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSMapTable { + # [method_id (initWithKeyOptions : valueOptions : capacity :)] pub unsafe fn initWithKeyOptions_valueOptions_capacity( &self, keyOptions: NSPointerFunctionsOptions, valueOptions: NSPointerFunctionsOptions, initialCapacity: NSUInteger, - ) -> Id { - msg_send_id![ - self, - initWithKeyOptions: keyOptions, - valueOptions: valueOptions, - capacity: initialCapacity - ] - } + ) -> Id; + # [method_id (initWithKeyPointerFunctions : valuePointerFunctions : capacity :)] pub unsafe fn initWithKeyPointerFunctions_valuePointerFunctions_capacity( &self, keyFunctions: &NSPointerFunctions, valueFunctions: &NSPointerFunctions, initialCapacity: NSUInteger, - ) -> Id { - msg_send_id![ - self, - initWithKeyPointerFunctions: keyFunctions, - valuePointerFunctions: valueFunctions, - capacity: initialCapacity - ] - } + ) -> Id; + # [method_id (mapTableWithKeyOptions : valueOptions :)] pub unsafe fn mapTableWithKeyOptions_valueOptions( keyOptions: NSPointerFunctionsOptions, valueOptions: NSPointerFunctionsOptions, - ) -> Id, Shared> { - msg_send_id![ - Self::class(), - mapTableWithKeyOptions: keyOptions, - valueOptions: valueOptions - ] - } - pub unsafe fn mapTableWithStrongToStrongObjects() -> Id { - msg_send_id![Self::class(), mapTableWithStrongToStrongObjects] - } - pub unsafe fn mapTableWithWeakToStrongObjects() -> Id { - msg_send_id![Self::class(), mapTableWithWeakToStrongObjects] - } - pub unsafe fn mapTableWithStrongToWeakObjects() -> Id { - msg_send_id![Self::class(), mapTableWithStrongToWeakObjects] - } - pub unsafe fn mapTableWithWeakToWeakObjects() -> Id { - msg_send_id![Self::class(), mapTableWithWeakToWeakObjects] - } - pub unsafe fn strongToStrongObjectsMapTable() -> Id, Shared> - { - msg_send_id![Self::class(), strongToStrongObjectsMapTable] - } - pub unsafe fn weakToStrongObjectsMapTable() -> Id, Shared> { - msg_send_id![Self::class(), weakToStrongObjectsMapTable] - } - pub unsafe fn strongToWeakObjectsMapTable() -> Id, Shared> { - msg_send_id![Self::class(), strongToWeakObjectsMapTable] - } - pub unsafe fn weakToWeakObjectsMapTable() -> Id, Shared> { - msg_send_id![Self::class(), weakToWeakObjectsMapTable] - } - pub unsafe fn keyPointerFunctions(&self) -> Id { - msg_send_id![self, keyPointerFunctions] - } - pub unsafe fn valuePointerFunctions(&self) -> Id { - msg_send_id![self, valuePointerFunctions] - } - pub unsafe fn objectForKey( - &self, - aKey: Option<&KeyType>, - ) -> Option> { - msg_send_id![self, objectForKey: aKey] - } - pub unsafe fn removeObjectForKey(&self, aKey: Option<&KeyType>) { - msg_send![self, removeObjectForKey: aKey] - } + ) -> Id, Shared>; + #[method_id(mapTableWithStrongToStrongObjects)] + pub unsafe fn mapTableWithStrongToStrongObjects() -> Id; + #[method_id(mapTableWithWeakToStrongObjects)] + pub unsafe fn mapTableWithWeakToStrongObjects() -> Id; + #[method_id(mapTableWithStrongToWeakObjects)] + pub unsafe fn mapTableWithStrongToWeakObjects() -> Id; + #[method_id(mapTableWithWeakToWeakObjects)] + pub unsafe fn mapTableWithWeakToWeakObjects() -> Id; + #[method_id(strongToStrongObjectsMapTable)] + pub unsafe fn strongToStrongObjectsMapTable() -> Id, Shared>; + #[method_id(weakToStrongObjectsMapTable)] + pub unsafe fn weakToStrongObjectsMapTable() -> Id, Shared>; + #[method_id(strongToWeakObjectsMapTable)] + pub unsafe fn strongToWeakObjectsMapTable() -> Id, Shared>; + #[method_id(weakToWeakObjectsMapTable)] + pub unsafe fn weakToWeakObjectsMapTable() -> Id, Shared>; + #[method_id(keyPointerFunctions)] + pub unsafe fn keyPointerFunctions(&self) -> Id; + #[method_id(valuePointerFunctions)] + pub unsafe fn valuePointerFunctions(&self) -> Id; + # [method_id (objectForKey :)] + pub unsafe fn objectForKey(&self, aKey: Option<&KeyType>) + -> Option>; + # [method (removeObjectForKey :)] + pub unsafe fn removeObjectForKey(&self, aKey: Option<&KeyType>); + # [method (setObject : forKey :)] pub unsafe fn setObject_forKey( &self, anObject: Option<&ObjectType>, aKey: Option<&KeyType>, - ) { - msg_send![self, setObject: anObject, forKey: aKey] - } - pub unsafe fn count(&self) -> NSUInteger { - msg_send![self, count] - } - pub unsafe fn keyEnumerator(&self) -> Id, Shared> { - msg_send_id![self, keyEnumerator] - } - pub unsafe fn objectEnumerator(&self) -> Option, Shared>> { - msg_send_id![self, objectEnumerator] - } - pub unsafe fn removeAllObjects(&self) { - msg_send![self, removeAllObjects] - } + ); + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + #[method_id(keyEnumerator)] + pub unsafe fn keyEnumerator(&self) -> Id, Shared>; + #[method_id(objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Option, Shared>>; + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + #[method_id(dictionaryRepresentation)] pub unsafe fn dictionaryRepresentation( &self, - ) -> Id, Shared> { - msg_send_id![self, dictionaryRepresentation] - } + ) -> Id, Shared>; } ); diff --git a/icrate/src/Foundation/generated/NSMassFormatter.rs b/icrate/src/Foundation/generated/NSMassFormatter.rs index 5f1461cbb..6d4d3b0b1 100644 --- a/icrate/src/Foundation/generated/NSMassFormatter.rs +++ b/icrate/src/Foundation/generated/NSMassFormatter.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSFormatter::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSMassFormatter; @@ -13,67 +13,47 @@ extern_class!( ); extern_methods!( unsafe impl NSMassFormatter { - pub unsafe fn numberFormatter(&self) -> Id { - msg_send_id![self, numberFormatter] - } - pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>) { - msg_send![self, setNumberFormatter: numberFormatter] - } - pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle { - msg_send![self, unitStyle] - } - pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle) { - msg_send![self, setUnitStyle: unitStyle] - } - pub unsafe fn isForPersonMassUse(&self) -> bool { - msg_send![self, isForPersonMassUse] - } - pub unsafe fn setForPersonMassUse(&self, forPersonMassUse: bool) { - msg_send![self, setForPersonMassUse: forPersonMassUse] - } + #[method_id(numberFormatter)] + pub unsafe fn numberFormatter(&self) -> Id; + # [method (setNumberFormatter :)] + pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>); + #[method(unitStyle)] + pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle; + # [method (setUnitStyle :)] + pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle); + #[method(isForPersonMassUse)] + pub unsafe fn isForPersonMassUse(&self) -> bool; + # [method (setForPersonMassUse :)] + pub unsafe fn setForPersonMassUse(&self, forPersonMassUse: bool); + # [method_id (stringFromValue : unit :)] pub unsafe fn stringFromValue_unit( &self, value: c_double, unit: NSMassFormatterUnit, - ) -> Id { - msg_send_id![self, stringFromValue: value, unit: unit] - } + ) -> Id; + # [method_id (stringFromKilograms :)] pub unsafe fn stringFromKilograms( &self, numberInKilograms: c_double, - ) -> Id { - msg_send_id![self, stringFromKilograms: numberInKilograms] - } + ) -> Id; + # [method_id (unitStringFromValue : unit :)] pub unsafe fn unitStringFromValue_unit( &self, value: c_double, unit: NSMassFormatterUnit, - ) -> Id { - msg_send_id![self, unitStringFromValue: value, unit: unit] - } + ) -> Id; + # [method_id (unitStringFromKilograms : usedUnit :)] pub unsafe fn unitStringFromKilograms_usedUnit( &self, numberInKilograms: c_double, unitp: *mut NSMassFormatterUnit, - ) -> Id { - msg_send_id![ - self, - unitStringFromKilograms: numberInKilograms, - usedUnit: unitp - ] - } + ) -> Id; + # [method (getObjectValue : forString : errorDescription :)] pub unsafe fn getObjectValue_forString_errorDescription( &self, obj: Option<&mut Option>>, string: &NSString, error: Option<&mut Option>>, - ) -> bool { - msg_send![ - self, - getObjectValue: obj, - forString: string, - errorDescription: error - ] - } + ) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSMeasurement.rs b/icrate/src/Foundation/generated/NSMeasurement.rs index 82a73cb7a..a7ddbd497 100644 --- a/icrate/src/Foundation/generated/NSMeasurement.rs +++ b/icrate/src/Foundation/generated/NSMeasurement.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSUnit::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; __inner_extern_class!( #[derive(Debug)] pub struct NSMeasurement; @@ -13,42 +13,34 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSMeasurement { - pub unsafe fn unit(&self) -> Id { - msg_send_id![self, unit] - } - pub unsafe fn doubleValue(&self) -> c_double { - msg_send![self, doubleValue] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method_id(unit)] + pub unsafe fn unit(&self) -> Id; + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithDoubleValue : unit :)] pub unsafe fn initWithDoubleValue_unit( &self, doubleValue: c_double, unit: &UnitType, - ) -> Id { - msg_send_id![self, initWithDoubleValue: doubleValue, unit: unit] - } - pub unsafe fn canBeConvertedToUnit(&self, unit: &NSUnit) -> bool { - msg_send![self, canBeConvertedToUnit: unit] - } + ) -> Id; + # [method (canBeConvertedToUnit :)] + pub unsafe fn canBeConvertedToUnit(&self, unit: &NSUnit) -> bool; + # [method_id (measurementByConvertingToUnit :)] pub unsafe fn measurementByConvertingToUnit( &self, unit: &NSUnit, - ) -> Id { - msg_send_id![self, measurementByConvertingToUnit: unit] - } + ) -> Id; + # [method_id (measurementByAddingMeasurement :)] pub unsafe fn measurementByAddingMeasurement( &self, measurement: &NSMeasurement, - ) -> Id, Shared> { - msg_send_id![self, measurementByAddingMeasurement: measurement] - } + ) -> Id, Shared>; + # [method_id (measurementBySubtractingMeasurement :)] pub unsafe fn measurementBySubtractingMeasurement( &self, measurement: &NSMeasurement, - ) -> Id, Shared> { - msg_send_id![self, measurementBySubtractingMeasurement: measurement] - } + ) -> Id, Shared>; } ); diff --git a/icrate/src/Foundation/generated/NSMeasurementFormatter.rs b/icrate/src/Foundation/generated/NSMeasurementFormatter.rs index 8ba71bfc6..45338c682 100644 --- a/icrate/src/Foundation/generated/NSMeasurementFormatter.rs +++ b/icrate/src/Foundation/generated/NSMeasurementFormatter.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSMeasurementFormatter; @@ -16,38 +16,28 @@ extern_class!( ); extern_methods!( unsafe impl NSMeasurementFormatter { - pub unsafe fn unitOptions(&self) -> NSMeasurementFormatterUnitOptions { - msg_send![self, unitOptions] - } - pub unsafe fn setUnitOptions(&self, unitOptions: NSMeasurementFormatterUnitOptions) { - msg_send![self, setUnitOptions: unitOptions] - } - pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle { - msg_send![self, unitStyle] - } - pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle) { - msg_send![self, setUnitStyle: unitStyle] - } - pub unsafe fn locale(&self) -> Id { - msg_send_id![self, locale] - } - pub unsafe fn setLocale(&self, locale: Option<&NSLocale>) { - msg_send![self, setLocale: locale] - } - pub unsafe fn numberFormatter(&self) -> Id { - msg_send_id![self, numberFormatter] - } - pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>) { - msg_send![self, setNumberFormatter: numberFormatter] - } + #[method(unitOptions)] + pub unsafe fn unitOptions(&self) -> NSMeasurementFormatterUnitOptions; + # [method (setUnitOptions :)] + pub unsafe fn setUnitOptions(&self, unitOptions: NSMeasurementFormatterUnitOptions); + #[method(unitStyle)] + pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle; + # [method (setUnitStyle :)] + pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle); + #[method_id(locale)] + pub unsafe fn locale(&self) -> Id; + # [method (setLocale :)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + #[method_id(numberFormatter)] + pub unsafe fn numberFormatter(&self) -> Id; + # [method (setNumberFormatter :)] + pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>); + # [method_id (stringFromMeasurement :)] pub unsafe fn stringFromMeasurement( &self, measurement: &NSMeasurement, - ) -> Id { - msg_send_id![self, stringFromMeasurement: measurement] - } - pub unsafe fn stringFromUnit(&self, unit: &NSUnit) -> Id { - msg_send_id![self, stringFromUnit: unit] - } + ) -> Id; + # [method_id (stringFromUnit :)] + pub unsafe fn stringFromUnit(&self, unit: &NSUnit) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSMetadata.rs b/icrate/src/Foundation/generated/NSMetadata.rs index b02a7cc39..1b246aa7d 100644 --- a/icrate/src/Foundation/generated/NSMetadata.rs +++ b/icrate/src/Foundation/generated/NSMetadata.rs @@ -12,7 +12,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSMetadataQuery; @@ -22,125 +22,87 @@ extern_class!( ); extern_methods!( unsafe impl NSMetadataQuery { - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSMetadataQueryDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn predicate(&self) -> Option> { - msg_send_id![self, predicate] - } - pub unsafe fn setPredicate(&self, predicate: Option<&NSPredicate>) { - msg_send![self, setPredicate: predicate] - } - pub unsafe fn sortDescriptors(&self) -> Id, Shared> { - msg_send_id![self, sortDescriptors] - } - pub unsafe fn setSortDescriptors(&self, sortDescriptors: &NSArray) { - msg_send![self, setSortDescriptors: sortDescriptors] - } - pub unsafe fn valueListAttributes(&self) -> Id, Shared> { - msg_send_id![self, valueListAttributes] - } - pub unsafe fn setValueListAttributes(&self, valueListAttributes: &NSArray) { - msg_send![self, setValueListAttributes: valueListAttributes] - } - pub unsafe fn groupingAttributes(&self) -> Option, Shared>> { - msg_send_id![self, groupingAttributes] - } - pub unsafe fn setGroupingAttributes(&self, groupingAttributes: Option<&NSArray>) { - msg_send![self, setGroupingAttributes: groupingAttributes] - } - pub unsafe fn notificationBatchingInterval(&self) -> NSTimeInterval { - msg_send![self, notificationBatchingInterval] - } + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSMetadataQueryDelegate>); + #[method_id(predicate)] + pub unsafe fn predicate(&self) -> Option>; + # [method (setPredicate :)] + pub unsafe fn setPredicate(&self, predicate: Option<&NSPredicate>); + #[method_id(sortDescriptors)] + pub unsafe fn sortDescriptors(&self) -> Id, Shared>; + # [method (setSortDescriptors :)] + pub unsafe fn setSortDescriptors(&self, sortDescriptors: &NSArray); + #[method_id(valueListAttributes)] + pub unsafe fn valueListAttributes(&self) -> Id, Shared>; + # [method (setValueListAttributes :)] + pub unsafe fn setValueListAttributes(&self, valueListAttributes: &NSArray); + #[method_id(groupingAttributes)] + pub unsafe fn groupingAttributes(&self) -> Option, Shared>>; + # [method (setGroupingAttributes :)] + pub unsafe fn setGroupingAttributes(&self, groupingAttributes: Option<&NSArray>); + #[method(notificationBatchingInterval)] + pub unsafe fn notificationBatchingInterval(&self) -> NSTimeInterval; + # [method (setNotificationBatchingInterval :)] pub unsafe fn setNotificationBatchingInterval( &self, notificationBatchingInterval: NSTimeInterval, - ) { - msg_send![ - self, - setNotificationBatchingInterval: notificationBatchingInterval - ] - } - pub unsafe fn searchScopes(&self) -> Id { - msg_send_id![self, searchScopes] - } - pub unsafe fn setSearchScopes(&self, searchScopes: &NSArray) { - msg_send![self, setSearchScopes: searchScopes] - } - pub unsafe fn searchItems(&self) -> Option> { - msg_send_id![self, searchItems] - } - pub unsafe fn setSearchItems(&self, searchItems: Option<&NSArray>) { - msg_send![self, setSearchItems: searchItems] - } - pub unsafe fn operationQueue(&self) -> Option> { - msg_send_id![self, operationQueue] - } - pub unsafe fn setOperationQueue(&self, operationQueue: Option<&NSOperationQueue>) { - msg_send![self, setOperationQueue: operationQueue] - } - pub unsafe fn startQuery(&self) -> bool { - msg_send![self, startQuery] - } - pub unsafe fn stopQuery(&self) { - msg_send![self, stopQuery] - } - pub unsafe fn isStarted(&self) -> bool { - msg_send![self, isStarted] - } - pub unsafe fn isGathering(&self) -> bool { - msg_send![self, isGathering] - } - pub unsafe fn isStopped(&self) -> bool { - msg_send![self, isStopped] - } - pub unsafe fn disableUpdates(&self) { - msg_send![self, disableUpdates] - } - pub unsafe fn enableUpdates(&self) { - msg_send![self, enableUpdates] - } - pub unsafe fn resultCount(&self) -> NSUInteger { - msg_send![self, resultCount] - } - pub unsafe fn resultAtIndex(&self, idx: NSUInteger) -> Id { - msg_send_id![self, resultAtIndex: idx] - } - pub unsafe fn enumerateResultsUsingBlock(&self, block: TodoBlock) { - msg_send![self, enumerateResultsUsingBlock: block] - } + ); + #[method_id(searchScopes)] + pub unsafe fn searchScopes(&self) -> Id; + # [method (setSearchScopes :)] + pub unsafe fn setSearchScopes(&self, searchScopes: &NSArray); + #[method_id(searchItems)] + pub unsafe fn searchItems(&self) -> Option>; + # [method (setSearchItems :)] + pub unsafe fn setSearchItems(&self, searchItems: Option<&NSArray>); + #[method_id(operationQueue)] + pub unsafe fn operationQueue(&self) -> Option>; + # [method (setOperationQueue :)] + pub unsafe fn setOperationQueue(&self, operationQueue: Option<&NSOperationQueue>); + #[method(startQuery)] + pub unsafe fn startQuery(&self) -> bool; + #[method(stopQuery)] + pub unsafe fn stopQuery(&self); + #[method(isStarted)] + pub unsafe fn isStarted(&self) -> bool; + #[method(isGathering)] + pub unsafe fn isGathering(&self) -> bool; + #[method(isStopped)] + pub unsafe fn isStopped(&self) -> bool; + #[method(disableUpdates)] + pub unsafe fn disableUpdates(&self); + #[method(enableUpdates)] + pub unsafe fn enableUpdates(&self); + #[method(resultCount)] + pub unsafe fn resultCount(&self) -> NSUInteger; + # [method_id (resultAtIndex :)] + pub unsafe fn resultAtIndex(&self, idx: NSUInteger) -> Id; + # [method (enumerateResultsUsingBlock :)] + pub unsafe fn enumerateResultsUsingBlock(&self, block: TodoBlock); + # [method (enumerateResultsWithOptions : usingBlock :)] pub unsafe fn enumerateResultsWithOptions_usingBlock( &self, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![self, enumerateResultsWithOptions: opts, usingBlock: block] - } - pub unsafe fn results(&self) -> Id { - msg_send_id![self, results] - } - pub unsafe fn indexOfResult(&self, result: &Object) -> NSUInteger { - msg_send![self, indexOfResult: result] - } + ); + #[method_id(results)] + pub unsafe fn results(&self) -> Id; + # [method (indexOfResult :)] + pub unsafe fn indexOfResult(&self, result: &Object) -> NSUInteger; + #[method_id(valueLists)] pub unsafe fn valueLists( &self, - ) -> Id>, Shared> - { - msg_send_id![self, valueLists] - } - pub unsafe fn groupedResults(&self) -> Id, Shared> { - msg_send_id![self, groupedResults] - } + ) -> Id>, Shared>; + #[method_id(groupedResults)] + pub unsafe fn groupedResults(&self) -> Id, Shared>; + # [method_id (valueOfAttribute : forResultAtIndex :)] pub unsafe fn valueOfAttribute_forResultAtIndex( &self, attrName: &NSString, idx: NSUInteger, - ) -> Option> { - msg_send_id![self, valueOfAttribute: attrName, forResultAtIndex: idx] - } + ) -> Option>; } ); pub type NSMetadataQueryDelegate = NSObject; @@ -153,21 +115,17 @@ extern_class!( ); extern_methods!( unsafe impl NSMetadataItem { - pub unsafe fn initWithURL(&self, url: &NSURL) -> Option> { - msg_send_id![self, initWithURL: url] - } - pub unsafe fn valueForAttribute(&self, key: &NSString) -> Option> { - msg_send_id![self, valueForAttribute: key] - } + # [method_id (initWithURL :)] + pub unsafe fn initWithURL(&self, url: &NSURL) -> Option>; + # [method_id (valueForAttribute :)] + pub unsafe fn valueForAttribute(&self, key: &NSString) -> Option>; + # [method_id (valuesForAttributes :)] pub unsafe fn valuesForAttributes( &self, keys: &NSArray, - ) -> Option, Shared>> { - msg_send_id![self, valuesForAttributes: keys] - } - pub unsafe fn attributes(&self) -> Id, Shared> { - msg_send_id![self, attributes] - } + ) -> Option, Shared>>; + #[method_id(attributes)] + pub unsafe fn attributes(&self) -> Id, Shared>; } ); extern_class!( @@ -179,15 +137,12 @@ extern_class!( ); extern_methods!( unsafe impl NSMetadataQueryAttributeValueTuple { - pub unsafe fn attribute(&self) -> Id { - msg_send_id![self, attribute] - } - pub unsafe fn value(&self) -> Option> { - msg_send_id![self, value] - } - pub unsafe fn count(&self) -> NSUInteger { - msg_send![self, count] - } + #[method_id(attribute)] + pub unsafe fn attribute(&self) -> Id; + #[method_id(value)] + pub unsafe fn value(&self) -> Option>; + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; } ); extern_class!( @@ -199,23 +154,17 @@ extern_class!( ); extern_methods!( unsafe impl NSMetadataQueryResultGroup { - pub unsafe fn attribute(&self) -> Id { - msg_send_id![self, attribute] - } - pub unsafe fn value(&self) -> Id { - msg_send_id![self, value] - } - pub unsafe fn subgroups(&self) -> Option, Shared>> { - msg_send_id![self, subgroups] - } - pub unsafe fn resultCount(&self) -> NSUInteger { - msg_send![self, resultCount] - } - pub unsafe fn resultAtIndex(&self, idx: NSUInteger) -> Id { - msg_send_id![self, resultAtIndex: idx] - } - pub unsafe fn results(&self) -> Id { - msg_send_id![self, results] - } + #[method_id(attribute)] + pub unsafe fn attribute(&self) -> Id; + #[method_id(value)] + pub unsafe fn value(&self) -> Id; + #[method_id(subgroups)] + pub unsafe fn subgroups(&self) -> Option, Shared>>; + #[method(resultCount)] + pub unsafe fn resultCount(&self) -> NSUInteger; + # [method_id (resultAtIndex :)] + pub unsafe fn resultAtIndex(&self, idx: NSUInteger) -> Id; + #[method_id(results)] + pub unsafe fn results(&self) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSMetadataAttributes.rs b/icrate/src/Foundation/generated/NSMetadataAttributes.rs index 0e39aac60..249ee1e9a 100644 --- a/icrate/src/Foundation/generated/NSMetadataAttributes.rs +++ b/icrate/src/Foundation/generated/NSMetadataAttributes.rs @@ -3,4 +3,4 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; diff --git a/icrate/src/Foundation/generated/NSMethodSignature.rs b/icrate/src/Foundation/generated/NSMethodSignature.rs index 073bb999e..f9af37f69 100644 --- a/icrate/src/Foundation/generated/NSMethodSignature.rs +++ b/icrate/src/Foundation/generated/NSMethodSignature.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSMethodSignature; @@ -12,28 +12,21 @@ extern_class!( ); extern_methods!( unsafe impl NSMethodSignature { + # [method_id (signatureWithObjCTypes :)] pub unsafe fn signatureWithObjCTypes( types: NonNull, - ) -> Option> { - msg_send_id![Self::class(), signatureWithObjCTypes: types] - } - pub unsafe fn numberOfArguments(&self) -> NSUInteger { - msg_send![self, numberOfArguments] - } - pub unsafe fn getArgumentTypeAtIndex(&self, idx: NSUInteger) -> NonNull { - msg_send![self, getArgumentTypeAtIndex: idx] - } - pub unsafe fn frameLength(&self) -> NSUInteger { - msg_send![self, frameLength] - } - pub unsafe fn isOneway(&self) -> bool { - msg_send![self, isOneway] - } - pub unsafe fn methodReturnType(&self) -> NonNull { - msg_send![self, methodReturnType] - } - pub unsafe fn methodReturnLength(&self) -> NSUInteger { - msg_send![self, methodReturnLength] - } + ) -> Option>; + #[method(numberOfArguments)] + pub unsafe fn numberOfArguments(&self) -> NSUInteger; + # [method (getArgumentTypeAtIndex :)] + pub unsafe fn getArgumentTypeAtIndex(&self, idx: NSUInteger) -> NonNull; + #[method(frameLength)] + pub unsafe fn frameLength(&self) -> NSUInteger; + #[method(isOneway)] + pub unsafe fn isOneway(&self) -> bool; + #[method(methodReturnType)] + pub unsafe fn methodReturnType(&self) -> NonNull; + #[method(methodReturnLength)] + pub unsafe fn methodReturnLength(&self) -> NSUInteger; } ); diff --git a/icrate/src/Foundation/generated/NSMorphology.rs b/icrate/src/Foundation/generated/NSMorphology.rs index d68d1f973..1ccdd7876 100644 --- a/icrate/src/Foundation/generated/NSMorphology.rs +++ b/icrate/src/Foundation/generated/NSMorphology.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSString::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSMorphology; @@ -15,47 +15,34 @@ extern_class!( ); extern_methods!( unsafe impl NSMorphology { - pub unsafe fn grammaticalGender(&self) -> NSGrammaticalGender { - msg_send![self, grammaticalGender] - } - pub unsafe fn setGrammaticalGender(&self, grammaticalGender: NSGrammaticalGender) { - msg_send![self, setGrammaticalGender: grammaticalGender] - } - pub unsafe fn partOfSpeech(&self) -> NSGrammaticalPartOfSpeech { - msg_send![self, partOfSpeech] - } - pub unsafe fn setPartOfSpeech(&self, partOfSpeech: NSGrammaticalPartOfSpeech) { - msg_send![self, setPartOfSpeech: partOfSpeech] - } - pub unsafe fn number(&self) -> NSGrammaticalNumber { - msg_send![self, number] - } - pub unsafe fn setNumber(&self, number: NSGrammaticalNumber) { - msg_send![self, setNumber: number] - } + #[method(grammaticalGender)] + pub unsafe fn grammaticalGender(&self) -> NSGrammaticalGender; + # [method (setGrammaticalGender :)] + pub unsafe fn setGrammaticalGender(&self, grammaticalGender: NSGrammaticalGender); + #[method(partOfSpeech)] + pub unsafe fn partOfSpeech(&self) -> NSGrammaticalPartOfSpeech; + # [method (setPartOfSpeech :)] + pub unsafe fn setPartOfSpeech(&self, partOfSpeech: NSGrammaticalPartOfSpeech); + #[method(number)] + pub unsafe fn number(&self) -> NSGrammaticalNumber; + # [method (setNumber :)] + pub unsafe fn setNumber(&self, number: NSGrammaticalNumber); } ); extern_methods!( #[doc = "NSCustomPronouns"] unsafe impl NSMorphology { + # [method_id (customPronounForLanguage :)] pub unsafe fn customPronounForLanguage( &self, language: &NSString, - ) -> Option> { - msg_send_id![self, customPronounForLanguage: language] - } + ) -> Option>; + # [method (setCustomPronoun : forLanguage : error :)] pub unsafe fn setCustomPronoun_forLanguage_error( &self, features: Option<&NSMorphologyCustomPronoun>, language: &NSString, - ) -> Result<(), Id> { - msg_send![ - self, - setCustomPronoun: features, - forLanguage: language, - error: _ - ] - } + ) -> Result<(), Id>; } ); extern_class!( @@ -67,57 +54,39 @@ extern_class!( ); extern_methods!( unsafe impl NSMorphologyCustomPronoun { - pub unsafe fn isSupportedForLanguage(language: &NSString) -> bool { - msg_send![Self::class(), isSupportedForLanguage: language] - } - pub unsafe fn requiredKeysForLanguage( - language: &NSString, - ) -> Id, Shared> { - msg_send_id![Self::class(), requiredKeysForLanguage: language] - } - pub unsafe fn subjectForm(&self) -> Option> { - msg_send_id![self, subjectForm] - } - pub unsafe fn setSubjectForm(&self, subjectForm: Option<&NSString>) { - msg_send![self, setSubjectForm: subjectForm] - } - pub unsafe fn objectForm(&self) -> Option> { - msg_send_id![self, objectForm] - } - pub unsafe fn setObjectForm(&self, objectForm: Option<&NSString>) { - msg_send![self, setObjectForm: objectForm] - } - pub unsafe fn possessiveForm(&self) -> Option> { - msg_send_id![self, possessiveForm] - } - pub unsafe fn setPossessiveForm(&self, possessiveForm: Option<&NSString>) { - msg_send![self, setPossessiveForm: possessiveForm] - } - pub unsafe fn possessiveAdjectiveForm(&self) -> Option> { - msg_send_id![self, possessiveAdjectiveForm] - } - pub unsafe fn setPossessiveAdjectiveForm( - &self, - possessiveAdjectiveForm: Option<&NSString>, - ) { - msg_send![self, setPossessiveAdjectiveForm: possessiveAdjectiveForm] - } - pub unsafe fn reflexiveForm(&self) -> Option> { - msg_send_id![self, reflexiveForm] - } - pub unsafe fn setReflexiveForm(&self, reflexiveForm: Option<&NSString>) { - msg_send![self, setReflexiveForm: reflexiveForm] - } + # [method (isSupportedForLanguage :)] + pub unsafe fn isSupportedForLanguage(language: &NSString) -> bool; + # [method_id (requiredKeysForLanguage :)] + pub unsafe fn requiredKeysForLanguage(language: &NSString) + -> Id, Shared>; + #[method_id(subjectForm)] + pub unsafe fn subjectForm(&self) -> Option>; + # [method (setSubjectForm :)] + pub unsafe fn setSubjectForm(&self, subjectForm: Option<&NSString>); + #[method_id(objectForm)] + pub unsafe fn objectForm(&self) -> Option>; + # [method (setObjectForm :)] + pub unsafe fn setObjectForm(&self, objectForm: Option<&NSString>); + #[method_id(possessiveForm)] + pub unsafe fn possessiveForm(&self) -> Option>; + # [method (setPossessiveForm :)] + pub unsafe fn setPossessiveForm(&self, possessiveForm: Option<&NSString>); + #[method_id(possessiveAdjectiveForm)] + pub unsafe fn possessiveAdjectiveForm(&self) -> Option>; + # [method (setPossessiveAdjectiveForm :)] + pub unsafe fn setPossessiveAdjectiveForm(&self, possessiveAdjectiveForm: Option<&NSString>); + #[method_id(reflexiveForm)] + pub unsafe fn reflexiveForm(&self) -> Option>; + # [method (setReflexiveForm :)] + pub unsafe fn setReflexiveForm(&self, reflexiveForm: Option<&NSString>); } ); extern_methods!( #[doc = "NSMorphologyUserSettings"] unsafe impl NSMorphology { - pub unsafe fn isUnspecified(&self) -> bool { - msg_send![self, isUnspecified] - } - pub unsafe fn userMorphology() -> Id { - msg_send_id![Self::class(), userMorphology] - } + #[method(isUnspecified)] + pub unsafe fn isUnspecified(&self) -> bool; + #[method_id(userMorphology)] + pub unsafe fn userMorphology() -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSNetServices.rs b/icrate/src/Foundation/generated/NSNetServices.rs index cc252bd03..f7d24ffae 100644 --- a/icrate/src/Foundation/generated/NSNetServices.rs +++ b/icrate/src/Foundation/generated/NSNetServices.rs @@ -13,7 +13,7 @@ use crate::Foundation::generated::NSRunLoop::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSNetService; @@ -23,96 +23,71 @@ extern_class!( ); extern_methods!( unsafe impl NSNetService { + # [method_id (initWithDomain : type : name : port :)] pub unsafe fn initWithDomain_type_name_port( &self, domain: &NSString, type_: &NSString, name: &NSString, port: c_int, - ) -> Id { - msg_send_id ! [self , initWithDomain : domain , type : type_ , name : name , port : port] - } + ) -> Id; + # [method_id (initWithDomain : type : name :)] pub unsafe fn initWithDomain_type_name( &self, domain: &NSString, type_: &NSString, name: &NSString, - ) -> Id { - msg_send_id ! [self , initWithDomain : domain , type : type_ , name : name] - } - pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, scheduleInRunLoop: aRunLoop, forMode: mode] - } - pub unsafe fn removeFromRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, removeFromRunLoop: aRunLoop, forMode: mode] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSNetServiceDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn includesPeerToPeer(&self) -> bool { - msg_send![self, includesPeerToPeer] - } - pub unsafe fn setIncludesPeerToPeer(&self, includesPeerToPeer: bool) { - msg_send![self, setIncludesPeerToPeer: includesPeerToPeer] - } - pub unsafe fn name(&self) -> Id { - msg_send_id![self, name] - } - pub unsafe fn type_(&self) -> Id { - msg_send_id![self, type] - } - pub unsafe fn domain(&self) -> Id { - msg_send_id![self, domain] - } - pub unsafe fn hostName(&self) -> Option> { - msg_send_id![self, hostName] - } - pub unsafe fn addresses(&self) -> Option, Shared>> { - msg_send_id![self, addresses] - } - pub unsafe fn port(&self) -> NSInteger { - msg_send![self, port] - } - pub unsafe fn publish(&self) { - msg_send![self, publish] - } - pub unsafe fn publishWithOptions(&self, options: NSNetServiceOptions) { - msg_send![self, publishWithOptions: options] - } - pub unsafe fn resolve(&self) { - msg_send![self, resolve] - } - pub unsafe fn stop(&self) { - msg_send![self, stop] - } + ) -> Id; + # [method (scheduleInRunLoop : forMode :)] + pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + # [method (removeFromRunLoop : forMode :)] + pub unsafe fn removeFromRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSNetServiceDelegate>); + #[method(includesPeerToPeer)] + pub unsafe fn includesPeerToPeer(&self) -> bool; + # [method (setIncludesPeerToPeer :)] + pub unsafe fn setIncludesPeerToPeer(&self, includesPeerToPeer: bool); + #[method_id(name)] + pub unsafe fn name(&self) -> Id; + #[method_id(type)] + pub unsafe fn type_(&self) -> Id; + #[method_id(domain)] + pub unsafe fn domain(&self) -> Id; + #[method_id(hostName)] + pub unsafe fn hostName(&self) -> Option>; + #[method_id(addresses)] + pub unsafe fn addresses(&self) -> Option, Shared>>; + #[method(port)] + pub unsafe fn port(&self) -> NSInteger; + #[method(publish)] + pub unsafe fn publish(&self); + # [method (publishWithOptions :)] + pub unsafe fn publishWithOptions(&self, options: NSNetServiceOptions); + #[method(resolve)] + pub unsafe fn resolve(&self); + #[method(stop)] + pub unsafe fn stop(&self); + # [method_id (dictionaryFromTXTRecordData :)] pub unsafe fn dictionaryFromTXTRecordData( txtData: &NSData, - ) -> Id, Shared> { - msg_send_id![Self::class(), dictionaryFromTXTRecordData: txtData] - } + ) -> Id, Shared>; + # [method_id (dataFromTXTRecordDictionary :)] pub unsafe fn dataFromTXTRecordDictionary( txtDictionary: &NSDictionary, - ) -> Id { - msg_send_id![Self::class(), dataFromTXTRecordDictionary: txtDictionary] - } - pub unsafe fn resolveWithTimeout(&self, timeout: NSTimeInterval) { - msg_send![self, resolveWithTimeout: timeout] - } - pub unsafe fn setTXTRecordData(&self, recordData: Option<&NSData>) -> bool { - msg_send![self, setTXTRecordData: recordData] - } - pub unsafe fn TXTRecordData(&self) -> Option> { - msg_send_id![self, TXTRecordData] - } - pub unsafe fn startMonitoring(&self) { - msg_send![self, startMonitoring] - } - pub unsafe fn stopMonitoring(&self) { - msg_send![self, stopMonitoring] - } + ) -> Id; + # [method (resolveWithTimeout :)] + pub unsafe fn resolveWithTimeout(&self, timeout: NSTimeInterval); + # [method (setTXTRecordData :)] + pub unsafe fn setTXTRecordData(&self, recordData: Option<&NSData>) -> bool; + #[method_id(TXTRecordData)] + pub unsafe fn TXTRecordData(&self) -> Option>; + #[method(startMonitoring)] + pub unsafe fn startMonitoring(&self); + #[method(stopMonitoring)] + pub unsafe fn stopMonitoring(&self); } ); extern_class!( @@ -124,43 +99,32 @@ extern_class!( ); extern_methods!( unsafe impl NSNetServiceBrowser { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSNetServiceBrowserDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn includesPeerToPeer(&self) -> bool { - msg_send![self, includesPeerToPeer] - } - pub unsafe fn setIncludesPeerToPeer(&self, includesPeerToPeer: bool) { - msg_send![self, setIncludesPeerToPeer: includesPeerToPeer] - } - pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, scheduleInRunLoop: aRunLoop, forMode: mode] - } - pub unsafe fn removeFromRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, removeFromRunLoop: aRunLoop, forMode: mode] - } - pub unsafe fn searchForBrowsableDomains(&self) { - msg_send![self, searchForBrowsableDomains] - } - pub unsafe fn searchForRegistrationDomains(&self) { - msg_send![self, searchForRegistrationDomains] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSNetServiceBrowserDelegate>); + #[method(includesPeerToPeer)] + pub unsafe fn includesPeerToPeer(&self) -> bool; + # [method (setIncludesPeerToPeer :)] + pub unsafe fn setIncludesPeerToPeer(&self, includesPeerToPeer: bool); + # [method (scheduleInRunLoop : forMode :)] + pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + # [method (removeFromRunLoop : forMode :)] + pub unsafe fn removeFromRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + #[method(searchForBrowsableDomains)] + pub unsafe fn searchForBrowsableDomains(&self); + #[method(searchForRegistrationDomains)] + pub unsafe fn searchForRegistrationDomains(&self); + # [method (searchForServicesOfType : inDomain :)] pub unsafe fn searchForServicesOfType_inDomain( &self, type_: &NSString, domainString: &NSString, - ) { - msg_send![self, searchForServicesOfType: type_, inDomain: domainString] - } - pub unsafe fn stop(&self) { - msg_send![self, stop] - } + ); + #[method(stop)] + pub unsafe fn stop(&self); } ); pub type NSNetServiceDelegate = NSObject; diff --git a/icrate/src/Foundation/generated/NSNotification.rs b/icrate/src/Foundation/generated/NSNotification.rs index bebf8a8dc..714a9e78e 100644 --- a/icrate/src/Foundation/generated/NSNotification.rs +++ b/icrate/src/Foundation/generated/NSNotification.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSNotificationName = NSString; use super::__exported::NSDictionary; use super::__exported::NSOperationQueue; @@ -16,52 +16,39 @@ extern_class!( ); extern_methods!( unsafe impl NSNotification { - pub unsafe fn name(&self) -> Id { - msg_send_id![self, name] - } - pub unsafe fn object(&self) -> Option> { - msg_send_id![self, object] - } - pub unsafe fn userInfo(&self) -> Option> { - msg_send_id![self, userInfo] - } + #[method_id(name)] + pub unsafe fn name(&self) -> Id; + #[method_id(object)] + pub unsafe fn object(&self) -> Option>; + #[method_id(userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + # [method_id (initWithName : object : userInfo :)] pub unsafe fn initWithName_object_userInfo( &self, name: &NSNotificationName, object: Option<&Object>, userInfo: Option<&NSDictionary>, - ) -> Id { - msg_send_id![self, initWithName: name, object: object, userInfo: userInfo] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSNotificationCreation"] unsafe impl NSNotification { + # [method_id (notificationWithName : object :)] pub unsafe fn notificationWithName_object( aName: &NSNotificationName, anObject: Option<&Object>, - ) -> Id { - msg_send_id![Self::class(), notificationWithName: aName, object: anObject] - } + ) -> Id; + # [method_id (notificationWithName : object : userInfo :)] pub unsafe fn notificationWithName_object_userInfo( aName: &NSNotificationName, anObject: Option<&Object>, aUserInfo: Option<&NSDictionary>, - ) -> Id { - msg_send_id![ - Self::class(), - notificationWithName: aName, - object: anObject, - userInfo: aUserInfo - ] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + ) -> Id; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; } ); extern_class!( @@ -73,77 +60,47 @@ extern_class!( ); extern_methods!( unsafe impl NSNotificationCenter { - pub unsafe fn defaultCenter() -> Id { - msg_send_id![Self::class(), defaultCenter] - } + #[method_id(defaultCenter)] + pub unsafe fn defaultCenter() -> Id; + # [method (addObserver : selector : name : object :)] pub unsafe fn addObserver_selector_name_object( &self, observer: &Object, aSelector: Sel, aName: Option<&NSNotificationName>, anObject: Option<&Object>, - ) { - msg_send![ - self, - addObserver: observer, - selector: aSelector, - name: aName, - object: anObject - ] - } - pub unsafe fn postNotification(&self, notification: &NSNotification) { - msg_send![self, postNotification: notification] - } + ); + # [method (postNotification :)] + pub unsafe fn postNotification(&self, notification: &NSNotification); + # [method (postNotificationName : object :)] pub unsafe fn postNotificationName_object( &self, aName: &NSNotificationName, anObject: Option<&Object>, - ) { - msg_send![self, postNotificationName: aName, object: anObject] - } + ); + # [method (postNotificationName : object : userInfo :)] pub unsafe fn postNotificationName_object_userInfo( &self, aName: &NSNotificationName, anObject: Option<&Object>, aUserInfo: Option<&NSDictionary>, - ) { - msg_send![ - self, - postNotificationName: aName, - object: anObject, - userInfo: aUserInfo - ] - } - pub unsafe fn removeObserver(&self, observer: &Object) { - msg_send![self, removeObserver: observer] - } + ); + # [method (removeObserver :)] + pub unsafe fn removeObserver(&self, observer: &Object); + # [method (removeObserver : name : object :)] pub unsafe fn removeObserver_name_object( &self, observer: &Object, aName: Option<&NSNotificationName>, anObject: Option<&Object>, - ) { - msg_send![ - self, - removeObserver: observer, - name: aName, - object: anObject - ] - } + ); + # [method_id (addObserverForName : object : queue : usingBlock :)] pub unsafe fn addObserverForName_object_queue_usingBlock( &self, name: Option<&NSNotificationName>, obj: Option<&Object>, queue: Option<&NSOperationQueue>, block: TodoBlock, - ) -> Id { - msg_send_id![ - self, - addObserverForName: name, - object: obj, - queue: queue, - usingBlock: block - ] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSNotificationQueue.rs b/icrate/src/Foundation/generated/NSNotificationQueue.rs index fc26345d3..bed331d4c 100644 --- a/icrate/src/Foundation/generated/NSNotificationQueue.rs +++ b/icrate/src/Foundation/generated/NSNotificationQueue.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSRunLoop::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSNotificationQueue; @@ -17,51 +17,32 @@ extern_class!( ); extern_methods!( unsafe impl NSNotificationQueue { - pub unsafe fn defaultQueue() -> Id { - msg_send_id![Self::class(), defaultQueue] - } + #[method_id(defaultQueue)] + pub unsafe fn defaultQueue() -> Id; + # [method_id (initWithNotificationCenter :)] pub unsafe fn initWithNotificationCenter( &self, notificationCenter: &NSNotificationCenter, - ) -> Id { - msg_send_id![self, initWithNotificationCenter: notificationCenter] - } + ) -> Id; + # [method (enqueueNotification : postingStyle :)] pub unsafe fn enqueueNotification_postingStyle( &self, notification: &NSNotification, postingStyle: NSPostingStyle, - ) { - msg_send![ - self, - enqueueNotification: notification, - postingStyle: postingStyle - ] - } + ); + # [method (enqueueNotification : postingStyle : coalesceMask : forModes :)] pub unsafe fn enqueueNotification_postingStyle_coalesceMask_forModes( &self, notification: &NSNotification, postingStyle: NSPostingStyle, coalesceMask: NSNotificationCoalescing, modes: Option<&NSArray>, - ) { - msg_send![ - self, - enqueueNotification: notification, - postingStyle: postingStyle, - coalesceMask: coalesceMask, - forModes: modes - ] - } + ); + # [method (dequeueNotificationsMatching : coalesceMask :)] pub unsafe fn dequeueNotificationsMatching_coalesceMask( &self, notification: &NSNotification, coalesceMask: NSUInteger, - ) { - msg_send![ - self, - dequeueNotificationsMatching: notification, - coalesceMask: coalesceMask - ] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSNull.rs b/icrate/src/Foundation/generated/NSNull.rs index 52c854d14..29bac3d66 100644 --- a/icrate/src/Foundation/generated/NSNull.rs +++ b/icrate/src/Foundation/generated/NSNull.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSNull; @@ -12,8 +12,7 @@ extern_class!( ); extern_methods!( unsafe impl NSNull { - pub unsafe fn null() -> Id { - msg_send_id![Self::class(), null] - } + #[method_id(null)] + pub unsafe fn null() -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSNumberFormatter.rs b/icrate/src/Foundation/generated/NSNumberFormatter.rs index 40b8f9e81..7d934b257 100644 --- a/icrate/src/Foundation/generated/NSNumberFormatter.rs +++ b/icrate/src/Foundation/generated/NSNumberFormatter.rs @@ -9,7 +9,7 @@ use crate::Foundation::generated::NSFormatter::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSNumberFormatter; @@ -19,523 +19,344 @@ extern_class!( ); extern_methods!( unsafe impl NSNumberFormatter { - pub unsafe fn formattingContext(&self) -> NSFormattingContext { - msg_send![self, formattingContext] - } - pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext) { - msg_send![self, setFormattingContext: formattingContext] - } + #[method(formattingContext)] + pub unsafe fn formattingContext(&self) -> NSFormattingContext; + # [method (setFormattingContext :)] + pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext); + # [method (getObjectValue : forString : range : error :)] pub unsafe fn getObjectValue_forString_range_error( &self, obj: Option<&mut Option>>, string: &NSString, rangep: *mut NSRange, - ) -> Result<(), Id> { - msg_send![ - self, - getObjectValue: obj, - forString: string, - range: rangep, - error: _ - ] - } - pub unsafe fn stringFromNumber(&self, number: &NSNumber) -> Option> { - msg_send_id![self, stringFromNumber: number] - } - pub unsafe fn numberFromString(&self, string: &NSString) -> Option> { - msg_send_id![self, numberFromString: string] - } + ) -> Result<(), Id>; + # [method_id (stringFromNumber :)] + pub unsafe fn stringFromNumber(&self, number: &NSNumber) -> Option>; + # [method_id (numberFromString :)] + pub unsafe fn numberFromString(&self, string: &NSString) -> Option>; + # [method_id (localizedStringFromNumber : numberStyle :)] pub unsafe fn localizedStringFromNumber_numberStyle( num: &NSNumber, nstyle: NSNumberFormatterStyle, - ) -> Id { - msg_send_id![ - Self::class(), - localizedStringFromNumber: num, - numberStyle: nstyle - ] - } - pub unsafe fn defaultFormatterBehavior() -> NSNumberFormatterBehavior { - msg_send![Self::class(), defaultFormatterBehavior] - } - pub unsafe fn setDefaultFormatterBehavior(behavior: NSNumberFormatterBehavior) { - msg_send![Self::class(), setDefaultFormatterBehavior: behavior] - } - pub unsafe fn numberStyle(&self) -> NSNumberFormatterStyle { - msg_send![self, numberStyle] - } - pub unsafe fn setNumberStyle(&self, numberStyle: NSNumberFormatterStyle) { - msg_send![self, setNumberStyle: numberStyle] - } - pub unsafe fn locale(&self) -> Id { - msg_send_id![self, locale] - } - pub unsafe fn setLocale(&self, locale: Option<&NSLocale>) { - msg_send![self, setLocale: locale] - } - pub unsafe fn generatesDecimalNumbers(&self) -> bool { - msg_send![self, generatesDecimalNumbers] - } - pub unsafe fn setGeneratesDecimalNumbers(&self, generatesDecimalNumbers: bool) { - msg_send![self, setGeneratesDecimalNumbers: generatesDecimalNumbers] - } - pub unsafe fn formatterBehavior(&self) -> NSNumberFormatterBehavior { - msg_send![self, formatterBehavior] - } - pub unsafe fn setFormatterBehavior(&self, formatterBehavior: NSNumberFormatterBehavior) { - msg_send![self, setFormatterBehavior: formatterBehavior] - } - pub unsafe fn negativeFormat(&self) -> Id { - msg_send_id![self, negativeFormat] - } - pub unsafe fn setNegativeFormat(&self, negativeFormat: Option<&NSString>) { - msg_send![self, setNegativeFormat: negativeFormat] - } + ) -> Id; + #[method(defaultFormatterBehavior)] + pub unsafe fn defaultFormatterBehavior() -> NSNumberFormatterBehavior; + # [method (setDefaultFormatterBehavior :)] + pub unsafe fn setDefaultFormatterBehavior(behavior: NSNumberFormatterBehavior); + #[method(numberStyle)] + pub unsafe fn numberStyle(&self) -> NSNumberFormatterStyle; + # [method (setNumberStyle :)] + pub unsafe fn setNumberStyle(&self, numberStyle: NSNumberFormatterStyle); + #[method_id(locale)] + pub unsafe fn locale(&self) -> Id; + # [method (setLocale :)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + #[method(generatesDecimalNumbers)] + pub unsafe fn generatesDecimalNumbers(&self) -> bool; + # [method (setGeneratesDecimalNumbers :)] + pub unsafe fn setGeneratesDecimalNumbers(&self, generatesDecimalNumbers: bool); + #[method(formatterBehavior)] + pub unsafe fn formatterBehavior(&self) -> NSNumberFormatterBehavior; + # [method (setFormatterBehavior :)] + pub unsafe fn setFormatterBehavior(&self, formatterBehavior: NSNumberFormatterBehavior); + #[method_id(negativeFormat)] + pub unsafe fn negativeFormat(&self) -> Id; + # [method (setNegativeFormat :)] + pub unsafe fn setNegativeFormat(&self, negativeFormat: Option<&NSString>); + #[method_id(textAttributesForNegativeValues)] pub unsafe fn textAttributesForNegativeValues( &self, - ) -> Option, Shared>> { - msg_send_id![self, textAttributesForNegativeValues] - } + ) -> Option, Shared>>; + # [method (setTextAttributesForNegativeValues :)] pub unsafe fn setTextAttributesForNegativeValues( &self, textAttributesForNegativeValues: Option<&NSDictionary>, - ) { - msg_send![ - self, - setTextAttributesForNegativeValues: textAttributesForNegativeValues - ] - } - pub unsafe fn positiveFormat(&self) -> Id { - msg_send_id![self, positiveFormat] - } - pub unsafe fn setPositiveFormat(&self, positiveFormat: Option<&NSString>) { - msg_send![self, setPositiveFormat: positiveFormat] - } + ); + #[method_id(positiveFormat)] + pub unsafe fn positiveFormat(&self) -> Id; + # [method (setPositiveFormat :)] + pub unsafe fn setPositiveFormat(&self, positiveFormat: Option<&NSString>); + #[method_id(textAttributesForPositiveValues)] pub unsafe fn textAttributesForPositiveValues( &self, - ) -> Option, Shared>> { - msg_send_id![self, textAttributesForPositiveValues] - } + ) -> Option, Shared>>; + # [method (setTextAttributesForPositiveValues :)] pub unsafe fn setTextAttributesForPositiveValues( &self, textAttributesForPositiveValues: Option<&NSDictionary>, - ) { - msg_send![ - self, - setTextAttributesForPositiveValues: textAttributesForPositiveValues - ] - } - pub unsafe fn allowsFloats(&self) -> bool { - msg_send![self, allowsFloats] - } - pub unsafe fn setAllowsFloats(&self, allowsFloats: bool) { - msg_send![self, setAllowsFloats: allowsFloats] - } - pub unsafe fn decimalSeparator(&self) -> Id { - msg_send_id![self, decimalSeparator] - } - pub unsafe fn setDecimalSeparator(&self, decimalSeparator: Option<&NSString>) { - msg_send![self, setDecimalSeparator: decimalSeparator] - } - pub unsafe fn alwaysShowsDecimalSeparator(&self) -> bool { - msg_send![self, alwaysShowsDecimalSeparator] - } - pub unsafe fn setAlwaysShowsDecimalSeparator(&self, alwaysShowsDecimalSeparator: bool) { - msg_send![ - self, - setAlwaysShowsDecimalSeparator: alwaysShowsDecimalSeparator - ] - } - pub unsafe fn currencyDecimalSeparator(&self) -> Id { - msg_send_id![self, currencyDecimalSeparator] - } + ); + #[method(allowsFloats)] + pub unsafe fn allowsFloats(&self) -> bool; + # [method (setAllowsFloats :)] + pub unsafe fn setAllowsFloats(&self, allowsFloats: bool); + #[method_id(decimalSeparator)] + pub unsafe fn decimalSeparator(&self) -> Id; + # [method (setDecimalSeparator :)] + pub unsafe fn setDecimalSeparator(&self, decimalSeparator: Option<&NSString>); + #[method(alwaysShowsDecimalSeparator)] + pub unsafe fn alwaysShowsDecimalSeparator(&self) -> bool; + # [method (setAlwaysShowsDecimalSeparator :)] + pub unsafe fn setAlwaysShowsDecimalSeparator(&self, alwaysShowsDecimalSeparator: bool); + #[method_id(currencyDecimalSeparator)] + pub unsafe fn currencyDecimalSeparator(&self) -> Id; + # [method (setCurrencyDecimalSeparator :)] pub unsafe fn setCurrencyDecimalSeparator( &self, currencyDecimalSeparator: Option<&NSString>, - ) { - msg_send![self, setCurrencyDecimalSeparator: currencyDecimalSeparator] - } - pub unsafe fn usesGroupingSeparator(&self) -> bool { - msg_send![self, usesGroupingSeparator] - } - pub unsafe fn setUsesGroupingSeparator(&self, usesGroupingSeparator: bool) { - msg_send![self, setUsesGroupingSeparator: usesGroupingSeparator] - } - pub unsafe fn groupingSeparator(&self) -> Id { - msg_send_id![self, groupingSeparator] - } - pub unsafe fn setGroupingSeparator(&self, groupingSeparator: Option<&NSString>) { - msg_send![self, setGroupingSeparator: groupingSeparator] - } - pub unsafe fn zeroSymbol(&self) -> Option> { - msg_send_id![self, zeroSymbol] - } - pub unsafe fn setZeroSymbol(&self, zeroSymbol: Option<&NSString>) { - msg_send![self, setZeroSymbol: zeroSymbol] - } + ); + #[method(usesGroupingSeparator)] + pub unsafe fn usesGroupingSeparator(&self) -> bool; + # [method (setUsesGroupingSeparator :)] + pub unsafe fn setUsesGroupingSeparator(&self, usesGroupingSeparator: bool); + #[method_id(groupingSeparator)] + pub unsafe fn groupingSeparator(&self) -> Id; + # [method (setGroupingSeparator :)] + pub unsafe fn setGroupingSeparator(&self, groupingSeparator: Option<&NSString>); + #[method_id(zeroSymbol)] + pub unsafe fn zeroSymbol(&self) -> Option>; + # [method (setZeroSymbol :)] + pub unsafe fn setZeroSymbol(&self, zeroSymbol: Option<&NSString>); + #[method_id(textAttributesForZero)] pub unsafe fn textAttributesForZero( &self, - ) -> Option, Shared>> { - msg_send_id![self, textAttributesForZero] - } + ) -> Option, Shared>>; + # [method (setTextAttributesForZero :)] pub unsafe fn setTextAttributesForZero( &self, textAttributesForZero: Option<&NSDictionary>, - ) { - msg_send![self, setTextAttributesForZero: textAttributesForZero] - } - pub unsafe fn nilSymbol(&self) -> Id { - msg_send_id![self, nilSymbol] - } - pub unsafe fn setNilSymbol(&self, nilSymbol: &NSString) { - msg_send![self, setNilSymbol: nilSymbol] - } + ); + #[method_id(nilSymbol)] + pub unsafe fn nilSymbol(&self) -> Id; + # [method (setNilSymbol :)] + pub unsafe fn setNilSymbol(&self, nilSymbol: &NSString); + #[method_id(textAttributesForNil)] pub unsafe fn textAttributesForNil( &self, - ) -> Option, Shared>> { - msg_send_id![self, textAttributesForNil] - } + ) -> Option, Shared>>; + # [method (setTextAttributesForNil :)] pub unsafe fn setTextAttributesForNil( &self, textAttributesForNil: Option<&NSDictionary>, - ) { - msg_send![self, setTextAttributesForNil: textAttributesForNil] - } - pub unsafe fn notANumberSymbol(&self) -> Id { - msg_send_id![self, notANumberSymbol] - } - pub unsafe fn setNotANumberSymbol(&self, notANumberSymbol: Option<&NSString>) { - msg_send![self, setNotANumberSymbol: notANumberSymbol] - } + ); + #[method_id(notANumberSymbol)] + pub unsafe fn notANumberSymbol(&self) -> Id; + # [method (setNotANumberSymbol :)] + pub unsafe fn setNotANumberSymbol(&self, notANumberSymbol: Option<&NSString>); + #[method_id(textAttributesForNotANumber)] pub unsafe fn textAttributesForNotANumber( &self, - ) -> Option, Shared>> { - msg_send_id![self, textAttributesForNotANumber] - } + ) -> Option, Shared>>; + # [method (setTextAttributesForNotANumber :)] pub unsafe fn setTextAttributesForNotANumber( &self, textAttributesForNotANumber: Option<&NSDictionary>, - ) { - msg_send![ - self, - setTextAttributesForNotANumber: textAttributesForNotANumber - ] - } - pub unsafe fn positiveInfinitySymbol(&self) -> Id { - msg_send_id![self, positiveInfinitySymbol] - } - pub unsafe fn setPositiveInfinitySymbol(&self, positiveInfinitySymbol: &NSString) { - msg_send![self, setPositiveInfinitySymbol: positiveInfinitySymbol] - } + ); + #[method_id(positiveInfinitySymbol)] + pub unsafe fn positiveInfinitySymbol(&self) -> Id; + # [method (setPositiveInfinitySymbol :)] + pub unsafe fn setPositiveInfinitySymbol(&self, positiveInfinitySymbol: &NSString); + #[method_id(textAttributesForPositiveInfinity)] pub unsafe fn textAttributesForPositiveInfinity( &self, - ) -> Option, Shared>> { - msg_send_id![self, textAttributesForPositiveInfinity] - } + ) -> Option, Shared>>; + # [method (setTextAttributesForPositiveInfinity :)] pub unsafe fn setTextAttributesForPositiveInfinity( &self, textAttributesForPositiveInfinity: Option<&NSDictionary>, - ) { - msg_send![ - self, - setTextAttributesForPositiveInfinity: textAttributesForPositiveInfinity - ] - } - pub unsafe fn negativeInfinitySymbol(&self) -> Id { - msg_send_id![self, negativeInfinitySymbol] - } - pub unsafe fn setNegativeInfinitySymbol(&self, negativeInfinitySymbol: &NSString) { - msg_send![self, setNegativeInfinitySymbol: negativeInfinitySymbol] - } + ); + #[method_id(negativeInfinitySymbol)] + pub unsafe fn negativeInfinitySymbol(&self) -> Id; + # [method (setNegativeInfinitySymbol :)] + pub unsafe fn setNegativeInfinitySymbol(&self, negativeInfinitySymbol: &NSString); + #[method_id(textAttributesForNegativeInfinity)] pub unsafe fn textAttributesForNegativeInfinity( &self, - ) -> Option, Shared>> { - msg_send_id![self, textAttributesForNegativeInfinity] - } + ) -> Option, Shared>>; + # [method (setTextAttributesForNegativeInfinity :)] pub unsafe fn setTextAttributesForNegativeInfinity( &self, textAttributesForNegativeInfinity: Option<&NSDictionary>, - ) { - msg_send![ - self, - setTextAttributesForNegativeInfinity: textAttributesForNegativeInfinity - ] - } - pub unsafe fn positivePrefix(&self) -> Id { - msg_send_id![self, positivePrefix] - } - pub unsafe fn setPositivePrefix(&self, positivePrefix: Option<&NSString>) { - msg_send![self, setPositivePrefix: positivePrefix] - } - pub unsafe fn positiveSuffix(&self) -> Id { - msg_send_id![self, positiveSuffix] - } - pub unsafe fn setPositiveSuffix(&self, positiveSuffix: Option<&NSString>) { - msg_send![self, setPositiveSuffix: positiveSuffix] - } - pub unsafe fn negativePrefix(&self) -> Id { - msg_send_id![self, negativePrefix] - } - pub unsafe fn setNegativePrefix(&self, negativePrefix: Option<&NSString>) { - msg_send![self, setNegativePrefix: negativePrefix] - } - pub unsafe fn negativeSuffix(&self) -> Id { - msg_send_id![self, negativeSuffix] - } - pub unsafe fn setNegativeSuffix(&self, negativeSuffix: Option<&NSString>) { - msg_send![self, setNegativeSuffix: negativeSuffix] - } - pub unsafe fn currencyCode(&self) -> Id { - msg_send_id![self, currencyCode] - } - pub unsafe fn setCurrencyCode(&self, currencyCode: Option<&NSString>) { - msg_send![self, setCurrencyCode: currencyCode] - } - pub unsafe fn currencySymbol(&self) -> Id { - msg_send_id![self, currencySymbol] - } - pub unsafe fn setCurrencySymbol(&self, currencySymbol: Option<&NSString>) { - msg_send![self, setCurrencySymbol: currencySymbol] - } - pub unsafe fn internationalCurrencySymbol(&self) -> Id { - msg_send_id![self, internationalCurrencySymbol] - } + ); + #[method_id(positivePrefix)] + pub unsafe fn positivePrefix(&self) -> Id; + # [method (setPositivePrefix :)] + pub unsafe fn setPositivePrefix(&self, positivePrefix: Option<&NSString>); + #[method_id(positiveSuffix)] + pub unsafe fn positiveSuffix(&self) -> Id; + # [method (setPositiveSuffix :)] + pub unsafe fn setPositiveSuffix(&self, positiveSuffix: Option<&NSString>); + #[method_id(negativePrefix)] + pub unsafe fn negativePrefix(&self) -> Id; + # [method (setNegativePrefix :)] + pub unsafe fn setNegativePrefix(&self, negativePrefix: Option<&NSString>); + #[method_id(negativeSuffix)] + pub unsafe fn negativeSuffix(&self) -> Id; + # [method (setNegativeSuffix :)] + pub unsafe fn setNegativeSuffix(&self, negativeSuffix: Option<&NSString>); + #[method_id(currencyCode)] + pub unsafe fn currencyCode(&self) -> Id; + # [method (setCurrencyCode :)] + pub unsafe fn setCurrencyCode(&self, currencyCode: Option<&NSString>); + #[method_id(currencySymbol)] + pub unsafe fn currencySymbol(&self) -> Id; + # [method (setCurrencySymbol :)] + pub unsafe fn setCurrencySymbol(&self, currencySymbol: Option<&NSString>); + #[method_id(internationalCurrencySymbol)] + pub unsafe fn internationalCurrencySymbol(&self) -> Id; + # [method (setInternationalCurrencySymbol :)] pub unsafe fn setInternationalCurrencySymbol( &self, internationalCurrencySymbol: Option<&NSString>, - ) { - msg_send![ - self, - setInternationalCurrencySymbol: internationalCurrencySymbol - ] - } - pub unsafe fn percentSymbol(&self) -> Id { - msg_send_id![self, percentSymbol] - } - pub unsafe fn setPercentSymbol(&self, percentSymbol: Option<&NSString>) { - msg_send![self, setPercentSymbol: percentSymbol] - } - pub unsafe fn perMillSymbol(&self) -> Id { - msg_send_id![self, perMillSymbol] - } - pub unsafe fn setPerMillSymbol(&self, perMillSymbol: Option<&NSString>) { - msg_send![self, setPerMillSymbol: perMillSymbol] - } - pub unsafe fn minusSign(&self) -> Id { - msg_send_id![self, minusSign] - } - pub unsafe fn setMinusSign(&self, minusSign: Option<&NSString>) { - msg_send![self, setMinusSign: minusSign] - } - pub unsafe fn plusSign(&self) -> Id { - msg_send_id![self, plusSign] - } - pub unsafe fn setPlusSign(&self, plusSign: Option<&NSString>) { - msg_send![self, setPlusSign: plusSign] - } - pub unsafe fn exponentSymbol(&self) -> Id { - msg_send_id![self, exponentSymbol] - } - pub unsafe fn setExponentSymbol(&self, exponentSymbol: Option<&NSString>) { - msg_send![self, setExponentSymbol: exponentSymbol] - } - pub unsafe fn groupingSize(&self) -> NSUInteger { - msg_send![self, groupingSize] - } - pub unsafe fn setGroupingSize(&self, groupingSize: NSUInteger) { - msg_send![self, setGroupingSize: groupingSize] - } - pub unsafe fn secondaryGroupingSize(&self) -> NSUInteger { - msg_send![self, secondaryGroupingSize] - } - pub unsafe fn setSecondaryGroupingSize(&self, secondaryGroupingSize: NSUInteger) { - msg_send![self, setSecondaryGroupingSize: secondaryGroupingSize] - } - pub unsafe fn multiplier(&self) -> Option> { - msg_send_id![self, multiplier] - } - pub unsafe fn setMultiplier(&self, multiplier: Option<&NSNumber>) { - msg_send![self, setMultiplier: multiplier] - } - pub unsafe fn formatWidth(&self) -> NSUInteger { - msg_send![self, formatWidth] - } - pub unsafe fn setFormatWidth(&self, formatWidth: NSUInteger) { - msg_send![self, setFormatWidth: formatWidth] - } - pub unsafe fn paddingCharacter(&self) -> Id { - msg_send_id![self, paddingCharacter] - } - pub unsafe fn setPaddingCharacter(&self, paddingCharacter: Option<&NSString>) { - msg_send![self, setPaddingCharacter: paddingCharacter] - } - pub unsafe fn paddingPosition(&self) -> NSNumberFormatterPadPosition { - msg_send![self, paddingPosition] - } - pub unsafe fn setPaddingPosition(&self, paddingPosition: NSNumberFormatterPadPosition) { - msg_send![self, setPaddingPosition: paddingPosition] - } - pub unsafe fn roundingMode(&self) -> NSNumberFormatterRoundingMode { - msg_send![self, roundingMode] - } - pub unsafe fn setRoundingMode(&self, roundingMode: NSNumberFormatterRoundingMode) { - msg_send![self, setRoundingMode: roundingMode] - } - pub unsafe fn roundingIncrement(&self) -> Id { - msg_send_id![self, roundingIncrement] - } - pub unsafe fn setRoundingIncrement(&self, roundingIncrement: Option<&NSNumber>) { - msg_send![self, setRoundingIncrement: roundingIncrement] - } - pub unsafe fn minimumIntegerDigits(&self) -> NSUInteger { - msg_send![self, minimumIntegerDigits] - } - pub unsafe fn setMinimumIntegerDigits(&self, minimumIntegerDigits: NSUInteger) { - msg_send![self, setMinimumIntegerDigits: minimumIntegerDigits] - } - pub unsafe fn maximumIntegerDigits(&self) -> NSUInteger { - msg_send![self, maximumIntegerDigits] - } - pub unsafe fn setMaximumIntegerDigits(&self, maximumIntegerDigits: NSUInteger) { - msg_send![self, setMaximumIntegerDigits: maximumIntegerDigits] - } - pub unsafe fn minimumFractionDigits(&self) -> NSUInteger { - msg_send![self, minimumFractionDigits] - } - pub unsafe fn setMinimumFractionDigits(&self, minimumFractionDigits: NSUInteger) { - msg_send![self, setMinimumFractionDigits: minimumFractionDigits] - } - pub unsafe fn maximumFractionDigits(&self) -> NSUInteger { - msg_send![self, maximumFractionDigits] - } - pub unsafe fn setMaximumFractionDigits(&self, maximumFractionDigits: NSUInteger) { - msg_send![self, setMaximumFractionDigits: maximumFractionDigits] - } - pub unsafe fn minimum(&self) -> Option> { - msg_send_id![self, minimum] - } - pub unsafe fn setMinimum(&self, minimum: Option<&NSNumber>) { - msg_send![self, setMinimum: minimum] - } - pub unsafe fn maximum(&self) -> Option> { - msg_send_id![self, maximum] - } - pub unsafe fn setMaximum(&self, maximum: Option<&NSNumber>) { - msg_send![self, setMaximum: maximum] - } - pub unsafe fn currencyGroupingSeparator(&self) -> Id { - msg_send_id![self, currencyGroupingSeparator] - } + ); + #[method_id(percentSymbol)] + pub unsafe fn percentSymbol(&self) -> Id; + # [method (setPercentSymbol :)] + pub unsafe fn setPercentSymbol(&self, percentSymbol: Option<&NSString>); + #[method_id(perMillSymbol)] + pub unsafe fn perMillSymbol(&self) -> Id; + # [method (setPerMillSymbol :)] + pub unsafe fn setPerMillSymbol(&self, perMillSymbol: Option<&NSString>); + #[method_id(minusSign)] + pub unsafe fn minusSign(&self) -> Id; + # [method (setMinusSign :)] + pub unsafe fn setMinusSign(&self, minusSign: Option<&NSString>); + #[method_id(plusSign)] + pub unsafe fn plusSign(&self) -> Id; + # [method (setPlusSign :)] + pub unsafe fn setPlusSign(&self, plusSign: Option<&NSString>); + #[method_id(exponentSymbol)] + pub unsafe fn exponentSymbol(&self) -> Id; + # [method (setExponentSymbol :)] + pub unsafe fn setExponentSymbol(&self, exponentSymbol: Option<&NSString>); + #[method(groupingSize)] + pub unsafe fn groupingSize(&self) -> NSUInteger; + # [method (setGroupingSize :)] + pub unsafe fn setGroupingSize(&self, groupingSize: NSUInteger); + #[method(secondaryGroupingSize)] + pub unsafe fn secondaryGroupingSize(&self) -> NSUInteger; + # [method (setSecondaryGroupingSize :)] + pub unsafe fn setSecondaryGroupingSize(&self, secondaryGroupingSize: NSUInteger); + #[method_id(multiplier)] + pub unsafe fn multiplier(&self) -> Option>; + # [method (setMultiplier :)] + pub unsafe fn setMultiplier(&self, multiplier: Option<&NSNumber>); + #[method(formatWidth)] + pub unsafe fn formatWidth(&self) -> NSUInteger; + # [method (setFormatWidth :)] + pub unsafe fn setFormatWidth(&self, formatWidth: NSUInteger); + #[method_id(paddingCharacter)] + pub unsafe fn paddingCharacter(&self) -> Id; + # [method (setPaddingCharacter :)] + pub unsafe fn setPaddingCharacter(&self, paddingCharacter: Option<&NSString>); + #[method(paddingPosition)] + pub unsafe fn paddingPosition(&self) -> NSNumberFormatterPadPosition; + # [method (setPaddingPosition :)] + pub unsafe fn setPaddingPosition(&self, paddingPosition: NSNumberFormatterPadPosition); + #[method(roundingMode)] + pub unsafe fn roundingMode(&self) -> NSNumberFormatterRoundingMode; + # [method (setRoundingMode :)] + pub unsafe fn setRoundingMode(&self, roundingMode: NSNumberFormatterRoundingMode); + #[method_id(roundingIncrement)] + pub unsafe fn roundingIncrement(&self) -> Id; + # [method (setRoundingIncrement :)] + pub unsafe fn setRoundingIncrement(&self, roundingIncrement: Option<&NSNumber>); + #[method(minimumIntegerDigits)] + pub unsafe fn minimumIntegerDigits(&self) -> NSUInteger; + # [method (setMinimumIntegerDigits :)] + pub unsafe fn setMinimumIntegerDigits(&self, minimumIntegerDigits: NSUInteger); + #[method(maximumIntegerDigits)] + pub unsafe fn maximumIntegerDigits(&self) -> NSUInteger; + # [method (setMaximumIntegerDigits :)] + pub unsafe fn setMaximumIntegerDigits(&self, maximumIntegerDigits: NSUInteger); + #[method(minimumFractionDigits)] + pub unsafe fn minimumFractionDigits(&self) -> NSUInteger; + # [method (setMinimumFractionDigits :)] + pub unsafe fn setMinimumFractionDigits(&self, minimumFractionDigits: NSUInteger); + #[method(maximumFractionDigits)] + pub unsafe fn maximumFractionDigits(&self) -> NSUInteger; + # [method (setMaximumFractionDigits :)] + pub unsafe fn setMaximumFractionDigits(&self, maximumFractionDigits: NSUInteger); + #[method_id(minimum)] + pub unsafe fn minimum(&self) -> Option>; + # [method (setMinimum :)] + pub unsafe fn setMinimum(&self, minimum: Option<&NSNumber>); + #[method_id(maximum)] + pub unsafe fn maximum(&self) -> Option>; + # [method (setMaximum :)] + pub unsafe fn setMaximum(&self, maximum: Option<&NSNumber>); + #[method_id(currencyGroupingSeparator)] + pub unsafe fn currencyGroupingSeparator(&self) -> Id; + # [method (setCurrencyGroupingSeparator :)] pub unsafe fn setCurrencyGroupingSeparator( &self, currencyGroupingSeparator: Option<&NSString>, - ) { - msg_send![ - self, - setCurrencyGroupingSeparator: currencyGroupingSeparator - ] - } - pub unsafe fn isLenient(&self) -> bool { - msg_send![self, isLenient] - } - pub unsafe fn setLenient(&self, lenient: bool) { - msg_send![self, setLenient: lenient] - } - pub unsafe fn usesSignificantDigits(&self) -> bool { - msg_send![self, usesSignificantDigits] - } - pub unsafe fn setUsesSignificantDigits(&self, usesSignificantDigits: bool) { - msg_send![self, setUsesSignificantDigits: usesSignificantDigits] - } - pub unsafe fn minimumSignificantDigits(&self) -> NSUInteger { - msg_send![self, minimumSignificantDigits] - } - pub unsafe fn setMinimumSignificantDigits(&self, minimumSignificantDigits: NSUInteger) { - msg_send![self, setMinimumSignificantDigits: minimumSignificantDigits] - } - pub unsafe fn maximumSignificantDigits(&self) -> NSUInteger { - msg_send![self, maximumSignificantDigits] - } - pub unsafe fn setMaximumSignificantDigits(&self, maximumSignificantDigits: NSUInteger) { - msg_send![self, setMaximumSignificantDigits: maximumSignificantDigits] - } - pub unsafe fn isPartialStringValidationEnabled(&self) -> bool { - msg_send![self, isPartialStringValidationEnabled] - } + ); + #[method(isLenient)] + pub unsafe fn isLenient(&self) -> bool; + # [method (setLenient :)] + pub unsafe fn setLenient(&self, lenient: bool); + #[method(usesSignificantDigits)] + pub unsafe fn usesSignificantDigits(&self) -> bool; + # [method (setUsesSignificantDigits :)] + pub unsafe fn setUsesSignificantDigits(&self, usesSignificantDigits: bool); + #[method(minimumSignificantDigits)] + pub unsafe fn minimumSignificantDigits(&self) -> NSUInteger; + # [method (setMinimumSignificantDigits :)] + pub unsafe fn setMinimumSignificantDigits(&self, minimumSignificantDigits: NSUInteger); + #[method(maximumSignificantDigits)] + pub unsafe fn maximumSignificantDigits(&self) -> NSUInteger; + # [method (setMaximumSignificantDigits :)] + pub unsafe fn setMaximumSignificantDigits(&self, maximumSignificantDigits: NSUInteger); + #[method(isPartialStringValidationEnabled)] + pub unsafe fn isPartialStringValidationEnabled(&self) -> bool; + # [method (setPartialStringValidationEnabled :)] pub unsafe fn setPartialStringValidationEnabled( &self, partialStringValidationEnabled: bool, - ) { - msg_send![ - self, - setPartialStringValidationEnabled: partialStringValidationEnabled - ] - } + ); } ); use super::__exported::NSDecimalNumberHandler; extern_methods!( #[doc = "NSNumberFormatterCompatibility"] unsafe impl NSNumberFormatter { - pub unsafe fn hasThousandSeparators(&self) -> bool { - msg_send![self, hasThousandSeparators] - } - pub unsafe fn setHasThousandSeparators(&self, hasThousandSeparators: bool) { - msg_send![self, setHasThousandSeparators: hasThousandSeparators] - } - pub unsafe fn thousandSeparator(&self) -> Id { - msg_send_id![self, thousandSeparator] - } - pub unsafe fn setThousandSeparator(&self, thousandSeparator: Option<&NSString>) { - msg_send![self, setThousandSeparator: thousandSeparator] - } - pub unsafe fn localizesFormat(&self) -> bool { - msg_send![self, localizesFormat] - } - pub unsafe fn setLocalizesFormat(&self, localizesFormat: bool) { - msg_send![self, setLocalizesFormat: localizesFormat] - } - pub unsafe fn format(&self) -> Id { - msg_send_id![self, format] - } - pub unsafe fn setFormat(&self, format: &NSString) { - msg_send![self, setFormat: format] - } - pub unsafe fn attributedStringForZero(&self) -> Id { - msg_send_id![self, attributedStringForZero] - } + #[method(hasThousandSeparators)] + pub unsafe fn hasThousandSeparators(&self) -> bool; + # [method (setHasThousandSeparators :)] + pub unsafe fn setHasThousandSeparators(&self, hasThousandSeparators: bool); + #[method_id(thousandSeparator)] + pub unsafe fn thousandSeparator(&self) -> Id; + # [method (setThousandSeparator :)] + pub unsafe fn setThousandSeparator(&self, thousandSeparator: Option<&NSString>); + #[method(localizesFormat)] + pub unsafe fn localizesFormat(&self) -> bool; + # [method (setLocalizesFormat :)] + pub unsafe fn setLocalizesFormat(&self, localizesFormat: bool); + #[method_id(format)] + pub unsafe fn format(&self) -> Id; + # [method (setFormat :)] + pub unsafe fn setFormat(&self, format: &NSString); + #[method_id(attributedStringForZero)] + pub unsafe fn attributedStringForZero(&self) -> Id; + # [method (setAttributedStringForZero :)] pub unsafe fn setAttributedStringForZero( &self, attributedStringForZero: &NSAttributedString, - ) { - msg_send![self, setAttributedStringForZero: attributedStringForZero] - } - pub unsafe fn attributedStringForNil(&self) -> Id { - msg_send_id![self, attributedStringForNil] - } - pub unsafe fn setAttributedStringForNil( - &self, - attributedStringForNil: &NSAttributedString, - ) { - msg_send![self, setAttributedStringForNil: attributedStringForNil] - } - pub unsafe fn attributedStringForNotANumber(&self) -> Id { - msg_send_id![self, attributedStringForNotANumber] - } + ); + #[method_id(attributedStringForNil)] + pub unsafe fn attributedStringForNil(&self) -> Id; + # [method (setAttributedStringForNil :)] + pub unsafe fn setAttributedStringForNil(&self, attributedStringForNil: &NSAttributedString); + #[method_id(attributedStringForNotANumber)] + pub unsafe fn attributedStringForNotANumber(&self) -> Id; + # [method (setAttributedStringForNotANumber :)] pub unsafe fn setAttributedStringForNotANumber( &self, attributedStringForNotANumber: &NSAttributedString, - ) { - msg_send![ - self, - setAttributedStringForNotANumber: attributedStringForNotANumber - ] - } - pub unsafe fn roundingBehavior(&self) -> Id { - msg_send_id![self, roundingBehavior] - } - pub unsafe fn setRoundingBehavior(&self, roundingBehavior: &NSDecimalNumberHandler) { - msg_send![self, setRoundingBehavior: roundingBehavior] - } + ); + #[method_id(roundingBehavior)] + pub unsafe fn roundingBehavior(&self) -> Id; + # [method (setRoundingBehavior :)] + pub unsafe fn setRoundingBehavior(&self, roundingBehavior: &NSDecimalNumberHandler); } ); diff --git a/icrate/src/Foundation/generated/NSObjCRuntime.rs b/icrate/src/Foundation/generated/NSObjCRuntime.rs index 68571c85a..cf5cbc6c5 100644 --- a/icrate/src/Foundation/generated/NSObjCRuntime.rs +++ b/icrate/src/Foundation/generated/NSObjCRuntime.rs @@ -5,6 +5,6 @@ use crate::CoreFoundation::generated::CFAvailability::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSExceptionName = NSString; pub type NSRunLoopMode = NSString; diff --git a/icrate/src/Foundation/generated/NSObject.rs b/icrate/src/Foundation/generated/NSObject.rs index 35706ca04..eaa6ae1b4 100644 --- a/icrate/src/Foundation/generated/NSObject.rs +++ b/icrate/src/Foundation/generated/NSObject.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSZone::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSCopying = NSObject; pub type NSMutableCopying = NSObject; pub type NSCoding = NSObject; @@ -18,37 +18,31 @@ pub type NSSecureCoding = NSObject; extern_methods!( #[doc = "NSCoderMethods"] unsafe impl NSObject { - pub unsafe fn version() -> NSInteger { - msg_send![Self::class(), version] - } - pub unsafe fn setVersion(aVersion: NSInteger) { - msg_send![Self::class(), setVersion: aVersion] - } - pub unsafe fn classForCoder(&self) -> &Class { - msg_send![self, classForCoder] - } + #[method(version)] + pub unsafe fn version() -> NSInteger; + # [method (setVersion :)] + pub unsafe fn setVersion(aVersion: NSInteger); + #[method(classForCoder)] + pub unsafe fn classForCoder(&self) -> &Class; + # [method_id (replacementObjectForCoder :)] pub unsafe fn replacementObjectForCoder( &self, coder: &NSCoder, - ) -> Option> { - msg_send_id![self, replacementObjectForCoder: coder] - } + ) -> Option>; } ); extern_methods!( #[doc = "NSDeprecatedMethods"] unsafe impl NSObject { - pub unsafe fn poseAsClass(aClass: &Class) { - msg_send![Self::class(), poseAsClass: aClass] - } + # [method (poseAsClass :)] + pub unsafe fn poseAsClass(aClass: &Class); } ); pub type NSDiscardableContent = NSObject; extern_methods!( #[doc = "NSDiscardableContentProxy"] unsafe impl NSObject { - pub unsafe fn autoContentAccessingProxy(&self) -> Id { - msg_send_id![self, autoContentAccessingProxy] - } + #[method_id(autoContentAccessingProxy)] + pub unsafe fn autoContentAccessingProxy(&self) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSObjectScripting.rs b/icrate/src/Foundation/generated/NSObjectScripting.rs index d9a972a5c..adfdc0769 100644 --- a/icrate/src/Foundation/generated/NSObjectScripting.rs +++ b/icrate/src/Foundation/generated/NSObjectScripting.rs @@ -5,54 +5,38 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_methods!( #[doc = "NSScripting"] unsafe impl NSObject { + # [method_id (scriptingValueForSpecifier :)] pub unsafe fn scriptingValueForSpecifier( &self, objectSpecifier: &NSScriptObjectSpecifier, - ) -> Option> { - msg_send_id![self, scriptingValueForSpecifier: objectSpecifier] - } + ) -> Option>; + #[method_id(scriptingProperties)] pub unsafe fn scriptingProperties( &self, - ) -> Option, Shared>> { - msg_send_id![self, scriptingProperties] - } + ) -> Option, Shared>>; + # [method (setScriptingProperties :)] pub unsafe fn setScriptingProperties( &self, scriptingProperties: Option<&NSDictionary>, - ) { - msg_send![self, setScriptingProperties: scriptingProperties] - } + ); + # [method_id (copyScriptingValue : forKey : withProperties :)] pub unsafe fn copyScriptingValue_forKey_withProperties( &self, value: &Object, key: &NSString, properties: &NSDictionary, - ) -> Option> { - msg_send_id![ - self, - copyScriptingValue: value, - forKey: key, - withProperties: properties - ] - } + ) -> Option>; + # [method_id (newScriptingObjectOfClass : forValueForKey : withContentsValue : properties :)] pub unsafe fn newScriptingObjectOfClass_forValueForKey_withContentsValue_properties( &self, objectClass: &Class, key: &NSString, contentsValue: Option<&Object>, properties: &NSDictionary, - ) -> Option> { - msg_send_id![ - self, - newScriptingObjectOfClass: objectClass, - forValueForKey: key, - withContentsValue: contentsValue, - properties: properties - ] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSOperation.rs b/icrate/src/Foundation/generated/NSOperation.rs index 03acffc42..7092c0ebb 100644 --- a/icrate/src/Foundation/generated/NSOperation.rs +++ b/icrate/src/Foundation/generated/NSOperation.rs @@ -8,7 +8,7 @@ use crate::Foundation::generated::NSProgress::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSOperation; @@ -18,75 +18,52 @@ extern_class!( ); extern_methods!( unsafe impl NSOperation { - pub unsafe fn start(&self) { - msg_send![self, start] - } - pub unsafe fn main(&self) { - msg_send![self, main] - } - pub unsafe fn isCancelled(&self) -> bool { - msg_send![self, isCancelled] - } - pub unsafe fn cancel(&self) { - msg_send![self, cancel] - } - pub unsafe fn isExecuting(&self) -> bool { - msg_send![self, isExecuting] - } - pub unsafe fn isFinished(&self) -> bool { - msg_send![self, isFinished] - } - pub unsafe fn isConcurrent(&self) -> bool { - msg_send![self, isConcurrent] - } - pub unsafe fn isAsynchronous(&self) -> bool { - msg_send![self, isAsynchronous] - } - pub unsafe fn isReady(&self) -> bool { - msg_send![self, isReady] - } - pub unsafe fn addDependency(&self, op: &NSOperation) { - msg_send![self, addDependency: op] - } - pub unsafe fn removeDependency(&self, op: &NSOperation) { - msg_send![self, removeDependency: op] - } - pub unsafe fn dependencies(&self) -> Id, Shared> { - msg_send_id![self, dependencies] - } - pub unsafe fn queuePriority(&self) -> NSOperationQueuePriority { - msg_send![self, queuePriority] - } - pub unsafe fn setQueuePriority(&self, queuePriority: NSOperationQueuePriority) { - msg_send![self, setQueuePriority: queuePriority] - } - pub unsafe fn completionBlock(&self) -> TodoBlock { - msg_send![self, completionBlock] - } - pub unsafe fn setCompletionBlock(&self, completionBlock: TodoBlock) { - msg_send![self, setCompletionBlock: completionBlock] - } - pub unsafe fn waitUntilFinished(&self) { - msg_send![self, waitUntilFinished] - } - pub unsafe fn threadPriority(&self) -> c_double { - msg_send![self, threadPriority] - } - pub unsafe fn setThreadPriority(&self, threadPriority: c_double) { - msg_send![self, setThreadPriority: threadPriority] - } - pub unsafe fn qualityOfService(&self) -> NSQualityOfService { - msg_send![self, qualityOfService] - } - pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService) { - msg_send![self, setQualityOfService: qualityOfService] - } - pub unsafe fn name(&self) -> Option> { - msg_send_id![self, name] - } - pub unsafe fn setName(&self, name: Option<&NSString>) { - msg_send![self, setName: name] - } + #[method(start)] + pub unsafe fn start(&self); + #[method(main)] + pub unsafe fn main(&self); + #[method(isCancelled)] + pub unsafe fn isCancelled(&self) -> bool; + #[method(cancel)] + pub unsafe fn cancel(&self); + #[method(isExecuting)] + pub unsafe fn isExecuting(&self) -> bool; + #[method(isFinished)] + pub unsafe fn isFinished(&self) -> bool; + #[method(isConcurrent)] + pub unsafe fn isConcurrent(&self) -> bool; + #[method(isAsynchronous)] + pub unsafe fn isAsynchronous(&self) -> bool; + #[method(isReady)] + pub unsafe fn isReady(&self) -> bool; + # [method (addDependency :)] + pub unsafe fn addDependency(&self, op: &NSOperation); + # [method (removeDependency :)] + pub unsafe fn removeDependency(&self, op: &NSOperation); + #[method_id(dependencies)] + pub unsafe fn dependencies(&self) -> Id, Shared>; + #[method(queuePriority)] + pub unsafe fn queuePriority(&self) -> NSOperationQueuePriority; + # [method (setQueuePriority :)] + pub unsafe fn setQueuePriority(&self, queuePriority: NSOperationQueuePriority); + #[method(completionBlock)] + pub unsafe fn completionBlock(&self) -> TodoBlock; + # [method (setCompletionBlock :)] + pub unsafe fn setCompletionBlock(&self, completionBlock: TodoBlock); + #[method(waitUntilFinished)] + pub unsafe fn waitUntilFinished(&self); + #[method(threadPriority)] + pub unsafe fn threadPriority(&self) -> c_double; + # [method (setThreadPriority :)] + pub unsafe fn setThreadPriority(&self, threadPriority: c_double); + #[method(qualityOfService)] + pub unsafe fn qualityOfService(&self) -> NSQualityOfService; + # [method (setQualityOfService :)] + pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService); + #[method_id(name)] + pub unsafe fn name(&self) -> Option>; + # [method (setName :)] + pub unsafe fn setName(&self, name: Option<&NSString>); } ); extern_class!( @@ -98,12 +75,10 @@ extern_class!( ); extern_methods!( unsafe impl NSBlockOperation { - pub unsafe fn blockOperationWithBlock(block: TodoBlock) -> Id { - msg_send_id![Self::class(), blockOperationWithBlock: block] - } - pub unsafe fn addExecutionBlock(&self, block: TodoBlock) { - msg_send![self, addExecutionBlock: block] - } + # [method_id (blockOperationWithBlock :)] + pub unsafe fn blockOperationWithBlock(block: TodoBlock) -> Id; + # [method (addExecutionBlock :)] + pub unsafe fn addExecutionBlock(&self, block: TodoBlock); } ); extern_class!( @@ -115,23 +90,19 @@ extern_class!( ); extern_methods!( unsafe impl NSInvocationOperation { + # [method_id (initWithTarget : selector : object :)] pub unsafe fn initWithTarget_selector_object( &self, target: &Object, sel: Sel, arg: Option<&Object>, - ) -> Option> { - msg_send_id![self, initWithTarget: target, selector: sel, object: arg] - } - pub unsafe fn initWithInvocation(&self, inv: &NSInvocation) -> Id { - msg_send_id![self, initWithInvocation: inv] - } - pub unsafe fn invocation(&self) -> Id { - msg_send_id![self, invocation] - } - pub unsafe fn result(&self) -> Option> { - msg_send_id![self, result] - } + ) -> Option>; + # [method_id (initWithInvocation :)] + pub unsafe fn initWithInvocation(&self, inv: &NSInvocation) -> Id; + #[method_id(invocation)] + pub unsafe fn invocation(&self) -> Id; + #[method_id(result)] + pub unsafe fn result(&self) -> Option>; } ); extern_class!( @@ -143,83 +114,56 @@ extern_class!( ); extern_methods!( unsafe impl NSOperationQueue { - pub unsafe fn progress(&self) -> Id { - msg_send_id![self, progress] - } - pub unsafe fn addOperation(&self, op: &NSOperation) { - msg_send![self, addOperation: op] - } + #[method_id(progress)] + pub unsafe fn progress(&self) -> Id; + # [method (addOperation :)] + pub unsafe fn addOperation(&self, op: &NSOperation); + # [method (addOperations : waitUntilFinished :)] pub unsafe fn addOperations_waitUntilFinished( &self, ops: &NSArray, wait: bool, - ) { - msg_send![self, addOperations: ops, waitUntilFinished: wait] - } - pub unsafe fn addOperationWithBlock(&self, block: TodoBlock) { - msg_send![self, addOperationWithBlock: block] - } - pub unsafe fn addBarrierBlock(&self, barrier: TodoBlock) { - msg_send![self, addBarrierBlock: barrier] - } - pub unsafe fn maxConcurrentOperationCount(&self) -> NSInteger { - msg_send![self, maxConcurrentOperationCount] - } - pub unsafe fn setMaxConcurrentOperationCount( - &self, - maxConcurrentOperationCount: NSInteger, - ) { - msg_send![ - self, - setMaxConcurrentOperationCount: maxConcurrentOperationCount - ] - } - pub unsafe fn isSuspended(&self) -> bool { - msg_send![self, isSuspended] - } - pub unsafe fn setSuspended(&self, suspended: bool) { - msg_send![self, setSuspended: suspended] - } - pub unsafe fn name(&self) -> Option> { - msg_send_id![self, name] - } - pub unsafe fn setName(&self, name: Option<&NSString>) { - msg_send![self, setName: name] - } - pub unsafe fn qualityOfService(&self) -> NSQualityOfService { - msg_send![self, qualityOfService] - } - pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService) { - msg_send![self, setQualityOfService: qualityOfService] - } - pub unsafe fn underlyingQueue(&self) -> Option> { - msg_send_id![self, underlyingQueue] - } - pub unsafe fn setUnderlyingQueue(&self, underlyingQueue: Option<&dispatch_queue_t>) { - msg_send![self, setUnderlyingQueue: underlyingQueue] - } - pub unsafe fn cancelAllOperations(&self) { - msg_send![self, cancelAllOperations] - } - pub unsafe fn waitUntilAllOperationsAreFinished(&self) { - msg_send![self, waitUntilAllOperationsAreFinished] - } - pub unsafe fn currentQueue() -> Option> { - msg_send_id![Self::class(), currentQueue] - } - pub unsafe fn mainQueue() -> Id { - msg_send_id![Self::class(), mainQueue] - } + ); + # [method (addOperationWithBlock :)] + pub unsafe fn addOperationWithBlock(&self, block: TodoBlock); + # [method (addBarrierBlock :)] + pub unsafe fn addBarrierBlock(&self, barrier: TodoBlock); + #[method(maxConcurrentOperationCount)] + pub unsafe fn maxConcurrentOperationCount(&self) -> NSInteger; + # [method (setMaxConcurrentOperationCount :)] + pub unsafe fn setMaxConcurrentOperationCount(&self, maxConcurrentOperationCount: NSInteger); + #[method(isSuspended)] + pub unsafe fn isSuspended(&self) -> bool; + # [method (setSuspended :)] + pub unsafe fn setSuspended(&self, suspended: bool); + #[method_id(name)] + pub unsafe fn name(&self) -> Option>; + # [method (setName :)] + pub unsafe fn setName(&self, name: Option<&NSString>); + #[method(qualityOfService)] + pub unsafe fn qualityOfService(&self) -> NSQualityOfService; + # [method (setQualityOfService :)] + pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService); + #[method_id(underlyingQueue)] + pub unsafe fn underlyingQueue(&self) -> Option>; + # [method (setUnderlyingQueue :)] + pub unsafe fn setUnderlyingQueue(&self, underlyingQueue: Option<&dispatch_queue_t>); + #[method(cancelAllOperations)] + pub unsafe fn cancelAllOperations(&self); + #[method(waitUntilAllOperationsAreFinished)] + pub unsafe fn waitUntilAllOperationsAreFinished(&self); + #[method_id(currentQueue)] + pub unsafe fn currentQueue() -> Option>; + #[method_id(mainQueue)] + pub unsafe fn mainQueue() -> Id; } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSOperationQueue { - pub unsafe fn operations(&self) -> Id, Shared> { - msg_send_id![self, operations] - } - pub unsafe fn operationCount(&self) -> NSUInteger { - msg_send![self, operationCount] - } + #[method_id(operations)] + pub unsafe fn operations(&self) -> Id, Shared>; + #[method(operationCount)] + pub unsafe fn operationCount(&self) -> NSUInteger; } ); diff --git a/icrate/src/Foundation/generated/NSOrderedCollectionChange.rs b/icrate/src/Foundation/generated/NSOrderedCollectionChange.rs index fb0cd6871..1441aa435 100644 --- a/icrate/src/Foundation/generated/NSOrderedCollectionChange.rs +++ b/icrate/src/Foundation/generated/NSOrderedCollectionChange.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; __inner_extern_class!( #[derive(Debug)] pub struct NSOrderedCollectionChange; @@ -12,52 +12,43 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSOrderedCollectionChange { + # [method_id (changeWithObject : type : index :)] pub unsafe fn changeWithObject_type_index( anObject: Option<&ObjectType>, type_: NSCollectionChangeType, index: NSUInteger, - ) -> Id, Shared> { - msg_send_id ! [Self :: class () , changeWithObject : anObject , type : type_ , index : index] - } + ) -> Id, Shared>; + # [method_id (changeWithObject : type : index : associatedIndex :)] pub unsafe fn changeWithObject_type_index_associatedIndex( anObject: Option<&ObjectType>, type_: NSCollectionChangeType, index: NSUInteger, associatedIndex: NSUInteger, - ) -> Id, Shared> { - msg_send_id ! [Self :: class () , changeWithObject : anObject , type : type_ , index : index , associatedIndex : associatedIndex] - } - pub unsafe fn object(&self) -> Option> { - msg_send_id![self, object] - } - pub unsafe fn changeType(&self) -> NSCollectionChangeType { - msg_send![self, changeType] - } - pub unsafe fn index(&self) -> NSUInteger { - msg_send![self, index] - } - pub unsafe fn associatedIndex(&self) -> NSUInteger { - msg_send![self, associatedIndex] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + ) -> Id, Shared>; + #[method_id(object)] + pub unsafe fn object(&self) -> Option>; + #[method(changeType)] + pub unsafe fn changeType(&self) -> NSCollectionChangeType; + #[method(index)] + pub unsafe fn index(&self) -> NSUInteger; + #[method(associatedIndex)] + pub unsafe fn associatedIndex(&self) -> NSUInteger; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithObject : type : index :)] pub unsafe fn initWithObject_type_index( &self, anObject: Option<&ObjectType>, type_: NSCollectionChangeType, index: NSUInteger, - ) -> Id { - msg_send_id ! [self , initWithObject : anObject , type : type_ , index : index] - } + ) -> Id; + # [method_id (initWithObject : type : index : associatedIndex :)] pub unsafe fn initWithObject_type_index_associatedIndex( &self, anObject: Option<&ObjectType>, type_: NSCollectionChangeType, index: NSUInteger, associatedIndex: NSUInteger, - ) -> Id { - msg_send_id ! [self , initWithObject : anObject , type : type_ , index : index , associatedIndex : associatedIndex] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSOrderedCollectionDifference.rs b/icrate/src/Foundation/generated/NSOrderedCollectionDifference.rs index 419be43ec..c06519be2 100644 --- a/icrate/src/Foundation/generated/NSOrderedCollectionDifference.rs +++ b/icrate/src/Foundation/generated/NSOrderedCollectionDifference.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSOrderedCollectionChange::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; __inner_extern_class!( #[derive(Debug)] pub struct NSOrderedCollectionDifference; @@ -15,12 +15,12 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSOrderedCollectionDifference { + # [method_id (initWithChanges :)] pub unsafe fn initWithChanges( &self, changes: &NSArray>, - ) -> Id { - msg_send_id![self, initWithChanges: changes] - } + ) -> Id; + # [method_id (initWithInsertIndexes : insertedObjects : removeIndexes : removedObjects : additionalChanges :)] pub unsafe fn initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges( &self, inserts: &NSIndexSet, @@ -28,52 +28,30 @@ extern_methods!( removes: &NSIndexSet, removedObjects: Option<&NSArray>, changes: &NSArray>, - ) -> Id { - msg_send_id![ - self, - initWithInsertIndexes: inserts, - insertedObjects: insertedObjects, - removeIndexes: removes, - removedObjects: removedObjects, - additionalChanges: changes - ] - } + ) -> Id; + # [method_id (initWithInsertIndexes : insertedObjects : removeIndexes : removedObjects :)] pub unsafe fn initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects( &self, inserts: &NSIndexSet, insertedObjects: Option<&NSArray>, removes: &NSIndexSet, removedObjects: Option<&NSArray>, - ) -> Id { - msg_send_id![ - self, - initWithInsertIndexes: inserts, - insertedObjects: insertedObjects, - removeIndexes: removes, - removedObjects: removedObjects - ] - } + ) -> Id; + #[method_id(insertions)] pub unsafe fn insertions( &self, - ) -> Id>, Shared> { - msg_send_id![self, insertions] - } - pub unsafe fn removals( - &self, - ) -> Id>, Shared> { - msg_send_id![self, removals] - } - pub unsafe fn hasChanges(&self) -> bool { - msg_send![self, hasChanges] - } + ) -> Id>, Shared>; + #[method_id(removals)] + pub unsafe fn removals(&self) + -> Id>, Shared>; + #[method(hasChanges)] + pub unsafe fn hasChanges(&self) -> bool; + # [method_id (differenceByTransformingChangesWithBlock :)] pub unsafe fn differenceByTransformingChangesWithBlock( &self, block: TodoBlock, - ) -> Id, Shared> { - msg_send_id![self, differenceByTransformingChangesWithBlock: block] - } - pub unsafe fn inverseDifference(&self) -> Id { - msg_send_id![self, inverseDifference] - } + ) -> Id, Shared>; + #[method_id(inverseDifference)] + pub unsafe fn inverseDifference(&self) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSOrderedSet.rs b/icrate/src/Foundation/generated/NSOrderedSet.rs index 7b7a74b20..c395ec352 100644 --- a/icrate/src/Foundation/generated/NSOrderedSet.rs +++ b/icrate/src/Foundation/generated/NSOrderedSet.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSRange::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; __inner_extern_class!( #[derive(Debug)] pub struct NSOrderedSet; @@ -20,349 +20,246 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSOrderedSet { - pub unsafe fn count(&self) -> NSUInteger { - msg_send![self, count] - } - pub unsafe fn objectAtIndex(&self, idx: NSUInteger) -> Id { - msg_send_id![self, objectAtIndex: idx] - } - pub unsafe fn indexOfObject(&self, object: &ObjectType) -> NSUInteger { - msg_send![self, indexOfObject: object] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + # [method_id (objectAtIndex :)] + pub unsafe fn objectAtIndex(&self, idx: NSUInteger) -> Id; + # [method (indexOfObject :)] + pub unsafe fn indexOfObject(&self, object: &ObjectType) -> NSUInteger; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithObjects : count :)] pub unsafe fn initWithObjects_count( &self, objects: TodoArray, cnt: NSUInteger, - ) -> Id { - msg_send_id![self, initWithObjects: objects, count: cnt] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSExtendedOrderedSet"] unsafe impl NSOrderedSet { - pub unsafe fn getObjects_range(&self, objects: TodoArray, range: NSRange) { - msg_send![self, getObjects: objects, range: range] - } + # [method (getObjects : range :)] + pub unsafe fn getObjects_range(&self, objects: TodoArray, range: NSRange); + # [method_id (objectsAtIndexes :)] pub unsafe fn objectsAtIndexes( &self, indexes: &NSIndexSet, - ) -> Id, Shared> { - msg_send_id![self, objectsAtIndexes: indexes] - } - pub unsafe fn firstObject(&self) -> Option> { - msg_send_id![self, firstObject] - } - pub unsafe fn lastObject(&self) -> Option> { - msg_send_id![self, lastObject] - } - pub unsafe fn isEqualToOrderedSet(&self, other: &NSOrderedSet) -> bool { - msg_send![self, isEqualToOrderedSet: other] - } - pub unsafe fn containsObject(&self, object: &ObjectType) -> bool { - msg_send![self, containsObject: object] - } - pub unsafe fn intersectsOrderedSet(&self, other: &NSOrderedSet) -> bool { - msg_send![self, intersectsOrderedSet: other] - } - pub unsafe fn intersectsSet(&self, set: &NSSet) -> bool { - msg_send![self, intersectsSet: set] - } - pub unsafe fn isSubsetOfOrderedSet(&self, other: &NSOrderedSet) -> bool { - msg_send![self, isSubsetOfOrderedSet: other] - } - pub unsafe fn isSubsetOfSet(&self, set: &NSSet) -> bool { - msg_send![self, isSubsetOfSet: set] - } - pub unsafe fn objectAtIndexedSubscript(&self, idx: NSUInteger) -> Id { - msg_send_id![self, objectAtIndexedSubscript: idx] - } - pub unsafe fn objectEnumerator(&self) -> Id, Shared> { - msg_send_id![self, objectEnumerator] - } - pub unsafe fn reverseObjectEnumerator(&self) -> Id, Shared> { - msg_send_id![self, reverseObjectEnumerator] - } - pub unsafe fn reversedOrderedSet(&self) -> Id, Shared> { - msg_send_id![self, reversedOrderedSet] - } - pub unsafe fn array(&self) -> Id, Shared> { - msg_send_id![self, array] - } - pub unsafe fn set(&self) -> Id, Shared> { - msg_send_id![self, set] - } - pub unsafe fn enumerateObjectsUsingBlock(&self, block: TodoBlock) { - msg_send![self, enumerateObjectsUsingBlock: block] - } + ) -> Id, Shared>; + #[method_id(firstObject)] + pub unsafe fn firstObject(&self) -> Option>; + #[method_id(lastObject)] + pub unsafe fn lastObject(&self) -> Option>; + # [method (isEqualToOrderedSet :)] + pub unsafe fn isEqualToOrderedSet(&self, other: &NSOrderedSet) -> bool; + # [method (containsObject :)] + pub unsafe fn containsObject(&self, object: &ObjectType) -> bool; + # [method (intersectsOrderedSet :)] + pub unsafe fn intersectsOrderedSet(&self, other: &NSOrderedSet) -> bool; + # [method (intersectsSet :)] + pub unsafe fn intersectsSet(&self, set: &NSSet) -> bool; + # [method (isSubsetOfOrderedSet :)] + pub unsafe fn isSubsetOfOrderedSet(&self, other: &NSOrderedSet) -> bool; + # [method (isSubsetOfSet :)] + pub unsafe fn isSubsetOfSet(&self, set: &NSSet) -> bool; + # [method_id (objectAtIndexedSubscript :)] + pub unsafe fn objectAtIndexedSubscript(&self, idx: NSUInteger) -> Id; + #[method_id(objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + #[method_id(reverseObjectEnumerator)] + pub unsafe fn reverseObjectEnumerator(&self) -> Id, Shared>; + #[method_id(reversedOrderedSet)] + pub unsafe fn reversedOrderedSet(&self) -> Id, Shared>; + #[method_id(array)] + pub unsafe fn array(&self) -> Id, Shared>; + #[method_id(set)] + pub unsafe fn set(&self) -> Id, Shared>; + # [method (enumerateObjectsUsingBlock :)] + pub unsafe fn enumerateObjectsUsingBlock(&self, block: TodoBlock); + # [method (enumerateObjectsWithOptions : usingBlock :)] pub unsafe fn enumerateObjectsWithOptions_usingBlock( &self, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![self, enumerateObjectsWithOptions: opts, usingBlock: block] - } + ); + # [method (enumerateObjectsAtIndexes : options : usingBlock :)] pub unsafe fn enumerateObjectsAtIndexes_options_usingBlock( &self, s: &NSIndexSet, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateObjectsAtIndexes: s, - options: opts, - usingBlock: block - ] - } - pub unsafe fn indexOfObjectPassingTest(&self, predicate: TodoBlock) -> NSUInteger { - msg_send![self, indexOfObjectPassingTest: predicate] - } + ); + # [method (indexOfObjectPassingTest :)] + pub unsafe fn indexOfObjectPassingTest(&self, predicate: TodoBlock) -> NSUInteger; + # [method (indexOfObjectWithOptions : passingTest :)] pub unsafe fn indexOfObjectWithOptions_passingTest( &self, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> NSUInteger { - msg_send![self, indexOfObjectWithOptions: opts, passingTest: predicate] - } + ) -> NSUInteger; + # [method (indexOfObjectAtIndexes : options : passingTest :)] pub unsafe fn indexOfObjectAtIndexes_options_passingTest( &self, s: &NSIndexSet, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> NSUInteger { - msg_send![ - self, - indexOfObjectAtIndexes: s, - options: opts, - passingTest: predicate - ] - } + ) -> NSUInteger; + # [method_id (indexesOfObjectsPassingTest :)] pub unsafe fn indexesOfObjectsPassingTest( &self, predicate: TodoBlock, - ) -> Id { - msg_send_id![self, indexesOfObjectsPassingTest: predicate] - } + ) -> Id; + # [method_id (indexesOfObjectsWithOptions : passingTest :)] pub unsafe fn indexesOfObjectsWithOptions_passingTest( &self, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> Id { - msg_send_id![ - self, - indexesOfObjectsWithOptions: opts, - passingTest: predicate - ] - } + ) -> Id; + # [method_id (indexesOfObjectsAtIndexes : options : passingTest :)] pub unsafe fn indexesOfObjectsAtIndexes_options_passingTest( &self, s: &NSIndexSet, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> Id { - msg_send_id![ - self, - indexesOfObjectsAtIndexes: s, - options: opts, - passingTest: predicate - ] - } + ) -> Id; + # [method (indexOfObject : inSortedRange : options : usingComparator :)] pub unsafe fn indexOfObject_inSortedRange_options_usingComparator( &self, object: &ObjectType, range: NSRange, opts: NSBinarySearchingOptions, cmp: NSComparator, - ) -> NSUInteger { - msg_send![ - self, - indexOfObject: object, - inSortedRange: range, - options: opts, - usingComparator: cmp - ] - } + ) -> NSUInteger; + # [method_id (sortedArrayUsingComparator :)] pub unsafe fn sortedArrayUsingComparator( &self, cmptr: NSComparator, - ) -> Id, Shared> { - msg_send_id![self, sortedArrayUsingComparator: cmptr] - } + ) -> Id, Shared>; + # [method_id (sortedArrayWithOptions : usingComparator :)] pub unsafe fn sortedArrayWithOptions_usingComparator( &self, opts: NSSortOptions, cmptr: NSComparator, - ) -> Id, Shared> { - msg_send_id![self, sortedArrayWithOptions: opts, usingComparator: cmptr] - } - pub unsafe fn description(&self) -> Id { - msg_send_id![self, description] - } - pub unsafe fn descriptionWithLocale( - &self, - locale: Option<&Object>, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale] - } + ) -> Id, Shared>; + #[method_id(description)] + pub unsafe fn description(&self) -> Id; + # [method_id (descriptionWithLocale :)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + # [method_id (descriptionWithLocale : indent :)] pub unsafe fn descriptionWithLocale_indent( &self, locale: Option<&Object>, level: NSUInteger, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale, indent: level] - } + ) -> Id; } ); extern_methods!( #[doc = "NSOrderedSetCreation"] unsafe impl NSOrderedSet { - pub unsafe fn orderedSet() -> Id { - msg_send_id![Self::class(), orderedSet] - } - pub unsafe fn orderedSetWithObject(object: &ObjectType) -> Id { - msg_send_id![Self::class(), orderedSetWithObject: object] - } + #[method_id(orderedSet)] + pub unsafe fn orderedSet() -> Id; + # [method_id (orderedSetWithObject :)] + pub unsafe fn orderedSetWithObject(object: &ObjectType) -> Id; + # [method_id (orderedSetWithObjects : count :)] pub unsafe fn orderedSetWithObjects_count( objects: TodoArray, cnt: NSUInteger, - ) -> Id { - msg_send_id![Self::class(), orderedSetWithObjects: objects, count: cnt] - } - pub unsafe fn orderedSetWithOrderedSet(set: &NSOrderedSet) -> Id { - msg_send_id![Self::class(), orderedSetWithOrderedSet: set] - } + ) -> Id; + # [method_id (orderedSetWithOrderedSet :)] + pub unsafe fn orderedSetWithOrderedSet(set: &NSOrderedSet) -> Id; + # [method_id (orderedSetWithOrderedSet : range : copyItems :)] pub unsafe fn orderedSetWithOrderedSet_range_copyItems( set: &NSOrderedSet, range: NSRange, flag: bool, - ) -> Id { - msg_send_id![ - Self::class(), - orderedSetWithOrderedSet: set, - range: range, - copyItems: flag - ] - } - pub unsafe fn orderedSetWithArray(array: &NSArray) -> Id { - msg_send_id![Self::class(), orderedSetWithArray: array] - } + ) -> Id; + # [method_id (orderedSetWithArray :)] + pub unsafe fn orderedSetWithArray(array: &NSArray) -> Id; + # [method_id (orderedSetWithArray : range : copyItems :)] pub unsafe fn orderedSetWithArray_range_copyItems( array: &NSArray, range: NSRange, flag: bool, - ) -> Id { - msg_send_id![ - Self::class(), - orderedSetWithArray: array, - range: range, - copyItems: flag - ] - } - pub unsafe fn orderedSetWithSet(set: &NSSet) -> Id { - msg_send_id![Self::class(), orderedSetWithSet: set] - } + ) -> Id; + # [method_id (orderedSetWithSet :)] + pub unsafe fn orderedSetWithSet(set: &NSSet) -> Id; + # [method_id (orderedSetWithSet : copyItems :)] pub unsafe fn orderedSetWithSet_copyItems( set: &NSSet, flag: bool, - ) -> Id { - msg_send_id![Self::class(), orderedSetWithSet: set, copyItems: flag] - } - pub unsafe fn initWithObject(&self, object: &ObjectType) -> Id { - msg_send_id![self, initWithObject: object] - } - pub unsafe fn initWithOrderedSet( - &self, - set: &NSOrderedSet, - ) -> Id { - msg_send_id![self, initWithOrderedSet: set] - } + ) -> Id; + # [method_id (initWithObject :)] + pub unsafe fn initWithObject(&self, object: &ObjectType) -> Id; + # [method_id (initWithOrderedSet :)] + pub unsafe fn initWithOrderedSet(&self, set: &NSOrderedSet) + -> Id; + # [method_id (initWithOrderedSet : copyItems :)] pub unsafe fn initWithOrderedSet_copyItems( &self, set: &NSOrderedSet, flag: bool, - ) -> Id { - msg_send_id![self, initWithOrderedSet: set, copyItems: flag] - } + ) -> Id; + # [method_id (initWithOrderedSet : range : copyItems :)] pub unsafe fn initWithOrderedSet_range_copyItems( &self, set: &NSOrderedSet, range: NSRange, flag: bool, - ) -> Id { - msg_send_id![self, initWithOrderedSet: set, range: range, copyItems: flag] - } - pub unsafe fn initWithArray(&self, array: &NSArray) -> Id { - msg_send_id![self, initWithArray: array] - } + ) -> Id; + # [method_id (initWithArray :)] + pub unsafe fn initWithArray(&self, array: &NSArray) -> Id; + # [method_id (initWithArray : copyItems :)] pub unsafe fn initWithArray_copyItems( &self, set: &NSArray, flag: bool, - ) -> Id { - msg_send_id![self, initWithArray: set, copyItems: flag] - } + ) -> Id; + # [method_id (initWithArray : range : copyItems :)] pub unsafe fn initWithArray_range_copyItems( &self, set: &NSArray, range: NSRange, flag: bool, - ) -> Id { - msg_send_id![self, initWithArray: set, range: range, copyItems: flag] - } - pub unsafe fn initWithSet(&self, set: &NSSet) -> Id { - msg_send_id![self, initWithSet: set] - } + ) -> Id; + # [method_id (initWithSet :)] + pub unsafe fn initWithSet(&self, set: &NSSet) -> Id; + # [method_id (initWithSet : copyItems :)] pub unsafe fn initWithSet_copyItems( &self, set: &NSSet, flag: bool, - ) -> Id { - msg_send_id![self, initWithSet: set, copyItems: flag] - } + ) -> Id; } ); extern_methods!( #[doc = "NSOrderedSetDiffing"] unsafe impl NSOrderedSet { + # [method_id (differenceFromOrderedSet : withOptions : usingEquivalenceTest :)] pub unsafe fn differenceFromOrderedSet_withOptions_usingEquivalenceTest( &self, other: &NSOrderedSet, options: NSOrderedCollectionDifferenceCalculationOptions, block: TodoBlock, - ) -> Id, Shared> { - msg_send_id![ - self, - differenceFromOrderedSet: other, - withOptions: options, - usingEquivalenceTest: block - ] - } + ) -> Id, Shared>; + # [method_id (differenceFromOrderedSet : withOptions :)] pub unsafe fn differenceFromOrderedSet_withOptions( &self, other: &NSOrderedSet, options: NSOrderedCollectionDifferenceCalculationOptions, - ) -> Id, Shared> { - msg_send_id![self, differenceFromOrderedSet: other, withOptions: options] - } + ) -> Id, Shared>; + # [method_id (differenceFromOrderedSet :)] pub unsafe fn differenceFromOrderedSet( &self, other: &NSOrderedSet, - ) -> Id, Shared> { - msg_send_id![self, differenceFromOrderedSet: other] - } + ) -> Id, Shared>; + # [method_id (orderedSetByApplyingDifference :)] pub unsafe fn orderedSetByApplyingDifference( &self, difference: &NSOrderedCollectionDifference, - ) -> Option, Shared>> { - msg_send_id![self, orderedSetByApplyingDifference: difference] - } + ) -> Option, Shared>>; } ); __inner_extern_class!( @@ -374,155 +271,113 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSMutableOrderedSet { - pub unsafe fn insertObject_atIndex(&self, object: &ObjectType, idx: NSUInteger) { - msg_send![self, insertObject: object, atIndex: idx] - } - pub unsafe fn removeObjectAtIndex(&self, idx: NSUInteger) { - msg_send![self, removeObjectAtIndex: idx] - } - pub unsafe fn replaceObjectAtIndex_withObject(&self, idx: NSUInteger, object: &ObjectType) { - msg_send![self, replaceObjectAtIndex: idx, withObject: object] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithCapacity(&self, numItems: NSUInteger) -> Id { - msg_send_id![self, initWithCapacity: numItems] - } + # [method (insertObject : atIndex :)] + pub unsafe fn insertObject_atIndex(&self, object: &ObjectType, idx: NSUInteger); + # [method (removeObjectAtIndex :)] + pub unsafe fn removeObjectAtIndex(&self, idx: NSUInteger); + # [method (replaceObjectAtIndex : withObject :)] + pub unsafe fn replaceObjectAtIndex_withObject(&self, idx: NSUInteger, object: &ObjectType); + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithCapacity :)] + pub unsafe fn initWithCapacity(&self, numItems: NSUInteger) -> Id; } ); extern_methods!( #[doc = "NSExtendedMutableOrderedSet"] unsafe impl NSMutableOrderedSet { - pub unsafe fn addObject(&self, object: &ObjectType) { - msg_send![self, addObject: object] - } - pub unsafe fn addObjects_count(&self, objects: TodoArray, count: NSUInteger) { - msg_send![self, addObjects: objects, count: count] - } - pub unsafe fn addObjectsFromArray(&self, array: &NSArray) { - msg_send![self, addObjectsFromArray: array] - } + # [method (addObject :)] + pub unsafe fn addObject(&self, object: &ObjectType); + # [method (addObjects : count :)] + pub unsafe fn addObjects_count(&self, objects: TodoArray, count: NSUInteger); + # [method (addObjectsFromArray :)] + pub unsafe fn addObjectsFromArray(&self, array: &NSArray); + # [method (exchangeObjectAtIndex : withObjectAtIndex :)] pub unsafe fn exchangeObjectAtIndex_withObjectAtIndex( &self, idx1: NSUInteger, idx2: NSUInteger, - ) { - msg_send![self, exchangeObjectAtIndex: idx1, withObjectAtIndex: idx2] - } - pub unsafe fn moveObjectsAtIndexes_toIndex(&self, indexes: &NSIndexSet, idx: NSUInteger) { - msg_send![self, moveObjectsAtIndexes: indexes, toIndex: idx] - } + ); + # [method (moveObjectsAtIndexes : toIndex :)] + pub unsafe fn moveObjectsAtIndexes_toIndex(&self, indexes: &NSIndexSet, idx: NSUInteger); + # [method (insertObjects : atIndexes :)] pub unsafe fn insertObjects_atIndexes( &self, objects: &NSArray, indexes: &NSIndexSet, - ) { - msg_send![self, insertObjects: objects, atIndexes: indexes] - } - pub unsafe fn setObject_atIndex(&self, obj: &ObjectType, idx: NSUInteger) { - msg_send![self, setObject: obj, atIndex: idx] - } - pub unsafe fn setObject_atIndexedSubscript(&self, obj: &ObjectType, idx: NSUInteger) { - msg_send![self, setObject: obj, atIndexedSubscript: idx] - } + ); + # [method (setObject : atIndex :)] + pub unsafe fn setObject_atIndex(&self, obj: &ObjectType, idx: NSUInteger); + # [method (setObject : atIndexedSubscript :)] + pub unsafe fn setObject_atIndexedSubscript(&self, obj: &ObjectType, idx: NSUInteger); + # [method (replaceObjectsInRange : withObjects : count :)] pub unsafe fn replaceObjectsInRange_withObjects_count( &self, range: NSRange, objects: TodoArray, count: NSUInteger, - ) { - msg_send![ - self, - replaceObjectsInRange: range, - withObjects: objects, - count: count - ] - } + ); + # [method (replaceObjectsAtIndexes : withObjects :)] pub unsafe fn replaceObjectsAtIndexes_withObjects( &self, indexes: &NSIndexSet, objects: &NSArray, - ) { - msg_send![self, replaceObjectsAtIndexes: indexes, withObjects: objects] - } - pub unsafe fn removeObjectsInRange(&self, range: NSRange) { - msg_send![self, removeObjectsInRange: range] - } - pub unsafe fn removeObjectsAtIndexes(&self, indexes: &NSIndexSet) { - msg_send![self, removeObjectsAtIndexes: indexes] - } - pub unsafe fn removeAllObjects(&self) { - msg_send![self, removeAllObjects] - } - pub unsafe fn removeObject(&self, object: &ObjectType) { - msg_send![self, removeObject: object] - } - pub unsafe fn removeObjectsInArray(&self, array: &NSArray) { - msg_send![self, removeObjectsInArray: array] - } - pub unsafe fn intersectOrderedSet(&self, other: &NSOrderedSet) { - msg_send![self, intersectOrderedSet: other] - } - pub unsafe fn minusOrderedSet(&self, other: &NSOrderedSet) { - msg_send![self, minusOrderedSet: other] - } - pub unsafe fn unionOrderedSet(&self, other: &NSOrderedSet) { - msg_send![self, unionOrderedSet: other] - } - pub unsafe fn intersectSet(&self, other: &NSSet) { - msg_send![self, intersectSet: other] - } - pub unsafe fn minusSet(&self, other: &NSSet) { - msg_send![self, minusSet: other] - } - pub unsafe fn unionSet(&self, other: &NSSet) { - msg_send![self, unionSet: other] - } - pub unsafe fn sortUsingComparator(&self, cmptr: NSComparator) { - msg_send![self, sortUsingComparator: cmptr] - } + ); + # [method (removeObjectsInRange :)] + pub unsafe fn removeObjectsInRange(&self, range: NSRange); + # [method (removeObjectsAtIndexes :)] + pub unsafe fn removeObjectsAtIndexes(&self, indexes: &NSIndexSet); + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + # [method (removeObject :)] + pub unsafe fn removeObject(&self, object: &ObjectType); + # [method (removeObjectsInArray :)] + pub unsafe fn removeObjectsInArray(&self, array: &NSArray); + # [method (intersectOrderedSet :)] + pub unsafe fn intersectOrderedSet(&self, other: &NSOrderedSet); + # [method (minusOrderedSet :)] + pub unsafe fn minusOrderedSet(&self, other: &NSOrderedSet); + # [method (unionOrderedSet :)] + pub unsafe fn unionOrderedSet(&self, other: &NSOrderedSet); + # [method (intersectSet :)] + pub unsafe fn intersectSet(&self, other: &NSSet); + # [method (minusSet :)] + pub unsafe fn minusSet(&self, other: &NSSet); + # [method (unionSet :)] + pub unsafe fn unionSet(&self, other: &NSSet); + # [method (sortUsingComparator :)] + pub unsafe fn sortUsingComparator(&self, cmptr: NSComparator); + # [method (sortWithOptions : usingComparator :)] pub unsafe fn sortWithOptions_usingComparator( &self, opts: NSSortOptions, cmptr: NSComparator, - ) { - msg_send![self, sortWithOptions: opts, usingComparator: cmptr] - } + ); + # [method (sortRange : options : usingComparator :)] pub unsafe fn sortRange_options_usingComparator( &self, range: NSRange, opts: NSSortOptions, cmptr: NSComparator, - ) { - msg_send![ - self, - sortRange: range, - options: opts, - usingComparator: cmptr - ] - } + ); } ); extern_methods!( #[doc = "NSMutableOrderedSetCreation"] unsafe impl NSMutableOrderedSet { - pub unsafe fn orderedSetWithCapacity(numItems: NSUInteger) -> Id { - msg_send_id![Self::class(), orderedSetWithCapacity: numItems] - } + # [method_id (orderedSetWithCapacity :)] + pub unsafe fn orderedSetWithCapacity(numItems: NSUInteger) -> Id; } ); extern_methods!( #[doc = "NSMutableOrderedSetDiffing"] unsafe impl NSMutableOrderedSet { + # [method (applyDifference :)] pub unsafe fn applyDifference( &self, difference: &NSOrderedCollectionDifference, - ) { - msg_send![self, applyDifference: difference] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSOrthography.rs b/icrate/src/Foundation/generated/NSOrthography.rs index 79c5d4e6b..b8512f03f 100644 --- a/icrate/src/Foundation/generated/NSOrthography.rs +++ b/icrate/src/Foundation/generated/NSOrthography.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSOrthography; @@ -15,65 +15,50 @@ extern_class!( ); extern_methods!( unsafe impl NSOrthography { - pub unsafe fn dominantScript(&self) -> Id { - msg_send_id![self, dominantScript] - } - pub unsafe fn languageMap(&self) -> Id>, Shared> { - msg_send_id![self, languageMap] - } + #[method_id(dominantScript)] + pub unsafe fn dominantScript(&self) -> Id; + #[method_id(languageMap)] + pub unsafe fn languageMap(&self) -> Id>, Shared>; + # [method_id (initWithDominantScript : languageMap :)] pub unsafe fn initWithDominantScript_languageMap( &self, script: &NSString, map: &NSDictionary>, - ) -> Id { - msg_send_id![self, initWithDominantScript: script, languageMap: map] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSOrthographyExtended"] unsafe impl NSOrthography { + # [method_id (languagesForScript :)] pub unsafe fn languagesForScript( &self, script: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, languagesForScript: script] - } + ) -> Option, Shared>>; + # [method_id (dominantLanguageForScript :)] pub unsafe fn dominantLanguageForScript( &self, script: &NSString, - ) -> Option> { - msg_send_id![self, dominantLanguageForScript: script] - } - pub unsafe fn dominantLanguage(&self) -> Id { - msg_send_id![self, dominantLanguage] - } - pub unsafe fn allScripts(&self) -> Id, Shared> { - msg_send_id![self, allScripts] - } - pub unsafe fn allLanguages(&self) -> Id, Shared> { - msg_send_id![self, allLanguages] - } - pub unsafe fn defaultOrthographyForLanguage(language: &NSString) -> Id { - msg_send_id![Self::class(), defaultOrthographyForLanguage: language] - } + ) -> Option>; + #[method_id(dominantLanguage)] + pub unsafe fn dominantLanguage(&self) -> Id; + #[method_id(allScripts)] + pub unsafe fn allScripts(&self) -> Id, Shared>; + #[method_id(allLanguages)] + pub unsafe fn allLanguages(&self) -> Id, Shared>; + # [method_id (defaultOrthographyForLanguage :)] + pub unsafe fn defaultOrthographyForLanguage(language: &NSString) -> Id; } ); extern_methods!( #[doc = "NSOrthographyCreation"] unsafe impl NSOrthography { + # [method_id (orthographyWithDominantScript : languageMap :)] pub unsafe fn orthographyWithDominantScript_languageMap( script: &NSString, map: &NSDictionary>, - ) -> Id { - msg_send_id![ - Self::class(), - orthographyWithDominantScript: script, - languageMap: map - ] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSPathUtilities.rs b/icrate/src/Foundation/generated/NSPathUtilities.rs index 2e3bd73f6..d72387eb7 100644 --- a/icrate/src/Foundation/generated/NSPathUtilities.rs +++ b/icrate/src/Foundation/generated/NSPathUtilities.rs @@ -3,93 +3,69 @@ use crate::Foundation::generated::NSString::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_methods!( #[doc = "NSStringPathExtensions"] unsafe impl NSString { - pub unsafe fn pathWithComponents(components: &NSArray) -> Id { - msg_send_id![Self::class(), pathWithComponents: components] - } - pub unsafe fn pathComponents(&self) -> Id, Shared> { - msg_send_id![self, pathComponents] - } - pub unsafe fn isAbsolutePath(&self) -> bool { - msg_send![self, isAbsolutePath] - } - pub unsafe fn lastPathComponent(&self) -> Id { - msg_send_id![self, lastPathComponent] - } - pub unsafe fn stringByDeletingLastPathComponent(&self) -> Id { - msg_send_id![self, stringByDeletingLastPathComponent] - } - pub fn stringByAppendingPathComponent(&self, str: &NSString) -> Id { - msg_send_id![self, stringByAppendingPathComponent: str] - } - pub unsafe fn pathExtension(&self) -> Id { - msg_send_id![self, pathExtension] - } - pub unsafe fn stringByDeletingPathExtension(&self) -> Id { - msg_send_id![self, stringByDeletingPathExtension] - } + # [method_id (pathWithComponents :)] + pub unsafe fn pathWithComponents(components: &NSArray) -> Id; + #[method_id(pathComponents)] + pub unsafe fn pathComponents(&self) -> Id, Shared>; + #[method(isAbsolutePath)] + pub unsafe fn isAbsolutePath(&self) -> bool; + #[method_id(lastPathComponent)] + pub unsafe fn lastPathComponent(&self) -> Id; + #[method_id(stringByDeletingLastPathComponent)] + pub unsafe fn stringByDeletingLastPathComponent(&self) -> Id; + # [method_id (stringByAppendingPathComponent :)] + pub fn stringByAppendingPathComponent(&self, str: &NSString) -> Id; + #[method_id(pathExtension)] + pub unsafe fn pathExtension(&self) -> Id; + #[method_id(stringByDeletingPathExtension)] + pub unsafe fn stringByDeletingPathExtension(&self) -> Id; + # [method_id (stringByAppendingPathExtension :)] pub unsafe fn stringByAppendingPathExtension( &self, str: &NSString, - ) -> Option> { - msg_send_id![self, stringByAppendingPathExtension: str] - } - pub unsafe fn stringByAbbreviatingWithTildeInPath(&self) -> Id { - msg_send_id![self, stringByAbbreviatingWithTildeInPath] - } - pub unsafe fn stringByExpandingTildeInPath(&self) -> Id { - msg_send_id![self, stringByExpandingTildeInPath] - } - pub unsafe fn stringByStandardizingPath(&self) -> Id { - msg_send_id![self, stringByStandardizingPath] - } - pub unsafe fn stringByResolvingSymlinksInPath(&self) -> Id { - msg_send_id![self, stringByResolvingSymlinksInPath] - } + ) -> Option>; + #[method_id(stringByAbbreviatingWithTildeInPath)] + pub unsafe fn stringByAbbreviatingWithTildeInPath(&self) -> Id; + #[method_id(stringByExpandingTildeInPath)] + pub unsafe fn stringByExpandingTildeInPath(&self) -> Id; + #[method_id(stringByStandardizingPath)] + pub unsafe fn stringByStandardizingPath(&self) -> Id; + #[method_id(stringByResolvingSymlinksInPath)] + pub unsafe fn stringByResolvingSymlinksInPath(&self) -> Id; + # [method_id (stringsByAppendingPaths :)] pub unsafe fn stringsByAppendingPaths( &self, paths: &NSArray, - ) -> Id, Shared> { - msg_send_id![self, stringsByAppendingPaths: paths] - } + ) -> Id, Shared>; + # [method (completePathIntoString : caseSensitive : matchesIntoArray : filterTypes :)] pub unsafe fn completePathIntoString_caseSensitive_matchesIntoArray_filterTypes( &self, outputName: Option<&mut Option>>, flag: bool, outputArray: Option<&mut Option, Shared>>>, filterTypes: Option<&NSArray>, - ) -> NSUInteger { - msg_send![ - self, - completePathIntoString: outputName, - caseSensitive: flag, - matchesIntoArray: outputArray, - filterTypes: filterTypes - ] - } - pub unsafe fn fileSystemRepresentation(&self) -> NonNull { - msg_send![self, fileSystemRepresentation] - } + ) -> NSUInteger; + #[method(fileSystemRepresentation)] + pub unsafe fn fileSystemRepresentation(&self) -> NonNull; + # [method (getFileSystemRepresentation : maxLength :)] pub unsafe fn getFileSystemRepresentation_maxLength( &self, cname: NonNull, max: NSUInteger, - ) -> bool { - msg_send![self, getFileSystemRepresentation: cname, maxLength: max] - } + ) -> bool; } ); extern_methods!( #[doc = "NSArrayPathExtensions"] unsafe impl NSArray { + # [method_id (pathsMatchingExtensions :)] pub unsafe fn pathsMatchingExtensions( &self, filterTypes: &NSArray, - ) -> Id, Shared> { - msg_send_id![self, pathsMatchingExtensions: filterTypes] - } + ) -> Id, Shared>; } ); diff --git a/icrate/src/Foundation/generated/NSPersonNameComponents.rs b/icrate/src/Foundation/generated/NSPersonNameComponents.rs index fa19b4320..4b48d730a 100644 --- a/icrate/src/Foundation/generated/NSPersonNameComponents.rs +++ b/icrate/src/Foundation/generated/NSPersonNameComponents.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSString::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSPersonNameComponents; @@ -14,50 +14,36 @@ extern_class!( ); extern_methods!( unsafe impl NSPersonNameComponents { - pub unsafe fn namePrefix(&self) -> Option> { - msg_send_id![self, namePrefix] - } - pub unsafe fn setNamePrefix(&self, namePrefix: Option<&NSString>) { - msg_send![self, setNamePrefix: namePrefix] - } - pub unsafe fn givenName(&self) -> Option> { - msg_send_id![self, givenName] - } - pub unsafe fn setGivenName(&self, givenName: Option<&NSString>) { - msg_send![self, setGivenName: givenName] - } - pub unsafe fn middleName(&self) -> Option> { - msg_send_id![self, middleName] - } - pub unsafe fn setMiddleName(&self, middleName: Option<&NSString>) { - msg_send![self, setMiddleName: middleName] - } - pub unsafe fn familyName(&self) -> Option> { - msg_send_id![self, familyName] - } - pub unsafe fn setFamilyName(&self, familyName: Option<&NSString>) { - msg_send![self, setFamilyName: familyName] - } - pub unsafe fn nameSuffix(&self) -> Option> { - msg_send_id![self, nameSuffix] - } - pub unsafe fn setNameSuffix(&self, nameSuffix: Option<&NSString>) { - msg_send![self, setNameSuffix: nameSuffix] - } - pub unsafe fn nickname(&self) -> Option> { - msg_send_id![self, nickname] - } - pub unsafe fn setNickname(&self, nickname: Option<&NSString>) { - msg_send![self, setNickname: nickname] - } - pub unsafe fn phoneticRepresentation(&self) -> Option> { - msg_send_id![self, phoneticRepresentation] - } + #[method_id(namePrefix)] + pub unsafe fn namePrefix(&self) -> Option>; + # [method (setNamePrefix :)] + pub unsafe fn setNamePrefix(&self, namePrefix: Option<&NSString>); + #[method_id(givenName)] + pub unsafe fn givenName(&self) -> Option>; + # [method (setGivenName :)] + pub unsafe fn setGivenName(&self, givenName: Option<&NSString>); + #[method_id(middleName)] + pub unsafe fn middleName(&self) -> Option>; + # [method (setMiddleName :)] + pub unsafe fn setMiddleName(&self, middleName: Option<&NSString>); + #[method_id(familyName)] + pub unsafe fn familyName(&self) -> Option>; + # [method (setFamilyName :)] + pub unsafe fn setFamilyName(&self, familyName: Option<&NSString>); + #[method_id(nameSuffix)] + pub unsafe fn nameSuffix(&self) -> Option>; + # [method (setNameSuffix :)] + pub unsafe fn setNameSuffix(&self, nameSuffix: Option<&NSString>); + #[method_id(nickname)] + pub unsafe fn nickname(&self) -> Option>; + # [method (setNickname :)] + pub unsafe fn setNickname(&self, nickname: Option<&NSString>); + #[method_id(phoneticRepresentation)] + pub unsafe fn phoneticRepresentation(&self) -> Option>; + # [method (setPhoneticRepresentation :)] pub unsafe fn setPhoneticRepresentation( &self, phoneticRepresentation: Option<&NSPersonNameComponents>, - ) { - msg_send![self, setPhoneticRepresentation: phoneticRepresentation] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSPersonNameComponentsFormatter.rs b/icrate/src/Foundation/generated/NSPersonNameComponentsFormatter.rs index 5b13c8e6d..8c6338048 100644 --- a/icrate/src/Foundation/generated/NSPersonNameComponentsFormatter.rs +++ b/icrate/src/Foundation/generated/NSPersonNameComponentsFormatter.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSPersonNameComponents::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSPersonNameComponentsFormatter; @@ -13,66 +13,45 @@ extern_class!( ); extern_methods!( unsafe impl NSPersonNameComponentsFormatter { - pub unsafe fn style(&self) -> NSPersonNameComponentsFormatterStyle { - msg_send![self, style] - } - pub unsafe fn setStyle(&self, style: NSPersonNameComponentsFormatterStyle) { - msg_send![self, setStyle: style] - } - pub unsafe fn isPhonetic(&self) -> bool { - msg_send![self, isPhonetic] - } - pub unsafe fn setPhonetic(&self, phonetic: bool) { - msg_send![self, setPhonetic: phonetic] - } - pub unsafe fn locale(&self) -> Id { - msg_send_id![self, locale] - } - pub unsafe fn setLocale(&self, locale: Option<&NSLocale>) { - msg_send![self, setLocale: locale] - } + #[method(style)] + pub unsafe fn style(&self) -> NSPersonNameComponentsFormatterStyle; + # [method (setStyle :)] + pub unsafe fn setStyle(&self, style: NSPersonNameComponentsFormatterStyle); + #[method(isPhonetic)] + pub unsafe fn isPhonetic(&self) -> bool; + # [method (setPhonetic :)] + pub unsafe fn setPhonetic(&self, phonetic: bool); + #[method_id(locale)] + pub unsafe fn locale(&self) -> Id; + # [method (setLocale :)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + # [method_id (localizedStringFromPersonNameComponents : style : options :)] pub unsafe fn localizedStringFromPersonNameComponents_style_options( components: &NSPersonNameComponents, nameFormatStyle: NSPersonNameComponentsFormatterStyle, nameOptions: NSPersonNameComponentsFormatterOptions, - ) -> Id { - msg_send_id![ - Self::class(), - localizedStringFromPersonNameComponents: components, - style: nameFormatStyle, - options: nameOptions - ] - } + ) -> Id; + # [method_id (stringFromPersonNameComponents :)] pub unsafe fn stringFromPersonNameComponents( &self, components: &NSPersonNameComponents, - ) -> Id { - msg_send_id![self, stringFromPersonNameComponents: components] - } + ) -> Id; + # [method_id (annotatedStringFromPersonNameComponents :)] pub unsafe fn annotatedStringFromPersonNameComponents( &self, components: &NSPersonNameComponents, - ) -> Id { - msg_send_id![self, annotatedStringFromPersonNameComponents: components] - } + ) -> Id; + # [method_id (personNameComponentsFromString :)] pub unsafe fn personNameComponentsFromString( &self, string: &NSString, - ) -> Option> { - msg_send_id![self, personNameComponentsFromString: string] - } + ) -> Option>; + # [method (getObjectValue : forString : errorDescription :)] pub unsafe fn getObjectValue_forString_errorDescription( &self, obj: Option<&mut Option>>, string: &NSString, error: Option<&mut Option>>, - ) -> bool { - msg_send![ - self, - getObjectValue: obj, - forString: string, - errorDescription: error - ] - } + ) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSPointerArray.rs b/icrate/src/Foundation/generated/NSPointerArray.rs index 97dd2344d..61a379377 100644 --- a/icrate/src/Foundation/generated/NSPointerArray.rs +++ b/icrate/src/Foundation/generated/NSPointerArray.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSPointerFunctions::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSPointerArray; @@ -14,78 +14,60 @@ extern_class!( ); extern_methods!( unsafe impl NSPointerArray { + # [method_id (initWithOptions :)] pub unsafe fn initWithOptions( &self, options: NSPointerFunctionsOptions, - ) -> Id { - msg_send_id![self, initWithOptions: options] - } + ) -> Id; + # [method_id (initWithPointerFunctions :)] pub unsafe fn initWithPointerFunctions( &self, functions: &NSPointerFunctions, - ) -> Id { - msg_send_id![self, initWithPointerFunctions: functions] - } + ) -> Id; + # [method_id (pointerArrayWithOptions :)] pub unsafe fn pointerArrayWithOptions( options: NSPointerFunctionsOptions, - ) -> Id { - msg_send_id![Self::class(), pointerArrayWithOptions: options] - } + ) -> Id; + # [method_id (pointerArrayWithPointerFunctions :)] pub unsafe fn pointerArrayWithPointerFunctions( functions: &NSPointerFunctions, - ) -> Id { - msg_send_id![Self::class(), pointerArrayWithPointerFunctions: functions] - } - pub unsafe fn pointerFunctions(&self) -> Id { - msg_send_id![self, pointerFunctions] - } - pub unsafe fn pointerAtIndex(&self, index: NSUInteger) -> *mut c_void { - msg_send![self, pointerAtIndex: index] - } - pub unsafe fn addPointer(&self, pointer: *mut c_void) { - msg_send![self, addPointer: pointer] - } - pub unsafe fn removePointerAtIndex(&self, index: NSUInteger) { - msg_send![self, removePointerAtIndex: index] - } - pub unsafe fn insertPointer_atIndex(&self, item: *mut c_void, index: NSUInteger) { - msg_send![self, insertPointer: item, atIndex: index] - } + ) -> Id; + #[method_id(pointerFunctions)] + pub unsafe fn pointerFunctions(&self) -> Id; + # [method (pointerAtIndex :)] + pub unsafe fn pointerAtIndex(&self, index: NSUInteger) -> *mut c_void; + # [method (addPointer :)] + pub unsafe fn addPointer(&self, pointer: *mut c_void); + # [method (removePointerAtIndex :)] + pub unsafe fn removePointerAtIndex(&self, index: NSUInteger); + # [method (insertPointer : atIndex :)] + pub unsafe fn insertPointer_atIndex(&self, item: *mut c_void, index: NSUInteger); + # [method (replacePointerAtIndex : withPointer :)] pub unsafe fn replacePointerAtIndex_withPointer( &self, index: NSUInteger, item: *mut c_void, - ) { - msg_send![self, replacePointerAtIndex: index, withPointer: item] - } - pub unsafe fn compact(&self) { - msg_send![self, compact] - } - pub unsafe fn count(&self) -> NSUInteger { - msg_send![self, count] - } - pub unsafe fn setCount(&self, count: NSUInteger) { - msg_send![self, setCount: count] - } + ); + #[method(compact)] + pub unsafe fn compact(&self); + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + # [method (setCount :)] + pub unsafe fn setCount(&self, count: NSUInteger); } ); extern_methods!( #[doc = "NSPointerArrayConveniences"] unsafe impl NSPointerArray { - pub unsafe fn pointerArrayWithStrongObjects() -> Id { - msg_send_id![Self::class(), pointerArrayWithStrongObjects] - } - pub unsafe fn pointerArrayWithWeakObjects() -> Id { - msg_send_id![Self::class(), pointerArrayWithWeakObjects] - } - pub unsafe fn strongObjectsPointerArray() -> Id { - msg_send_id![Self::class(), strongObjectsPointerArray] - } - pub unsafe fn weakObjectsPointerArray() -> Id { - msg_send_id![Self::class(), weakObjectsPointerArray] - } - pub unsafe fn allObjects(&self) -> Id { - msg_send_id![self, allObjects] - } + #[method_id(pointerArrayWithStrongObjects)] + pub unsafe fn pointerArrayWithStrongObjects() -> Id; + #[method_id(pointerArrayWithWeakObjects)] + pub unsafe fn pointerArrayWithWeakObjects() -> Id; + #[method_id(strongObjectsPointerArray)] + pub unsafe fn strongObjectsPointerArray() -> Id; + #[method_id(weakObjectsPointerArray)] + pub unsafe fn weakObjectsPointerArray() -> Id; + #[method_id(allObjects)] + pub unsafe fn allObjects(&self) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSPointerFunctions.rs b/icrate/src/Foundation/generated/NSPointerFunctions.rs index 32bc45080..71343ba5d 100644 --- a/icrate/src/Foundation/generated/NSPointerFunctions.rs +++ b/icrate/src/Foundation/generated/NSPointerFunctions.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSPointerFunctions; @@ -12,67 +12,46 @@ extern_class!( ); extern_methods!( unsafe impl NSPointerFunctions { + # [method_id (initWithOptions :)] pub unsafe fn initWithOptions( &self, options: NSPointerFunctionsOptions, - ) -> Id { - msg_send_id![self, initWithOptions: options] - } + ) -> Id; + # [method_id (pointerFunctionsWithOptions :)] pub unsafe fn pointerFunctionsWithOptions( options: NSPointerFunctionsOptions, - ) -> Id { - msg_send_id![Self::class(), pointerFunctionsWithOptions: options] - } - pub unsafe fn hashFunction(&self) -> *mut TodoFunction { - msg_send![self, hashFunction] - } - pub unsafe fn setHashFunction(&self, hashFunction: *mut TodoFunction) { - msg_send![self, setHashFunction: hashFunction] - } - pub unsafe fn isEqualFunction(&self) -> *mut TodoFunction { - msg_send![self, isEqualFunction] - } - pub unsafe fn setIsEqualFunction(&self, isEqualFunction: *mut TodoFunction) { - msg_send![self, setIsEqualFunction: isEqualFunction] - } - pub unsafe fn sizeFunction(&self) -> *mut TodoFunction { - msg_send![self, sizeFunction] - } - pub unsafe fn setSizeFunction(&self, sizeFunction: *mut TodoFunction) { - msg_send![self, setSizeFunction: sizeFunction] - } - pub unsafe fn descriptionFunction(&self) -> *mut TodoFunction { - msg_send![self, descriptionFunction] - } - pub unsafe fn setDescriptionFunction(&self, descriptionFunction: *mut TodoFunction) { - msg_send![self, setDescriptionFunction: descriptionFunction] - } - pub unsafe fn relinquishFunction(&self) -> *mut TodoFunction { - msg_send![self, relinquishFunction] - } - pub unsafe fn setRelinquishFunction(&self, relinquishFunction: *mut TodoFunction) { - msg_send![self, setRelinquishFunction: relinquishFunction] - } - pub unsafe fn acquireFunction(&self) -> *mut TodoFunction { - msg_send![self, acquireFunction] - } - pub unsafe fn setAcquireFunction(&self, acquireFunction: *mut TodoFunction) { - msg_send![self, setAcquireFunction: acquireFunction] - } - pub unsafe fn usesStrongWriteBarrier(&self) -> bool { - msg_send![self, usesStrongWriteBarrier] - } - pub unsafe fn setUsesStrongWriteBarrier(&self, usesStrongWriteBarrier: bool) { - msg_send![self, setUsesStrongWriteBarrier: usesStrongWriteBarrier] - } - pub unsafe fn usesWeakReadAndWriteBarriers(&self) -> bool { - msg_send![self, usesWeakReadAndWriteBarriers] - } - pub unsafe fn setUsesWeakReadAndWriteBarriers(&self, usesWeakReadAndWriteBarriers: bool) { - msg_send![ - self, - setUsesWeakReadAndWriteBarriers: usesWeakReadAndWriteBarriers - ] - } + ) -> Id; + #[method(hashFunction)] + pub unsafe fn hashFunction(&self) -> *mut TodoFunction; + # [method (setHashFunction :)] + pub unsafe fn setHashFunction(&self, hashFunction: *mut TodoFunction); + #[method(isEqualFunction)] + pub unsafe fn isEqualFunction(&self) -> *mut TodoFunction; + # [method (setIsEqualFunction :)] + pub unsafe fn setIsEqualFunction(&self, isEqualFunction: *mut TodoFunction); + #[method(sizeFunction)] + pub unsafe fn sizeFunction(&self) -> *mut TodoFunction; + # [method (setSizeFunction :)] + pub unsafe fn setSizeFunction(&self, sizeFunction: *mut TodoFunction); + #[method(descriptionFunction)] + pub unsafe fn descriptionFunction(&self) -> *mut TodoFunction; + # [method (setDescriptionFunction :)] + pub unsafe fn setDescriptionFunction(&self, descriptionFunction: *mut TodoFunction); + #[method(relinquishFunction)] + pub unsafe fn relinquishFunction(&self) -> *mut TodoFunction; + # [method (setRelinquishFunction :)] + pub unsafe fn setRelinquishFunction(&self, relinquishFunction: *mut TodoFunction); + #[method(acquireFunction)] + pub unsafe fn acquireFunction(&self) -> *mut TodoFunction; + # [method (setAcquireFunction :)] + pub unsafe fn setAcquireFunction(&self, acquireFunction: *mut TodoFunction); + #[method(usesStrongWriteBarrier)] + pub unsafe fn usesStrongWriteBarrier(&self) -> bool; + # [method (setUsesStrongWriteBarrier :)] + pub unsafe fn setUsesStrongWriteBarrier(&self, usesStrongWriteBarrier: bool); + #[method(usesWeakReadAndWriteBarriers)] + pub unsafe fn usesWeakReadAndWriteBarriers(&self) -> bool; + # [method (setUsesWeakReadAndWriteBarriers :)] + pub unsafe fn setUsesWeakReadAndWriteBarriers(&self, usesWeakReadAndWriteBarriers: bool); } ); diff --git a/icrate/src/Foundation/generated/NSPort.rs b/icrate/src/Foundation/generated/NSPort.rs index f1d1d5ede..80af9fc2c 100644 --- a/icrate/src/Foundation/generated/NSPort.rs +++ b/icrate/src/Foundation/generated/NSPort.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSRunLoop::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSPort; @@ -20,45 +20,31 @@ extern_class!( ); extern_methods!( unsafe impl NSPort { - pub unsafe fn port() -> Id { - msg_send_id![Self::class(), port] - } - pub unsafe fn invalidate(&self) { - msg_send![self, invalidate] - } - pub unsafe fn isValid(&self) -> bool { - msg_send![self, isValid] - } - pub unsafe fn setDelegate(&self, anObject: Option<&NSPortDelegate>) { - msg_send![self, setDelegate: anObject] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn scheduleInRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, scheduleInRunLoop: runLoop, forMode: mode] - } - pub unsafe fn removeFromRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, removeFromRunLoop: runLoop, forMode: mode] - } - pub unsafe fn reservedSpaceLength(&self) -> NSUInteger { - msg_send![self, reservedSpaceLength] - } + #[method_id(port)] + pub unsafe fn port() -> Id; + #[method(invalidate)] + pub unsafe fn invalidate(&self); + #[method(isValid)] + pub unsafe fn isValid(&self) -> bool; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, anObject: Option<&NSPortDelegate>); + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (scheduleInRunLoop : forMode :)] + pub unsafe fn scheduleInRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode); + # [method (removeFromRunLoop : forMode :)] + pub unsafe fn removeFromRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode); + #[method(reservedSpaceLength)] + pub unsafe fn reservedSpaceLength(&self) -> NSUInteger; + # [method (sendBeforeDate : components : from : reserved :)] pub unsafe fn sendBeforeDate_components_from_reserved( &self, limitDate: &NSDate, components: Option<&NSMutableArray>, receivePort: Option<&NSPort>, headerSpaceReserved: NSUInteger, - ) -> bool { - msg_send![ - self, - sendBeforeDate: limitDate, - components: components, - from: receivePort, - reserved: headerSpaceReserved - ] - } + ) -> bool; + # [method (sendBeforeDate : msgid : components : from : reserved :)] pub unsafe fn sendBeforeDate_msgid_components_from_reserved( &self, limitDate: &NSDate, @@ -66,37 +52,21 @@ extern_methods!( components: Option<&NSMutableArray>, receivePort: Option<&NSPort>, headerSpaceReserved: NSUInteger, - ) -> bool { - msg_send![ - self, - sendBeforeDate: limitDate, - msgid: msgID, - components: components, - from: receivePort, - reserved: headerSpaceReserved - ] - } + ) -> bool; + # [method (addConnection : toRunLoop : forMode :)] pub unsafe fn addConnection_toRunLoop_forMode( &self, conn: &NSConnection, runLoop: &NSRunLoop, mode: &NSRunLoopMode, - ) { - msg_send![self, addConnection: conn, toRunLoop: runLoop, forMode: mode] - } + ); + # [method (removeConnection : fromRunLoop : forMode :)] pub unsafe fn removeConnection_fromRunLoop_forMode( &self, conn: &NSConnection, runLoop: &NSRunLoop, mode: &NSRunLoopMode, - ) { - msg_send![ - self, - removeConnection: conn, - fromRunLoop: runLoop, - forMode: mode - ] - } + ); } ); pub type NSPortDelegate = NSObject; @@ -109,40 +79,31 @@ extern_class!( ); extern_methods!( unsafe impl NSMachPort { - pub unsafe fn portWithMachPort(machPort: u32) -> Id { - msg_send_id![Self::class(), portWithMachPort: machPort] - } - pub unsafe fn initWithMachPort(&self, machPort: u32) -> Id { - msg_send_id![self, initWithMachPort: machPort] - } - pub unsafe fn setDelegate(&self, anObject: Option<&NSMachPortDelegate>) { - msg_send![self, setDelegate: anObject] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } + # [method_id (portWithMachPort :)] + pub unsafe fn portWithMachPort(machPort: u32) -> Id; + # [method_id (initWithMachPort :)] + pub unsafe fn initWithMachPort(&self, machPort: u32) -> Id; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, anObject: Option<&NSMachPortDelegate>); + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method_id (portWithMachPort : options :)] pub unsafe fn portWithMachPort_options( machPort: u32, f: NSMachPortOptions, - ) -> Id { - msg_send_id![Self::class(), portWithMachPort: machPort, options: f] - } + ) -> Id; + # [method_id (initWithMachPort : options :)] pub unsafe fn initWithMachPort_options( &self, machPort: u32, f: NSMachPortOptions, - ) -> Id { - msg_send_id![self, initWithMachPort: machPort, options: f] - } - pub unsafe fn machPort(&self) -> u32 { - msg_send![self, machPort] - } - pub unsafe fn scheduleInRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, scheduleInRunLoop: runLoop, forMode: mode] - } - pub unsafe fn removeFromRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, removeFromRunLoop: runLoop, forMode: mode] - } + ) -> Id; + #[method(machPort)] + pub unsafe fn machPort(&self) -> u32; + # [method (scheduleInRunLoop : forMode :)] + pub unsafe fn scheduleInRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode); + # [method (removeFromRunLoop : forMode :)] + pub unsafe fn removeFromRunLoop_forMode(&self, runLoop: &NSRunLoop, mode: &NSRunLoopMode); } ); pub type NSMachPortDelegate = NSObject; @@ -165,78 +126,49 @@ extern_class!( ); extern_methods!( unsafe impl NSSocketPort { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithTCPPort(&self, port: c_ushort) -> Option> { - msg_send_id![self, initWithTCPPort: port] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithTCPPort :)] + pub unsafe fn initWithTCPPort(&self, port: c_ushort) -> Option>; + # [method_id (initWithProtocolFamily : socketType : protocol : address :)] pub unsafe fn initWithProtocolFamily_socketType_protocol_address( &self, family: c_int, type_: c_int, protocol: c_int, address: &NSData, - ) -> Option> { - msg_send_id![ - self, - initWithProtocolFamily: family, - socketType: type_, - protocol: protocol, - address: address - ] - } + ) -> Option>; + # [method_id (initWithProtocolFamily : socketType : protocol : socket :)] pub unsafe fn initWithProtocolFamily_socketType_protocol_socket( &self, family: c_int, type_: c_int, protocol: c_int, sock: NSSocketNativeHandle, - ) -> Option> { - msg_send_id![ - self, - initWithProtocolFamily: family, - socketType: type_, - protocol: protocol, - socket: sock - ] - } + ) -> Option>; + # [method_id (initRemoteWithTCPPort : host :)] pub unsafe fn initRemoteWithTCPPort_host( &self, port: c_ushort, hostName: Option<&NSString>, - ) -> Option> { - msg_send_id![self, initRemoteWithTCPPort: port, host: hostName] - } + ) -> Option>; + # [method_id (initRemoteWithProtocolFamily : socketType : protocol : address :)] pub unsafe fn initRemoteWithProtocolFamily_socketType_protocol_address( &self, family: c_int, type_: c_int, protocol: c_int, address: &NSData, - ) -> Id { - msg_send_id![ - self, - initRemoteWithProtocolFamily: family, - socketType: type_, - protocol: protocol, - address: address - ] - } - pub unsafe fn protocolFamily(&self) -> c_int { - msg_send![self, protocolFamily] - } - pub unsafe fn socketType(&self) -> c_int { - msg_send![self, socketType] - } - pub unsafe fn protocol(&self) -> c_int { - msg_send![self, protocol] - } - pub unsafe fn address(&self) -> Id { - msg_send_id![self, address] - } - pub unsafe fn socket(&self) -> NSSocketNativeHandle { - msg_send![self, socket] - } + ) -> Id; + #[method(protocolFamily)] + pub unsafe fn protocolFamily(&self) -> c_int; + #[method(socketType)] + pub unsafe fn socketType(&self) -> c_int; + #[method(protocol)] + pub unsafe fn protocol(&self) -> c_int; + #[method_id(address)] + pub unsafe fn address(&self) -> Id; + #[method(socket)] + pub unsafe fn socket(&self) -> NSSocketNativeHandle; } ); diff --git a/icrate/src/Foundation/generated/NSPortCoder.rs b/icrate/src/Foundation/generated/NSPortCoder.rs index cd6cbbd5d..cfc51f59e 100644 --- a/icrate/src/Foundation/generated/NSPortCoder.rs +++ b/icrate/src/Foundation/generated/NSPortCoder.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSCoder::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSPortCoder; @@ -15,62 +15,42 @@ extern_class!( ); extern_methods!( unsafe impl NSPortCoder { - pub unsafe fn isBycopy(&self) -> bool { - msg_send![self, isBycopy] - } - pub unsafe fn isByref(&self) -> bool { - msg_send![self, isByref] - } - pub unsafe fn encodePortObject(&self, aport: &NSPort) { - msg_send![self, encodePortObject: aport] - } - pub unsafe fn decodePortObject(&self) -> Option> { - msg_send_id![self, decodePortObject] - } - pub unsafe fn connection(&self) -> Option> { - msg_send_id![self, connection] - } + #[method(isBycopy)] + pub unsafe fn isBycopy(&self) -> bool; + #[method(isByref)] + pub unsafe fn isByref(&self) -> bool; + # [method (encodePortObject :)] + pub unsafe fn encodePortObject(&self, aport: &NSPort); + #[method_id(decodePortObject)] + pub unsafe fn decodePortObject(&self) -> Option>; + #[method_id(connection)] + pub unsafe fn connection(&self) -> Option>; + # [method_id (portCoderWithReceivePort : sendPort : components :)] pub unsafe fn portCoderWithReceivePort_sendPort_components( rcvPort: Option<&NSPort>, sndPort: Option<&NSPort>, comps: Option<&NSArray>, - ) -> Id { - msg_send_id![ - Self::class(), - portCoderWithReceivePort: rcvPort, - sendPort: sndPort, - components: comps - ] - } + ) -> Id; + # [method_id (initWithReceivePort : sendPort : components :)] pub unsafe fn initWithReceivePort_sendPort_components( &self, rcvPort: Option<&NSPort>, sndPort: Option<&NSPort>, comps: Option<&NSArray>, - ) -> Id { - msg_send_id![ - self, - initWithReceivePort: rcvPort, - sendPort: sndPort, - components: comps - ] - } - pub unsafe fn dispatch(&self) { - msg_send![self, dispatch] - } + ) -> Id; + #[method(dispatch)] + pub unsafe fn dispatch(&self); } ); extern_methods!( #[doc = "NSDistributedObjects"] unsafe impl NSObject { - pub unsafe fn classForPortCoder(&self) -> &Class { - msg_send![self, classForPortCoder] - } + #[method(classForPortCoder)] + pub unsafe fn classForPortCoder(&self) -> &Class; + # [method_id (replacementObjectForPortCoder :)] pub unsafe fn replacementObjectForPortCoder( &self, coder: &NSPortCoder, - ) -> Option> { - msg_send_id![self, replacementObjectForPortCoder: coder] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSPortMessage.rs b/icrate/src/Foundation/generated/NSPortMessage.rs index 04fb92afa..fb466dc80 100644 --- a/icrate/src/Foundation/generated/NSPortMessage.rs +++ b/icrate/src/Foundation/generated/NSPortMessage.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSPortMessage; @@ -16,36 +16,24 @@ extern_class!( ); extern_methods!( unsafe impl NSPortMessage { + # [method_id (initWithSendPort : receivePort : components :)] pub unsafe fn initWithSendPort_receivePort_components( &self, sendPort: Option<&NSPort>, replyPort: Option<&NSPort>, components: Option<&NSArray>, - ) -> Id { - msg_send_id![ - self, - initWithSendPort: sendPort, - receivePort: replyPort, - components: components - ] - } - pub unsafe fn components(&self) -> Option> { - msg_send_id![self, components] - } - pub unsafe fn receivePort(&self) -> Option> { - msg_send_id![self, receivePort] - } - pub unsafe fn sendPort(&self) -> Option> { - msg_send_id![self, sendPort] - } - pub unsafe fn sendBeforeDate(&self, date: &NSDate) -> bool { - msg_send![self, sendBeforeDate: date] - } - pub unsafe fn msgid(&self) -> u32 { - msg_send![self, msgid] - } - pub unsafe fn setMsgid(&self, msgid: u32) { - msg_send![self, setMsgid: msgid] - } + ) -> Id; + #[method_id(components)] + pub unsafe fn components(&self) -> Option>; + #[method_id(receivePort)] + pub unsafe fn receivePort(&self) -> Option>; + #[method_id(sendPort)] + pub unsafe fn sendPort(&self) -> Option>; + # [method (sendBeforeDate :)] + pub unsafe fn sendBeforeDate(&self, date: &NSDate) -> bool; + #[method(msgid)] + pub unsafe fn msgid(&self) -> u32; + # [method (setMsgid :)] + pub unsafe fn setMsgid(&self, msgid: u32); } ); diff --git a/icrate/src/Foundation/generated/NSPortNameServer.rs b/icrate/src/Foundation/generated/NSPortNameServer.rs index 2d1f567cd..bfc9393c9 100644 --- a/icrate/src/Foundation/generated/NSPortNameServer.rs +++ b/icrate/src/Foundation/generated/NSPortNameServer.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSPortNameServer; @@ -14,25 +14,20 @@ extern_class!( ); extern_methods!( unsafe impl NSPortNameServer { - pub unsafe fn systemDefaultPortNameServer() -> Id { - msg_send_id![Self::class(), systemDefaultPortNameServer] - } - pub unsafe fn portForName(&self, name: &NSString) -> Option> { - msg_send_id![self, portForName: name] - } + #[method_id(systemDefaultPortNameServer)] + pub unsafe fn systemDefaultPortNameServer() -> Id; + # [method_id (portForName :)] + pub unsafe fn portForName(&self, name: &NSString) -> Option>; + # [method_id (portForName : host :)] pub unsafe fn portForName_host( &self, name: &NSString, host: Option<&NSString>, - ) -> Option> { - msg_send_id![self, portForName: name, host: host] - } - pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool { - msg_send![self, registerPort: port, name: name] - } - pub unsafe fn removePortForName(&self, name: &NSString) -> bool { - msg_send![self, removePortForName: name] - } + ) -> Option>; + # [method (registerPort : name :)] + pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool; + # [method (removePortForName :)] + pub unsafe fn removePortForName(&self, name: &NSString) -> bool; } ); extern_class!( @@ -44,25 +39,20 @@ extern_class!( ); extern_methods!( unsafe impl NSMachBootstrapServer { - pub unsafe fn sharedInstance() -> Id { - msg_send_id![Self::class(), sharedInstance] - } - pub unsafe fn portForName(&self, name: &NSString) -> Option> { - msg_send_id![self, portForName: name] - } + #[method_id(sharedInstance)] + pub unsafe fn sharedInstance() -> Id; + # [method_id (portForName :)] + pub unsafe fn portForName(&self, name: &NSString) -> Option>; + # [method_id (portForName : host :)] pub unsafe fn portForName_host( &self, name: &NSString, host: Option<&NSString>, - ) -> Option> { - msg_send_id![self, portForName: name, host: host] - } - pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool { - msg_send![self, registerPort: port, name: name] - } - pub unsafe fn servicePortWithName(&self, name: &NSString) -> Option> { - msg_send_id![self, servicePortWithName: name] - } + ) -> Option>; + # [method (registerPort : name :)] + pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool; + # [method_id (servicePortWithName :)] + pub unsafe fn servicePortWithName(&self, name: &NSString) -> Option>; } ); extern_class!( @@ -74,19 +64,16 @@ extern_class!( ); extern_methods!( unsafe impl NSMessagePortNameServer { - pub unsafe fn sharedInstance() -> Id { - msg_send_id![Self::class(), sharedInstance] - } - pub unsafe fn portForName(&self, name: &NSString) -> Option> { - msg_send_id![self, portForName: name] - } + #[method_id(sharedInstance)] + pub unsafe fn sharedInstance() -> Id; + # [method_id (portForName :)] + pub unsafe fn portForName(&self, name: &NSString) -> Option>; + # [method_id (portForName : host :)] pub unsafe fn portForName_host( &self, name: &NSString, host: Option<&NSString>, - ) -> Option> { - msg_send_id![self, portForName: name, host: host] - } + ) -> Option>; } ); extern_class!( @@ -98,59 +85,37 @@ extern_class!( ); extern_methods!( unsafe impl NSSocketPortNameServer { - pub unsafe fn sharedInstance() -> Id { - msg_send_id![Self::class(), sharedInstance] - } - pub unsafe fn portForName(&self, name: &NSString) -> Option> { - msg_send_id![self, portForName: name] - } + #[method_id(sharedInstance)] + pub unsafe fn sharedInstance() -> Id; + # [method_id (portForName :)] + pub unsafe fn portForName(&self, name: &NSString) -> Option>; + # [method_id (portForName : host :)] pub unsafe fn portForName_host( &self, name: &NSString, host: Option<&NSString>, - ) -> Option> { - msg_send_id![self, portForName: name, host: host] - } - pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool { - msg_send![self, registerPort: port, name: name] - } - pub unsafe fn removePortForName(&self, name: &NSString) -> bool { - msg_send![self, removePortForName: name] - } + ) -> Option>; + # [method (registerPort : name :)] + pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool; + # [method (removePortForName :)] + pub unsafe fn removePortForName(&self, name: &NSString) -> bool; + # [method_id (portForName : host : nameServerPortNumber :)] pub unsafe fn portForName_host_nameServerPortNumber( &self, name: &NSString, host: Option<&NSString>, portNumber: u16, - ) -> Option> { - msg_send_id![ - self, - portForName: name, - host: host, - nameServerPortNumber: portNumber - ] - } + ) -> Option>; + # [method (registerPort : name : nameServerPortNumber :)] pub unsafe fn registerPort_name_nameServerPortNumber( &self, port: &NSPort, name: &NSString, portNumber: u16, - ) -> bool { - msg_send![ - self, - registerPort: port, - name: name, - nameServerPortNumber: portNumber - ] - } - pub unsafe fn defaultNameServerPortNumber(&self) -> u16 { - msg_send![self, defaultNameServerPortNumber] - } - pub unsafe fn setDefaultNameServerPortNumber(&self, defaultNameServerPortNumber: u16) { - msg_send![ - self, - setDefaultNameServerPortNumber: defaultNameServerPortNumber - ] - } + ) -> bool; + #[method(defaultNameServerPortNumber)] + pub unsafe fn defaultNameServerPortNumber(&self) -> u16; + # [method (setDefaultNameServerPortNumber :)] + pub unsafe fn setDefaultNameServerPortNumber(&self, defaultNameServerPortNumber: u16); } ); diff --git a/icrate/src/Foundation/generated/NSPredicate.rs b/icrate/src/Foundation/generated/NSPredicate.rs index 526a60d31..06c4cc809 100644 --- a/icrate/src/Foundation/generated/NSPredicate.rs +++ b/icrate/src/Foundation/generated/NSPredicate.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSSet::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSPredicate; @@ -17,119 +17,91 @@ extern_class!( ); extern_methods!( unsafe impl NSPredicate { + # [method_id (predicateWithFormat : argumentArray :)] pub unsafe fn predicateWithFormat_argumentArray( predicateFormat: &NSString, arguments: Option<&NSArray>, - ) -> Id { - msg_send_id![ - Self::class(), - predicateWithFormat: predicateFormat, - argumentArray: arguments - ] - } + ) -> Id; + # [method_id (predicateWithFormat : arguments :)] pub unsafe fn predicateWithFormat_arguments( predicateFormat: &NSString, argList: va_list, - ) -> Id { - msg_send_id![ - Self::class(), - predicateWithFormat: predicateFormat, - arguments: argList - ] - } + ) -> Id; + # [method_id (predicateFromMetadataQueryString :)] pub unsafe fn predicateFromMetadataQueryString( queryString: &NSString, - ) -> Option> { - msg_send_id![Self::class(), predicateFromMetadataQueryString: queryString] - } - pub unsafe fn predicateWithValue(value: bool) -> Id { - msg_send_id![Self::class(), predicateWithValue: value] - } - pub unsafe fn predicateWithBlock(block: TodoBlock) -> Id { - msg_send_id![Self::class(), predicateWithBlock: block] - } - pub unsafe fn predicateFormat(&self) -> Id { - msg_send_id![self, predicateFormat] - } + ) -> Option>; + # [method_id (predicateWithValue :)] + pub unsafe fn predicateWithValue(value: bool) -> Id; + # [method_id (predicateWithBlock :)] + pub unsafe fn predicateWithBlock(block: TodoBlock) -> Id; + #[method_id(predicateFormat)] + pub unsafe fn predicateFormat(&self) -> Id; + # [method_id (predicateWithSubstitutionVariables :)] pub unsafe fn predicateWithSubstitutionVariables( &self, variables: &NSDictionary, - ) -> Id { - msg_send_id![self, predicateWithSubstitutionVariables: variables] - } - pub unsafe fn evaluateWithObject(&self, object: Option<&Object>) -> bool { - msg_send![self, evaluateWithObject: object] - } + ) -> Id; + # [method (evaluateWithObject :)] + pub unsafe fn evaluateWithObject(&self, object: Option<&Object>) -> bool; + # [method (evaluateWithObject : substitutionVariables :)] pub unsafe fn evaluateWithObject_substitutionVariables( &self, object: Option<&Object>, bindings: Option<&NSDictionary>, - ) -> bool { - msg_send![ - self, - evaluateWithObject: object, - substitutionVariables: bindings - ] - } - pub unsafe fn allowEvaluation(&self) { - msg_send![self, allowEvaluation] - } + ) -> bool; + #[method(allowEvaluation)] + pub unsafe fn allowEvaluation(&self); } ); extern_methods!( #[doc = "NSPredicateSupport"] unsafe impl NSArray { + # [method_id (filteredArrayUsingPredicate :)] pub unsafe fn filteredArrayUsingPredicate( &self, predicate: &NSPredicate, - ) -> Id, Shared> { - msg_send_id![self, filteredArrayUsingPredicate: predicate] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSPredicateSupport"] unsafe impl NSMutableArray { - pub unsafe fn filterUsingPredicate(&self, predicate: &NSPredicate) { - msg_send![self, filterUsingPredicate: predicate] - } + # [method (filterUsingPredicate :)] + pub unsafe fn filterUsingPredicate(&self, predicate: &NSPredicate); } ); extern_methods!( #[doc = "NSPredicateSupport"] unsafe impl NSSet { + # [method_id (filteredSetUsingPredicate :)] pub unsafe fn filteredSetUsingPredicate( &self, predicate: &NSPredicate, - ) -> Id, Shared> { - msg_send_id![self, filteredSetUsingPredicate: predicate] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSPredicateSupport"] unsafe impl NSMutableSet { - pub unsafe fn filterUsingPredicate(&self, predicate: &NSPredicate) { - msg_send![self, filterUsingPredicate: predicate] - } + # [method (filterUsingPredicate :)] + pub unsafe fn filterUsingPredicate(&self, predicate: &NSPredicate); } ); extern_methods!( #[doc = "NSPredicateSupport"] unsafe impl NSOrderedSet { + # [method_id (filteredOrderedSetUsingPredicate :)] pub unsafe fn filteredOrderedSetUsingPredicate( &self, p: &NSPredicate, - ) -> Id, Shared> { - msg_send_id![self, filteredOrderedSetUsingPredicate: p] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSPredicateSupport"] unsafe impl NSMutableOrderedSet { - pub unsafe fn filterUsingPredicate(&self, p: &NSPredicate) { - msg_send![self, filterUsingPredicate: p] - } + # [method (filterUsingPredicate :)] + pub unsafe fn filterUsingPredicate(&self, p: &NSPredicate); } ); diff --git a/icrate/src/Foundation/generated/NSProcessInfo.rs b/icrate/src/Foundation/generated/NSProcessInfo.rs index 662de6557..92f3be97a 100644 --- a/icrate/src/Foundation/generated/NSProcessInfo.rs +++ b/icrate/src/Foundation/generated/NSProcessInfo.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSProcessInfo; @@ -17,160 +17,115 @@ extern_class!( ); extern_methods!( unsafe impl NSProcessInfo { - pub unsafe fn processInfo() -> Id { - msg_send_id![Self::class(), processInfo] - } - pub unsafe fn environment(&self) -> Id, Shared> { - msg_send_id![self, environment] - } - pub unsafe fn arguments(&self) -> Id, Shared> { - msg_send_id![self, arguments] - } - pub unsafe fn hostName(&self) -> Id { - msg_send_id![self, hostName] - } - pub unsafe fn processName(&self) -> Id { - msg_send_id![self, processName] - } - pub unsafe fn setProcessName(&self, processName: &NSString) { - msg_send![self, setProcessName: processName] - } - pub unsafe fn processIdentifier(&self) -> c_int { - msg_send![self, processIdentifier] - } - pub unsafe fn globallyUniqueString(&self) -> Id { - msg_send_id![self, globallyUniqueString] - } - pub unsafe fn operatingSystem(&self) -> NSUInteger { - msg_send![self, operatingSystem] - } - pub unsafe fn operatingSystemName(&self) -> Id { - msg_send_id![self, operatingSystemName] - } - pub unsafe fn operatingSystemVersionString(&self) -> Id { - msg_send_id![self, operatingSystemVersionString] - } - pub unsafe fn operatingSystemVersion(&self) -> NSOperatingSystemVersion { - msg_send![self, operatingSystemVersion] - } - pub unsafe fn processorCount(&self) -> NSUInteger { - msg_send![self, processorCount] - } - pub unsafe fn activeProcessorCount(&self) -> NSUInteger { - msg_send![self, activeProcessorCount] - } - pub unsafe fn physicalMemory(&self) -> c_ulonglong { - msg_send![self, physicalMemory] - } + #[method_id(processInfo)] + pub unsafe fn processInfo() -> Id; + #[method_id(environment)] + pub unsafe fn environment(&self) -> Id, Shared>; + #[method_id(arguments)] + pub unsafe fn arguments(&self) -> Id, Shared>; + #[method_id(hostName)] + pub unsafe fn hostName(&self) -> Id; + #[method_id(processName)] + pub unsafe fn processName(&self) -> Id; + # [method (setProcessName :)] + pub unsafe fn setProcessName(&self, processName: &NSString); + #[method(processIdentifier)] + pub unsafe fn processIdentifier(&self) -> c_int; + #[method_id(globallyUniqueString)] + pub unsafe fn globallyUniqueString(&self) -> Id; + #[method(operatingSystem)] + pub unsafe fn operatingSystem(&self) -> NSUInteger; + #[method_id(operatingSystemName)] + pub unsafe fn operatingSystemName(&self) -> Id; + #[method_id(operatingSystemVersionString)] + pub unsafe fn operatingSystemVersionString(&self) -> Id; + #[method(operatingSystemVersion)] + pub unsafe fn operatingSystemVersion(&self) -> NSOperatingSystemVersion; + #[method(processorCount)] + pub unsafe fn processorCount(&self) -> NSUInteger; + #[method(activeProcessorCount)] + pub unsafe fn activeProcessorCount(&self) -> NSUInteger; + #[method(physicalMemory)] + pub unsafe fn physicalMemory(&self) -> c_ulonglong; + # [method (isOperatingSystemAtLeastVersion :)] pub unsafe fn isOperatingSystemAtLeastVersion( &self, version: NSOperatingSystemVersion, - ) -> bool { - msg_send![self, isOperatingSystemAtLeastVersion: version] - } - pub unsafe fn systemUptime(&self) -> NSTimeInterval { - msg_send![self, systemUptime] - } - pub unsafe fn disableSuddenTermination(&self) { - msg_send![self, disableSuddenTermination] - } - pub unsafe fn enableSuddenTermination(&self) { - msg_send![self, enableSuddenTermination] - } - pub unsafe fn disableAutomaticTermination(&self, reason: &NSString) { - msg_send![self, disableAutomaticTermination: reason] - } - pub unsafe fn enableAutomaticTermination(&self, reason: &NSString) { - msg_send![self, enableAutomaticTermination: reason] - } - pub unsafe fn automaticTerminationSupportEnabled(&self) -> bool { - msg_send![self, automaticTerminationSupportEnabled] - } + ) -> bool; + #[method(systemUptime)] + pub unsafe fn systemUptime(&self) -> NSTimeInterval; + #[method(disableSuddenTermination)] + pub unsafe fn disableSuddenTermination(&self); + #[method(enableSuddenTermination)] + pub unsafe fn enableSuddenTermination(&self); + # [method (disableAutomaticTermination :)] + pub unsafe fn disableAutomaticTermination(&self, reason: &NSString); + # [method (enableAutomaticTermination :)] + pub unsafe fn enableAutomaticTermination(&self, reason: &NSString); + #[method(automaticTerminationSupportEnabled)] + pub unsafe fn automaticTerminationSupportEnabled(&self) -> bool; + # [method (setAutomaticTerminationSupportEnabled :)] pub unsafe fn setAutomaticTerminationSupportEnabled( &self, automaticTerminationSupportEnabled: bool, - ) { - msg_send![ - self, - setAutomaticTerminationSupportEnabled: automaticTerminationSupportEnabled - ] - } + ); } ); extern_methods!( #[doc = "NSProcessInfoActivity"] unsafe impl NSProcessInfo { + # [method_id (beginActivityWithOptions : reason :)] pub unsafe fn beginActivityWithOptions_reason( &self, options: NSActivityOptions, reason: &NSString, - ) -> Id { - msg_send_id![self, beginActivityWithOptions: options, reason: reason] - } - pub unsafe fn endActivity(&self, activity: &NSObject) { - msg_send![self, endActivity: activity] - } + ) -> Id; + # [method (endActivity :)] + pub unsafe fn endActivity(&self, activity: &NSObject); + # [method (performActivityWithOptions : reason : usingBlock :)] pub unsafe fn performActivityWithOptions_reason_usingBlock( &self, options: NSActivityOptions, reason: &NSString, block: TodoBlock, - ) { - msg_send![ - self, - performActivityWithOptions: options, - reason: reason, - usingBlock: block - ] - } + ); + # [method (performExpiringActivityWithReason : usingBlock :)] pub unsafe fn performExpiringActivityWithReason_usingBlock( &self, reason: &NSString, block: TodoBlock, - ) { - msg_send![ - self, - performExpiringActivityWithReason: reason, - usingBlock: block - ] - } + ); } ); extern_methods!( #[doc = "NSUserInformation"] unsafe impl NSProcessInfo { - pub unsafe fn userName(&self) -> Id { - msg_send_id![self, userName] - } - pub unsafe fn fullUserName(&self) -> Id { - msg_send_id![self, fullUserName] - } + #[method_id(userName)] + pub unsafe fn userName(&self) -> Id; + #[method_id(fullUserName)] + pub unsafe fn fullUserName(&self) -> Id; } ); extern_methods!( #[doc = "NSProcessInfoThermalState"] unsafe impl NSProcessInfo { - pub unsafe fn thermalState(&self) -> NSProcessInfoThermalState { - msg_send![self, thermalState] - } + #[method(thermalState)] + pub unsafe fn thermalState(&self) -> NSProcessInfoThermalState; } ); extern_methods!( #[doc = "NSProcessInfoPowerState"] unsafe impl NSProcessInfo { - pub unsafe fn isLowPowerModeEnabled(&self) -> bool { - msg_send![self, isLowPowerModeEnabled] - } + #[method(isLowPowerModeEnabled)] + pub unsafe fn isLowPowerModeEnabled(&self) -> bool; } ); extern_methods!( #[doc = "NSProcessInfoPlatform"] unsafe impl NSProcessInfo { - pub unsafe fn isMacCatalystApp(&self) -> bool { - msg_send![self, isMacCatalystApp] - } - pub unsafe fn isiOSAppOnMac(&self) -> bool { - msg_send![self, isiOSAppOnMac] - } + #[method(isMacCatalystApp)] + pub unsafe fn isMacCatalystApp(&self) -> bool; + #[method(isiOSAppOnMac)] + pub unsafe fn isiOSAppOnMac(&self) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSProgress.rs b/icrate/src/Foundation/generated/NSProgress.rs index 8d7fc895e..63912ec75 100644 --- a/icrate/src/Foundation/generated/NSProgress.rs +++ b/icrate/src/Foundation/generated/NSProgress.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSProgressKind = NSString; pub type NSProgressUserInfoKey = NSString; pub type NSProgressFileOperationKind = NSString; @@ -23,225 +23,149 @@ extern_class!( ); extern_methods!( unsafe impl NSProgress { - pub unsafe fn currentProgress() -> Option> { - msg_send_id![Self::class(), currentProgress] - } - pub unsafe fn progressWithTotalUnitCount(unitCount: int64_t) -> Id { - msg_send_id![Self::class(), progressWithTotalUnitCount: unitCount] - } + #[method_id(currentProgress)] + pub unsafe fn currentProgress() -> Option>; + # [method_id (progressWithTotalUnitCount :)] + pub unsafe fn progressWithTotalUnitCount(unitCount: int64_t) -> Id; + # [method_id (discreteProgressWithTotalUnitCount :)] pub unsafe fn discreteProgressWithTotalUnitCount( unitCount: int64_t, - ) -> Id { - msg_send_id![Self::class(), discreteProgressWithTotalUnitCount: unitCount] - } + ) -> Id; + # [method_id (progressWithTotalUnitCount : parent : pendingUnitCount :)] pub unsafe fn progressWithTotalUnitCount_parent_pendingUnitCount( unitCount: int64_t, parent: &NSProgress, portionOfParentTotalUnitCount: int64_t, - ) -> Id { - msg_send_id![ - Self::class(), - progressWithTotalUnitCount: unitCount, - parent: parent, - pendingUnitCount: portionOfParentTotalUnitCount - ] - } + ) -> Id; + # [method_id (initWithParent : userInfo :)] pub unsafe fn initWithParent_userInfo( &self, parentProgressOrNil: Option<&NSProgress>, userInfoOrNil: Option<&NSDictionary>, - ) -> Id { - msg_send_id![ - self, - initWithParent: parentProgressOrNil, - userInfo: userInfoOrNil - ] - } - pub unsafe fn becomeCurrentWithPendingUnitCount(&self, unitCount: int64_t) { - msg_send![self, becomeCurrentWithPendingUnitCount: unitCount] - } + ) -> Id; + # [method (becomeCurrentWithPendingUnitCount :)] + pub unsafe fn becomeCurrentWithPendingUnitCount(&self, unitCount: int64_t); + # [method (performAsCurrentWithPendingUnitCount : usingBlock :)] pub unsafe fn performAsCurrentWithPendingUnitCount_usingBlock( &self, unitCount: int64_t, work: TodoBlock, - ) { - msg_send![ - self, - performAsCurrentWithPendingUnitCount: unitCount, - usingBlock: work - ] - } - pub unsafe fn resignCurrent(&self) { - msg_send![self, resignCurrent] - } + ); + #[method(resignCurrent)] + pub unsafe fn resignCurrent(&self); + # [method (addChild : withPendingUnitCount :)] pub unsafe fn addChild_withPendingUnitCount( &self, child: &NSProgress, inUnitCount: int64_t, - ) { - msg_send![self, addChild: child, withPendingUnitCount: inUnitCount] - } - pub unsafe fn totalUnitCount(&self) -> int64_t { - msg_send![self, totalUnitCount] - } - pub unsafe fn setTotalUnitCount(&self, totalUnitCount: int64_t) { - msg_send![self, setTotalUnitCount: totalUnitCount] - } - pub unsafe fn completedUnitCount(&self) -> int64_t { - msg_send![self, completedUnitCount] - } - pub unsafe fn setCompletedUnitCount(&self, completedUnitCount: int64_t) { - msg_send![self, setCompletedUnitCount: completedUnitCount] - } - pub unsafe fn localizedDescription(&self) -> Id { - msg_send_id![self, localizedDescription] - } - pub unsafe fn setLocalizedDescription(&self, localizedDescription: Option<&NSString>) { - msg_send![self, setLocalizedDescription: localizedDescription] - } - pub unsafe fn localizedAdditionalDescription(&self) -> Id { - msg_send_id![self, localizedAdditionalDescription] - } + ); + #[method(totalUnitCount)] + pub unsafe fn totalUnitCount(&self) -> int64_t; + # [method (setTotalUnitCount :)] + pub unsafe fn setTotalUnitCount(&self, totalUnitCount: int64_t); + #[method(completedUnitCount)] + pub unsafe fn completedUnitCount(&self) -> int64_t; + # [method (setCompletedUnitCount :)] + pub unsafe fn setCompletedUnitCount(&self, completedUnitCount: int64_t); + #[method_id(localizedDescription)] + pub unsafe fn localizedDescription(&self) -> Id; + # [method (setLocalizedDescription :)] + pub unsafe fn setLocalizedDescription(&self, localizedDescription: Option<&NSString>); + #[method_id(localizedAdditionalDescription)] + pub unsafe fn localizedAdditionalDescription(&self) -> Id; + # [method (setLocalizedAdditionalDescription :)] pub unsafe fn setLocalizedAdditionalDescription( &self, localizedAdditionalDescription: Option<&NSString>, - ) { - msg_send![ - self, - setLocalizedAdditionalDescription: localizedAdditionalDescription - ] - } - pub unsafe fn isCancellable(&self) -> bool { - msg_send![self, isCancellable] - } - pub unsafe fn setCancellable(&self, cancellable: bool) { - msg_send![self, setCancellable: cancellable] - } - pub unsafe fn isPausable(&self) -> bool { - msg_send![self, isPausable] - } - pub unsafe fn setPausable(&self, pausable: bool) { - msg_send![self, setPausable: pausable] - } - pub unsafe fn isCancelled(&self) -> bool { - msg_send![self, isCancelled] - } - pub unsafe fn isPaused(&self) -> bool { - msg_send![self, isPaused] - } - pub unsafe fn cancellationHandler(&self) -> TodoBlock { - msg_send![self, cancellationHandler] - } - pub unsafe fn setCancellationHandler(&self, cancellationHandler: TodoBlock) { - msg_send![self, setCancellationHandler: cancellationHandler] - } - pub unsafe fn pausingHandler(&self) -> TodoBlock { - msg_send![self, pausingHandler] - } - pub unsafe fn setPausingHandler(&self, pausingHandler: TodoBlock) { - msg_send![self, setPausingHandler: pausingHandler] - } - pub unsafe fn resumingHandler(&self) -> TodoBlock { - msg_send![self, resumingHandler] - } - pub unsafe fn setResumingHandler(&self, resumingHandler: TodoBlock) { - msg_send![self, setResumingHandler: resumingHandler] - } + ); + #[method(isCancellable)] + pub unsafe fn isCancellable(&self) -> bool; + # [method (setCancellable :)] + pub unsafe fn setCancellable(&self, cancellable: bool); + #[method(isPausable)] + pub unsafe fn isPausable(&self) -> bool; + # [method (setPausable :)] + pub unsafe fn setPausable(&self, pausable: bool); + #[method(isCancelled)] + pub unsafe fn isCancelled(&self) -> bool; + #[method(isPaused)] + pub unsafe fn isPaused(&self) -> bool; + #[method(cancellationHandler)] + pub unsafe fn cancellationHandler(&self) -> TodoBlock; + # [method (setCancellationHandler :)] + pub unsafe fn setCancellationHandler(&self, cancellationHandler: TodoBlock); + #[method(pausingHandler)] + pub unsafe fn pausingHandler(&self) -> TodoBlock; + # [method (setPausingHandler :)] + pub unsafe fn setPausingHandler(&self, pausingHandler: TodoBlock); + #[method(resumingHandler)] + pub unsafe fn resumingHandler(&self) -> TodoBlock; + # [method (setResumingHandler :)] + pub unsafe fn setResumingHandler(&self, resumingHandler: TodoBlock); + # [method (setUserInfoObject : forKey :)] pub unsafe fn setUserInfoObject_forKey( &self, objectOrNil: Option<&Object>, key: &NSProgressUserInfoKey, - ) { - msg_send![self, setUserInfoObject: objectOrNil, forKey: key] - } - pub unsafe fn isIndeterminate(&self) -> bool { - msg_send![self, isIndeterminate] - } - pub unsafe fn fractionCompleted(&self) -> c_double { - msg_send![self, fractionCompleted] - } - pub unsafe fn isFinished(&self) -> bool { - msg_send![self, isFinished] - } - pub unsafe fn cancel(&self) { - msg_send![self, cancel] - } - pub unsafe fn pause(&self) { - msg_send![self, pause] - } - pub unsafe fn resume(&self) { - msg_send![self, resume] - } - pub unsafe fn userInfo(&self) -> Id, Shared> { - msg_send_id![self, userInfo] - } - pub unsafe fn kind(&self) -> Option> { - msg_send_id![self, kind] - } - pub unsafe fn setKind(&self, kind: Option<&NSProgressKind>) { - msg_send![self, setKind: kind] - } - pub unsafe fn estimatedTimeRemaining(&self) -> Option> { - msg_send_id![self, estimatedTimeRemaining] - } - pub unsafe fn setEstimatedTimeRemaining(&self, estimatedTimeRemaining: Option<&NSNumber>) { - msg_send![self, setEstimatedTimeRemaining: estimatedTimeRemaining] - } - pub unsafe fn throughput(&self) -> Option> { - msg_send_id![self, throughput] - } - pub unsafe fn setThroughput(&self, throughput: Option<&NSNumber>) { - msg_send![self, setThroughput: throughput] - } - pub unsafe fn fileOperationKind(&self) -> Option> { - msg_send_id![self, fileOperationKind] - } + ); + #[method(isIndeterminate)] + pub unsafe fn isIndeterminate(&self) -> bool; + #[method(fractionCompleted)] + pub unsafe fn fractionCompleted(&self) -> c_double; + #[method(isFinished)] + pub unsafe fn isFinished(&self) -> bool; + #[method(cancel)] + pub unsafe fn cancel(&self); + #[method(pause)] + pub unsafe fn pause(&self); + #[method(resume)] + pub unsafe fn resume(&self); + #[method_id(userInfo)] + pub unsafe fn userInfo(&self) -> Id, Shared>; + #[method_id(kind)] + pub unsafe fn kind(&self) -> Option>; + # [method (setKind :)] + pub unsafe fn setKind(&self, kind: Option<&NSProgressKind>); + #[method_id(estimatedTimeRemaining)] + pub unsafe fn estimatedTimeRemaining(&self) -> Option>; + # [method (setEstimatedTimeRemaining :)] + pub unsafe fn setEstimatedTimeRemaining(&self, estimatedTimeRemaining: Option<&NSNumber>); + #[method_id(throughput)] + pub unsafe fn throughput(&self) -> Option>; + # [method (setThroughput :)] + pub unsafe fn setThroughput(&self, throughput: Option<&NSNumber>); + #[method_id(fileOperationKind)] + pub unsafe fn fileOperationKind(&self) -> Option>; + # [method (setFileOperationKind :)] pub unsafe fn setFileOperationKind( &self, fileOperationKind: Option<&NSProgressFileOperationKind>, - ) { - msg_send![self, setFileOperationKind: fileOperationKind] - } - pub unsafe fn fileURL(&self) -> Option> { - msg_send_id![self, fileURL] - } - pub unsafe fn setFileURL(&self, fileURL: Option<&NSURL>) { - msg_send![self, setFileURL: fileURL] - } - pub unsafe fn fileTotalCount(&self) -> Option> { - msg_send_id![self, fileTotalCount] - } - pub unsafe fn setFileTotalCount(&self, fileTotalCount: Option<&NSNumber>) { - msg_send![self, setFileTotalCount: fileTotalCount] - } - pub unsafe fn fileCompletedCount(&self) -> Option> { - msg_send_id![self, fileCompletedCount] - } - pub unsafe fn setFileCompletedCount(&self, fileCompletedCount: Option<&NSNumber>) { - msg_send![self, setFileCompletedCount: fileCompletedCount] - } - pub unsafe fn publish(&self) { - msg_send![self, publish] - } - pub unsafe fn unpublish(&self) { - msg_send![self, unpublish] - } + ); + #[method_id(fileURL)] + pub unsafe fn fileURL(&self) -> Option>; + # [method (setFileURL :)] + pub unsafe fn setFileURL(&self, fileURL: Option<&NSURL>); + #[method_id(fileTotalCount)] + pub unsafe fn fileTotalCount(&self) -> Option>; + # [method (setFileTotalCount :)] + pub unsafe fn setFileTotalCount(&self, fileTotalCount: Option<&NSNumber>); + #[method_id(fileCompletedCount)] + pub unsafe fn fileCompletedCount(&self) -> Option>; + # [method (setFileCompletedCount :)] + pub unsafe fn setFileCompletedCount(&self, fileCompletedCount: Option<&NSNumber>); + #[method(publish)] + pub unsafe fn publish(&self); + #[method(unpublish)] + pub unsafe fn unpublish(&self); + # [method_id (addSubscriberForFileURL : withPublishingHandler :)] pub unsafe fn addSubscriberForFileURL_withPublishingHandler( url: &NSURL, publishingHandler: NSProgressPublishingHandler, - ) -> Id { - msg_send_id![ - Self::class(), - addSubscriberForFileURL: url, - withPublishingHandler: publishingHandler - ] - } - pub unsafe fn removeSubscriber(subscriber: &Object) { - msg_send![Self::class(), removeSubscriber: subscriber] - } - pub unsafe fn isOld(&self) -> bool { - msg_send![self, isOld] - } + ) -> Id; + # [method (removeSubscriber :)] + pub unsafe fn removeSubscriber(subscriber: &Object); + #[method(isOld)] + pub unsafe fn isOld(&self) -> bool; } ); pub type NSProgressReporting = NSObject; diff --git a/icrate/src/Foundation/generated/NSPropertyList.rs b/icrate/src/Foundation/generated/NSPropertyList.rs index 7061623c4..2e824dbd1 100644 --- a/icrate/src/Foundation/generated/NSPropertyList.rs +++ b/icrate/src/Foundation/generated/NSPropertyList.rs @@ -8,7 +8,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSPropertyListReadOptions = NSPropertyListMutabilityOptions; pub type NSPropertyListWriteOptions = NSUInteger; extern_class!( @@ -20,50 +20,28 @@ extern_class!( ); extern_methods!( unsafe impl NSPropertyListSerialization { + # [method (propertyList : isValidForFormat :)] pub unsafe fn propertyList_isValidForFormat( plist: &Object, format: NSPropertyListFormat, - ) -> bool { - msg_send![Self::class(), propertyList: plist, isValidForFormat: format] - } + ) -> bool; + # [method_id (dataWithPropertyList : format : options : error :)] pub unsafe fn dataWithPropertyList_format_options_error( plist: &Object, format: NSPropertyListFormat, opt: NSPropertyListWriteOptions, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - dataWithPropertyList: plist, - format: format, - options: opt, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (propertyListWithData : options : format : error :)] pub unsafe fn propertyListWithData_options_format_error( data: &NSData, opt: NSPropertyListReadOptions, format: *mut NSPropertyListFormat, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - propertyListWithData: data, - options: opt, - format: format, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (propertyListWithStream : options : format : error :)] pub unsafe fn propertyListWithStream_options_format_error( stream: &NSInputStream, opt: NSPropertyListReadOptions, format: *mut NSPropertyListFormat, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - propertyListWithStream: stream, - options: opt, - format: format, - error: _ - ] - } + ) -> Result, Id>; } ); diff --git a/icrate/src/Foundation/generated/NSProtocolChecker.rs b/icrate/src/Foundation/generated/NSProtocolChecker.rs index c99ba9cd8..90baa884e 100644 --- a/icrate/src/Foundation/generated/NSProtocolChecker.rs +++ b/icrate/src/Foundation/generated/NSProtocolChecker.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSProxy::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSProtocolChecker; @@ -13,33 +13,25 @@ extern_class!( ); extern_methods!( unsafe impl NSProtocolChecker { - pub unsafe fn protocol(&self) -> Id { - msg_send_id![self, protocol] - } - pub unsafe fn target(&self) -> Option> { - msg_send_id![self, target] - } + #[method_id(protocol)] + pub unsafe fn protocol(&self) -> Id; + #[method_id(target)] + pub unsafe fn target(&self) -> Option>; } ); extern_methods!( #[doc = "NSProtocolCheckerCreation"] unsafe impl NSProtocolChecker { + # [method_id (protocolCheckerWithTarget : protocol :)] pub unsafe fn protocolCheckerWithTarget_protocol( anObject: &NSObject, aProtocol: &Protocol, - ) -> Id { - msg_send_id![ - Self::class(), - protocolCheckerWithTarget: anObject, - protocol: aProtocol - ] - } + ) -> Id; + # [method_id (initWithTarget : protocol :)] pub unsafe fn initWithTarget_protocol( &self, anObject: &NSObject, aProtocol: &Protocol, - ) -> Id { - msg_send_id![self, initWithTarget: anObject, protocol: aProtocol] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSProxy.rs b/icrate/src/Foundation/generated/NSProxy.rs index 55d405dbe..87f665429 100644 --- a/icrate/src/Foundation/generated/NSProxy.rs +++ b/icrate/src/Foundation/generated/NSProxy.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSProxy; @@ -14,44 +14,32 @@ extern_class!( ); extern_methods!( unsafe impl NSProxy { - pub unsafe fn alloc() -> Id { - msg_send_id![Self::class(), alloc] - } - pub unsafe fn allocWithZone(zone: *mut NSZone) -> Id { - msg_send_id![Self::class(), allocWithZone: zone] - } - pub unsafe fn class() -> &Class { - msg_send![Self::class(), class] - } - pub unsafe fn forwardInvocation(&self, invocation: &NSInvocation) { - msg_send![self, forwardInvocation: invocation] - } + #[method_id(alloc)] + pub unsafe fn alloc() -> Id; + # [method_id (allocWithZone :)] + pub unsafe fn allocWithZone(zone: *mut NSZone) -> Id; + #[method(class)] + pub unsafe fn class() -> &Class; + # [method (forwardInvocation :)] + pub unsafe fn forwardInvocation(&self, invocation: &NSInvocation); + # [method_id (methodSignatureForSelector :)] pub unsafe fn methodSignatureForSelector( &self, sel: Sel, - ) -> Option> { - msg_send_id![self, methodSignatureForSelector: sel] - } - pub unsafe fn dealloc(&self) { - msg_send![self, dealloc] - } - pub unsafe fn finalize(&self) { - msg_send![self, finalize] - } - pub unsafe fn description(&self) -> Id { - msg_send_id![self, description] - } - pub unsafe fn debugDescription(&self) -> Id { - msg_send_id![self, debugDescription] - } - pub unsafe fn respondsToSelector(aSelector: Sel) -> bool { - msg_send![Self::class(), respondsToSelector: aSelector] - } - pub unsafe fn allowsWeakReference(&self) -> bool { - msg_send![self, allowsWeakReference] - } - pub unsafe fn retainWeakReference(&self) -> bool { - msg_send![self, retainWeakReference] - } + ) -> Option>; + #[method(dealloc)] + pub unsafe fn dealloc(&self); + #[method(finalize)] + pub unsafe fn finalize(&self); + #[method_id(description)] + pub unsafe fn description(&self) -> Id; + #[method_id(debugDescription)] + pub unsafe fn debugDescription(&self) -> Id; + # [method (respondsToSelector :)] + pub unsafe fn respondsToSelector(aSelector: Sel) -> bool; + #[method(allowsWeakReference)] + pub unsafe fn allowsWeakReference(&self) -> bool; + #[method(retainWeakReference)] + pub unsafe fn retainWeakReference(&self) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSRange.rs b/icrate/src/Foundation/generated/NSRange.rs index 00bf4f774..8476d4ee6 100644 --- a/icrate/src/Foundation/generated/NSRange.rs +++ b/icrate/src/Foundation/generated/NSRange.rs @@ -4,15 +4,13 @@ use crate::Foundation::generated::NSValue::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_methods!( #[doc = "NSValueRangeExtensions"] unsafe impl NSValue { - pub unsafe fn valueWithRange(range: NSRange) -> Id { - msg_send_id![Self::class(), valueWithRange: range] - } - pub unsafe fn rangeValue(&self) -> NSRange { - msg_send![self, rangeValue] - } + # [method_id (valueWithRange :)] + pub unsafe fn valueWithRange(range: NSRange) -> Id; + #[method(rangeValue)] + pub unsafe fn rangeValue(&self) -> NSRange; } ); diff --git a/icrate/src/Foundation/generated/NSRegularExpression.rs b/icrate/src/Foundation/generated/NSRegularExpression.rs index fa8758c0e..ff8193d8a 100644 --- a/icrate/src/Foundation/generated/NSRegularExpression.rs +++ b/icrate/src/Foundation/generated/NSRegularExpression.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSTextCheckingResult::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSRegularExpression; @@ -15,161 +15,97 @@ extern_class!( ); extern_methods!( unsafe impl NSRegularExpression { + # [method_id (regularExpressionWithPattern : options : error :)] pub unsafe fn regularExpressionWithPattern_options_error( pattern: &NSString, options: NSRegularExpressionOptions, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - regularExpressionWithPattern: pattern, - options: options, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (initWithPattern : options : error :)] pub unsafe fn initWithPattern_options_error( &self, pattern: &NSString, options: NSRegularExpressionOptions, - ) -> Result, Id> { - msg_send_id![self, initWithPattern: pattern, options: options, error: _] - } - pub unsafe fn pattern(&self) -> Id { - msg_send_id![self, pattern] - } - pub unsafe fn options(&self) -> NSRegularExpressionOptions { - msg_send![self, options] - } - pub unsafe fn numberOfCaptureGroups(&self) -> NSUInteger { - msg_send![self, numberOfCaptureGroups] - } - pub unsafe fn escapedPatternForString(string: &NSString) -> Id { - msg_send_id![Self::class(), escapedPatternForString: string] - } + ) -> Result, Id>; + #[method_id(pattern)] + pub unsafe fn pattern(&self) -> Id; + #[method(options)] + pub unsafe fn options(&self) -> NSRegularExpressionOptions; + #[method(numberOfCaptureGroups)] + pub unsafe fn numberOfCaptureGroups(&self) -> NSUInteger; + # [method_id (escapedPatternForString :)] + pub unsafe fn escapedPatternForString(string: &NSString) -> Id; } ); extern_methods!( #[doc = "NSMatching"] unsafe impl NSRegularExpression { + # [method (enumerateMatchesInString : options : range : usingBlock :)] pub unsafe fn enumerateMatchesInString_options_range_usingBlock( &self, string: &NSString, options: NSMatchingOptions, range: NSRange, block: TodoBlock, - ) { - msg_send![ - self, - enumerateMatchesInString: string, - options: options, - range: range, - usingBlock: block - ] - } + ); + # [method_id (matchesInString : options : range :)] pub unsafe fn matchesInString_options_range( &self, string: &NSString, options: NSMatchingOptions, range: NSRange, - ) -> Id, Shared> { - msg_send_id![ - self, - matchesInString: string, - options: options, - range: range - ] - } + ) -> Id, Shared>; + # [method (numberOfMatchesInString : options : range :)] pub unsafe fn numberOfMatchesInString_options_range( &self, string: &NSString, options: NSMatchingOptions, range: NSRange, - ) -> NSUInteger { - msg_send![ - self, - numberOfMatchesInString: string, - options: options, - range: range - ] - } + ) -> NSUInteger; + # [method_id (firstMatchInString : options : range :)] pub unsafe fn firstMatchInString_options_range( &self, string: &NSString, options: NSMatchingOptions, range: NSRange, - ) -> Option> { - msg_send_id![ - self, - firstMatchInString: string, - options: options, - range: range - ] - } + ) -> Option>; + # [method (rangeOfFirstMatchInString : options : range :)] pub unsafe fn rangeOfFirstMatchInString_options_range( &self, string: &NSString, options: NSMatchingOptions, range: NSRange, - ) -> NSRange { - msg_send![ - self, - rangeOfFirstMatchInString: string, - options: options, - range: range - ] - } + ) -> NSRange; } ); extern_methods!( #[doc = "NSReplacement"] unsafe impl NSRegularExpression { + # [method_id (stringByReplacingMatchesInString : options : range : withTemplate :)] pub unsafe fn stringByReplacingMatchesInString_options_range_withTemplate( &self, string: &NSString, options: NSMatchingOptions, range: NSRange, templ: &NSString, - ) -> Id { - msg_send_id![ - self, - stringByReplacingMatchesInString: string, - options: options, - range: range, - withTemplate: templ - ] - } + ) -> Id; + # [method (replaceMatchesInString : options : range : withTemplate :)] pub unsafe fn replaceMatchesInString_options_range_withTemplate( &self, string: &NSMutableString, options: NSMatchingOptions, range: NSRange, templ: &NSString, - ) -> NSUInteger { - msg_send![ - self, - replaceMatchesInString: string, - options: options, - range: range, - withTemplate: templ - ] - } + ) -> NSUInteger; + # [method_id (replacementStringForResult : inString : offset : template :)] pub unsafe fn replacementStringForResult_inString_offset_template( &self, result: &NSTextCheckingResult, string: &NSString, offset: NSInteger, templ: &NSString, - ) -> Id { - msg_send_id![ - self, - replacementStringForResult: result, - inString: string, - offset: offset, - template: templ - ] - } - pub unsafe fn escapedTemplateForString(string: &NSString) -> Id { - msg_send_id![Self::class(), escapedTemplateForString: string] - } + ) -> Id; + # [method_id (escapedTemplateForString :)] + pub unsafe fn escapedTemplateForString(string: &NSString) -> Id; } ); extern_class!( @@ -181,23 +117,16 @@ extern_class!( ); extern_methods!( unsafe impl NSDataDetector { + # [method_id (dataDetectorWithTypes : error :)] pub unsafe fn dataDetectorWithTypes_error( checkingTypes: NSTextCheckingTypes, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - dataDetectorWithTypes: checkingTypes, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (initWithTypes : error :)] pub unsafe fn initWithTypes_error( &self, checkingTypes: NSTextCheckingTypes, - ) -> Result, Id> { - msg_send_id![self, initWithTypes: checkingTypes, error: _] - } - pub unsafe fn checkingTypes(&self) -> NSTextCheckingTypes { - msg_send![self, checkingTypes] - } + ) -> Result, Id>; + #[method(checkingTypes)] + pub unsafe fn checkingTypes(&self) -> NSTextCheckingTypes; } ); diff --git a/icrate/src/Foundation/generated/NSRelativeDateTimeFormatter.rs b/icrate/src/Foundation/generated/NSRelativeDateTimeFormatter.rs index 568968cf9..151e08077 100644 --- a/icrate/src/Foundation/generated/NSRelativeDateTimeFormatter.rs +++ b/icrate/src/Foundation/generated/NSRelativeDateTimeFormatter.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSFormatter::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSRelativeDateTimeFormatter; @@ -16,64 +16,46 @@ extern_class!( ); extern_methods!( unsafe impl NSRelativeDateTimeFormatter { - pub unsafe fn dateTimeStyle(&self) -> NSRelativeDateTimeFormatterStyle { - msg_send![self, dateTimeStyle] - } - pub unsafe fn setDateTimeStyle(&self, dateTimeStyle: NSRelativeDateTimeFormatterStyle) { - msg_send![self, setDateTimeStyle: dateTimeStyle] - } - pub unsafe fn unitsStyle(&self) -> NSRelativeDateTimeFormatterUnitsStyle { - msg_send![self, unitsStyle] - } - pub unsafe fn setUnitsStyle(&self, unitsStyle: NSRelativeDateTimeFormatterUnitsStyle) { - msg_send![self, setUnitsStyle: unitsStyle] - } - pub unsafe fn formattingContext(&self) -> NSFormattingContext { - msg_send![self, formattingContext] - } - pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext) { - msg_send![self, setFormattingContext: formattingContext] - } - pub unsafe fn calendar(&self) -> Id { - msg_send_id![self, calendar] - } - pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>) { - msg_send![self, setCalendar: calendar] - } - pub unsafe fn locale(&self) -> Id { - msg_send_id![self, locale] - } - pub unsafe fn setLocale(&self, locale: Option<&NSLocale>) { - msg_send![self, setLocale: locale] - } + #[method(dateTimeStyle)] + pub unsafe fn dateTimeStyle(&self) -> NSRelativeDateTimeFormatterStyle; + # [method (setDateTimeStyle :)] + pub unsafe fn setDateTimeStyle(&self, dateTimeStyle: NSRelativeDateTimeFormatterStyle); + #[method(unitsStyle)] + pub unsafe fn unitsStyle(&self) -> NSRelativeDateTimeFormatterUnitsStyle; + # [method (setUnitsStyle :)] + pub unsafe fn setUnitsStyle(&self, unitsStyle: NSRelativeDateTimeFormatterUnitsStyle); + #[method(formattingContext)] + pub unsafe fn formattingContext(&self) -> NSFormattingContext; + # [method (setFormattingContext :)] + pub unsafe fn setFormattingContext(&self, formattingContext: NSFormattingContext); + #[method_id(calendar)] + pub unsafe fn calendar(&self) -> Id; + # [method (setCalendar :)] + pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>); + #[method_id(locale)] + pub unsafe fn locale(&self) -> Id; + # [method (setLocale :)] + pub unsafe fn setLocale(&self, locale: Option<&NSLocale>); + # [method_id (localizedStringFromDateComponents :)] pub unsafe fn localizedStringFromDateComponents( &self, dateComponents: &NSDateComponents, - ) -> Id { - msg_send_id![self, localizedStringFromDateComponents: dateComponents] - } + ) -> Id; + # [method_id (localizedStringFromTimeInterval :)] pub unsafe fn localizedStringFromTimeInterval( &self, timeInterval: NSTimeInterval, - ) -> Id { - msg_send_id![self, localizedStringFromTimeInterval: timeInterval] - } + ) -> Id; + # [method_id (localizedStringForDate : relativeToDate :)] pub unsafe fn localizedStringForDate_relativeToDate( &self, date: &NSDate, referenceDate: &NSDate, - ) -> Id { - msg_send_id![ - self, - localizedStringForDate: date, - relativeToDate: referenceDate - ] - } + ) -> Id; + # [method_id (stringForObjectValue :)] pub unsafe fn stringForObjectValue( &self, obj: Option<&Object>, - ) -> Option> { - msg_send_id![self, stringForObjectValue: obj] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSRunLoop.rs b/icrate/src/Foundation/generated/NSRunLoop.rs index 1dffd8a1a..e0576618f 100644 --- a/icrate/src/Foundation/generated/NSRunLoop.rs +++ b/icrate/src/Foundation/generated/NSRunLoop.rs @@ -8,7 +8,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSRunLoop; @@ -18,120 +18,79 @@ extern_class!( ); extern_methods!( unsafe impl NSRunLoop { - pub unsafe fn currentRunLoop() -> Id { - msg_send_id![Self::class(), currentRunLoop] - } - pub unsafe fn mainRunLoop() -> Id { - msg_send_id![Self::class(), mainRunLoop] - } - pub unsafe fn currentMode(&self) -> Option> { - msg_send_id![self, currentMode] - } - pub unsafe fn getCFRunLoop(&self) -> CFRunLoopRef { - msg_send![self, getCFRunLoop] - } - pub unsafe fn addTimer_forMode(&self, timer: &NSTimer, mode: &NSRunLoopMode) { - msg_send![self, addTimer: timer, forMode: mode] - } - pub unsafe fn addPort_forMode(&self, aPort: &NSPort, mode: &NSRunLoopMode) { - msg_send![self, addPort: aPort, forMode: mode] - } - pub unsafe fn removePort_forMode(&self, aPort: &NSPort, mode: &NSRunLoopMode) { - msg_send![self, removePort: aPort, forMode: mode] - } - pub unsafe fn limitDateForMode(&self, mode: &NSRunLoopMode) -> Option> { - msg_send_id![self, limitDateForMode: mode] - } + #[method_id(currentRunLoop)] + pub unsafe fn currentRunLoop() -> Id; + #[method_id(mainRunLoop)] + pub unsafe fn mainRunLoop() -> Id; + #[method_id(currentMode)] + pub unsafe fn currentMode(&self) -> Option>; + #[method(getCFRunLoop)] + pub unsafe fn getCFRunLoop(&self) -> CFRunLoopRef; + # [method (addTimer : forMode :)] + pub unsafe fn addTimer_forMode(&self, timer: &NSTimer, mode: &NSRunLoopMode); + # [method (addPort : forMode :)] + pub unsafe fn addPort_forMode(&self, aPort: &NSPort, mode: &NSRunLoopMode); + # [method (removePort : forMode :)] + pub unsafe fn removePort_forMode(&self, aPort: &NSPort, mode: &NSRunLoopMode); + # [method_id (limitDateForMode :)] + pub unsafe fn limitDateForMode(&self, mode: &NSRunLoopMode) -> Option>; + # [method (acceptInputForMode : beforeDate :)] pub unsafe fn acceptInputForMode_beforeDate( &self, mode: &NSRunLoopMode, limitDate: &NSDate, - ) { - msg_send![self, acceptInputForMode: mode, beforeDate: limitDate] - } + ); } ); extern_methods!( #[doc = "NSRunLoopConveniences"] unsafe impl NSRunLoop { - pub unsafe fn run(&self) { - msg_send![self, run] - } - pub unsafe fn runUntilDate(&self, limitDate: &NSDate) { - msg_send![self, runUntilDate: limitDate] - } - pub unsafe fn runMode_beforeDate(&self, mode: &NSRunLoopMode, limitDate: &NSDate) -> bool { - msg_send![self, runMode: mode, beforeDate: limitDate] - } - pub unsafe fn configureAsServer(&self) { - msg_send![self, configureAsServer] - } - pub unsafe fn performInModes_block( - &self, - modes: &NSArray, - block: TodoBlock, - ) { - msg_send![self, performInModes: modes, block: block] - } - pub unsafe fn performBlock(&self, block: TodoBlock) { - msg_send![self, performBlock: block] - } + #[method(run)] + pub unsafe fn run(&self); + # [method (runUntilDate :)] + pub unsafe fn runUntilDate(&self, limitDate: &NSDate); + # [method (runMode : beforeDate :)] + pub unsafe fn runMode_beforeDate(&self, mode: &NSRunLoopMode, limitDate: &NSDate) -> bool; + #[method(configureAsServer)] + pub unsafe fn configureAsServer(&self); + # [method (performInModes : block :)] + pub unsafe fn performInModes_block(&self, modes: &NSArray, block: TodoBlock); + # [method (performBlock :)] + pub unsafe fn performBlock(&self, block: TodoBlock); } ); extern_methods!( #[doc = "NSDelayedPerforming"] unsafe impl NSObject { + # [method (performSelector : withObject : afterDelay : inModes :)] pub unsafe fn performSelector_withObject_afterDelay_inModes( &self, aSelector: Sel, anArgument: Option<&Object>, delay: NSTimeInterval, modes: &NSArray, - ) { - msg_send![ - self, - performSelector: aSelector, - withObject: anArgument, - afterDelay: delay, - inModes: modes - ] - } + ); + # [method (performSelector : withObject : afterDelay :)] pub unsafe fn performSelector_withObject_afterDelay( &self, aSelector: Sel, anArgument: Option<&Object>, delay: NSTimeInterval, - ) { - msg_send![ - self, - performSelector: aSelector, - withObject: anArgument, - afterDelay: delay - ] - } + ); + # [method (cancelPreviousPerformRequestsWithTarget : selector : object :)] pub unsafe fn cancelPreviousPerformRequestsWithTarget_selector_object( aTarget: &Object, aSelector: Sel, anArgument: Option<&Object>, - ) { - msg_send![ - Self::class(), - cancelPreviousPerformRequestsWithTarget: aTarget, - selector: aSelector, - object: anArgument - ] - } - pub unsafe fn cancelPreviousPerformRequestsWithTarget(aTarget: &Object) { - msg_send![ - Self::class(), - cancelPreviousPerformRequestsWithTarget: aTarget - ] - } + ); + # [method (cancelPreviousPerformRequestsWithTarget :)] + pub unsafe fn cancelPreviousPerformRequestsWithTarget(aTarget: &Object); } ); extern_methods!( #[doc = "NSOrderedPerform"] unsafe impl NSRunLoop { + # [method (performSelector : target : argument : order : modes :)] pub unsafe fn performSelector_target_argument_order_modes( &self, aSelector: Sel, @@ -139,31 +98,15 @@ extern_methods!( arg: Option<&Object>, order: NSUInteger, modes: &NSArray, - ) { - msg_send![ - self, - performSelector: aSelector, - target: target, - argument: arg, - order: order, - modes: modes - ] - } + ); + # [method (cancelPerformSelector : target : argument :)] pub unsafe fn cancelPerformSelector_target_argument( &self, aSelector: Sel, target: &Object, arg: Option<&Object>, - ) { - msg_send![ - self, - cancelPerformSelector: aSelector, - target: target, - argument: arg - ] - } - pub unsafe fn cancelPerformSelectorsWithTarget(&self, target: &Object) { - msg_send![self, cancelPerformSelectorsWithTarget: target] - } + ); + # [method (cancelPerformSelectorsWithTarget :)] + pub unsafe fn cancelPerformSelectorsWithTarget(&self, target: &Object); } ); diff --git a/icrate/src/Foundation/generated/NSScanner.rs b/icrate/src/Foundation/generated/NSScanner.rs index 3e1f0e1c1..366ecbd92 100644 --- a/icrate/src/Foundation/generated/NSScanner.rs +++ b/icrate/src/Foundation/generated/NSScanner.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSScanner; @@ -15,110 +15,83 @@ extern_class!( ); extern_methods!( unsafe impl NSScanner { - pub unsafe fn string(&self) -> Id { - msg_send_id![self, string] - } - pub unsafe fn scanLocation(&self) -> NSUInteger { - msg_send![self, scanLocation] - } - pub unsafe fn setScanLocation(&self, scanLocation: NSUInteger) { - msg_send![self, setScanLocation: scanLocation] - } - pub unsafe fn charactersToBeSkipped(&self) -> Option> { - msg_send_id![self, charactersToBeSkipped] - } + #[method_id(string)] + pub unsafe fn string(&self) -> Id; + #[method(scanLocation)] + pub unsafe fn scanLocation(&self) -> NSUInteger; + # [method (setScanLocation :)] + pub unsafe fn setScanLocation(&self, scanLocation: NSUInteger); + #[method_id(charactersToBeSkipped)] + pub unsafe fn charactersToBeSkipped(&self) -> Option>; + # [method (setCharactersToBeSkipped :)] pub unsafe fn setCharactersToBeSkipped( &self, charactersToBeSkipped: Option<&NSCharacterSet>, - ) { - msg_send![self, setCharactersToBeSkipped: charactersToBeSkipped] - } - pub unsafe fn caseSensitive(&self) -> bool { - msg_send![self, caseSensitive] - } - pub unsafe fn setCaseSensitive(&self, caseSensitive: bool) { - msg_send![self, setCaseSensitive: caseSensitive] - } - pub unsafe fn locale(&self) -> Option> { - msg_send_id![self, locale] - } - pub unsafe fn setLocale(&self, locale: Option<&Object>) { - msg_send![self, setLocale: locale] - } - pub unsafe fn initWithString(&self, string: &NSString) -> Id { - msg_send_id![self, initWithString: string] - } + ); + #[method(caseSensitive)] + pub unsafe fn caseSensitive(&self) -> bool; + # [method (setCaseSensitive :)] + pub unsafe fn setCaseSensitive(&self, caseSensitive: bool); + #[method_id(locale)] + pub unsafe fn locale(&self) -> Option>; + # [method (setLocale :)] + pub unsafe fn setLocale(&self, locale: Option<&Object>); + # [method_id (initWithString :)] + pub unsafe fn initWithString(&self, string: &NSString) -> Id; } ); extern_methods!( #[doc = "NSExtendedScanner"] unsafe impl NSScanner { - pub unsafe fn scanInt(&self, result: *mut c_int) -> bool { - msg_send![self, scanInt: result] - } - pub unsafe fn scanInteger(&self, result: *mut NSInteger) -> bool { - msg_send![self, scanInteger: result] - } - pub unsafe fn scanLongLong(&self, result: *mut c_longlong) -> bool { - msg_send![self, scanLongLong: result] - } - pub unsafe fn scanUnsignedLongLong(&self, result: *mut c_ulonglong) -> bool { - msg_send![self, scanUnsignedLongLong: result] - } - pub unsafe fn scanFloat(&self, result: *mut c_float) -> bool { - msg_send![self, scanFloat: result] - } - pub unsafe fn scanDouble(&self, result: *mut c_double) -> bool { - msg_send![self, scanDouble: result] - } - pub unsafe fn scanHexInt(&self, result: *mut c_uint) -> bool { - msg_send![self, scanHexInt: result] - } - pub unsafe fn scanHexLongLong(&self, result: *mut c_ulonglong) -> bool { - msg_send![self, scanHexLongLong: result] - } - pub unsafe fn scanHexFloat(&self, result: *mut c_float) -> bool { - msg_send![self, scanHexFloat: result] - } - pub unsafe fn scanHexDouble(&self, result: *mut c_double) -> bool { - msg_send![self, scanHexDouble: result] - } + # [method (scanInt :)] + pub unsafe fn scanInt(&self, result: *mut c_int) -> bool; + # [method (scanInteger :)] + pub unsafe fn scanInteger(&self, result: *mut NSInteger) -> bool; + # [method (scanLongLong :)] + pub unsafe fn scanLongLong(&self, result: *mut c_longlong) -> bool; + # [method (scanUnsignedLongLong :)] + pub unsafe fn scanUnsignedLongLong(&self, result: *mut c_ulonglong) -> bool; + # [method (scanFloat :)] + pub unsafe fn scanFloat(&self, result: *mut c_float) -> bool; + # [method (scanDouble :)] + pub unsafe fn scanDouble(&self, result: *mut c_double) -> bool; + # [method (scanHexInt :)] + pub unsafe fn scanHexInt(&self, result: *mut c_uint) -> bool; + # [method (scanHexLongLong :)] + pub unsafe fn scanHexLongLong(&self, result: *mut c_ulonglong) -> bool; + # [method (scanHexFloat :)] + pub unsafe fn scanHexFloat(&self, result: *mut c_float) -> bool; + # [method (scanHexDouble :)] + pub unsafe fn scanHexDouble(&self, result: *mut c_double) -> bool; + # [method (scanString : intoString :)] pub unsafe fn scanString_intoString( &self, string: &NSString, result: Option<&mut Option>>, - ) -> bool { - msg_send![self, scanString: string, intoString: result] - } + ) -> bool; + # [method (scanCharactersFromSet : intoString :)] pub unsafe fn scanCharactersFromSet_intoString( &self, set: &NSCharacterSet, result: Option<&mut Option>>, - ) -> bool { - msg_send![self, scanCharactersFromSet: set, intoString: result] - } + ) -> bool; + # [method (scanUpToString : intoString :)] pub unsafe fn scanUpToString_intoString( &self, string: &NSString, result: Option<&mut Option>>, - ) -> bool { - msg_send![self, scanUpToString: string, intoString: result] - } + ) -> bool; + # [method (scanUpToCharactersFromSet : intoString :)] pub unsafe fn scanUpToCharactersFromSet_intoString( &self, set: &NSCharacterSet, result: Option<&mut Option>>, - ) -> bool { - msg_send![self, scanUpToCharactersFromSet: set, intoString: result] - } - pub unsafe fn isAtEnd(&self) -> bool { - msg_send![self, isAtEnd] - } - pub unsafe fn scannerWithString(string: &NSString) -> Id { - msg_send_id![Self::class(), scannerWithString: string] - } - pub unsafe fn localizedScannerWithString(string: &NSString) -> Id { - msg_send_id![Self::class(), localizedScannerWithString: string] - } + ) -> bool; + #[method(isAtEnd)] + pub unsafe fn isAtEnd(&self) -> bool; + # [method_id (scannerWithString :)] + pub unsafe fn scannerWithString(string: &NSString) -> Id; + # [method_id (localizedScannerWithString :)] + pub unsafe fn localizedScannerWithString(string: &NSString) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSScriptClassDescription.rs b/icrate/src/Foundation/generated/NSScriptClassDescription.rs index 412568078..4b10d8a41 100644 --- a/icrate/src/Foundation/generated/NSScriptClassDescription.rs +++ b/icrate/src/Foundation/generated/NSScriptClassDescription.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSClassDescription::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSScriptClassDescription; @@ -13,114 +13,83 @@ extern_class!( ); extern_methods!( unsafe impl NSScriptClassDescription { + # [method_id (classDescriptionForClass :)] pub unsafe fn classDescriptionForClass( aClass: &Class, - ) -> Option> { - msg_send_id![Self::class(), classDescriptionForClass: aClass] - } + ) -> Option>; + # [method_id (initWithSuiteName : className : dictionary :)] pub unsafe fn initWithSuiteName_className_dictionary( &self, suiteName: &NSString, className: &NSString, classDeclaration: Option<&NSDictionary>, - ) -> Option> { - msg_send_id![ - self, - initWithSuiteName: suiteName, - className: className, - dictionary: classDeclaration - ] - } - pub unsafe fn suiteName(&self) -> Option> { - msg_send_id![self, suiteName] - } - pub unsafe fn className(&self) -> Option> { - msg_send_id![self, className] - } - pub unsafe fn implementationClassName(&self) -> Option> { - msg_send_id![self, implementationClassName] - } - pub unsafe fn superclassDescription(&self) -> Option> { - msg_send_id![self, superclassDescription] - } - pub unsafe fn appleEventCode(&self) -> FourCharCode { - msg_send![self, appleEventCode] - } - pub unsafe fn matchesAppleEventCode(&self, appleEventCode: FourCharCode) -> bool { - msg_send![self, matchesAppleEventCode: appleEventCode] - } + ) -> Option>; + #[method_id(suiteName)] + pub unsafe fn suiteName(&self) -> Option>; + #[method_id(className)] + pub unsafe fn className(&self) -> Option>; + #[method_id(implementationClassName)] + pub unsafe fn implementationClassName(&self) -> Option>; + #[method_id(superclassDescription)] + pub unsafe fn superclassDescription(&self) -> Option>; + #[method(appleEventCode)] + pub unsafe fn appleEventCode(&self) -> FourCharCode; + # [method (matchesAppleEventCode :)] + pub unsafe fn matchesAppleEventCode(&self, appleEventCode: FourCharCode) -> bool; + # [method (supportsCommand :)] pub unsafe fn supportsCommand( &self, commandDescription: &NSScriptCommandDescription, - ) -> bool { - msg_send![self, supportsCommand: commandDescription] - } + ) -> bool; + # [method (selectorForCommand :)] pub unsafe fn selectorForCommand( &self, commandDescription: &NSScriptCommandDescription, - ) -> Option { - msg_send![self, selectorForCommand: commandDescription] - } - pub unsafe fn typeForKey(&self, key: &NSString) -> Option> { - msg_send_id![self, typeForKey: key] - } + ) -> Option; + # [method_id (typeForKey :)] + pub unsafe fn typeForKey(&self, key: &NSString) -> Option>; + # [method_id (classDescriptionForKey :)] pub unsafe fn classDescriptionForKey( &self, key: &NSString, - ) -> Option> { - msg_send_id![self, classDescriptionForKey: key] - } - pub unsafe fn appleEventCodeForKey(&self, key: &NSString) -> FourCharCode { - msg_send![self, appleEventCodeForKey: key] - } + ) -> Option>; + # [method (appleEventCodeForKey :)] + pub unsafe fn appleEventCodeForKey(&self, key: &NSString) -> FourCharCode; + # [method_id (keyWithAppleEventCode :)] pub unsafe fn keyWithAppleEventCode( &self, appleEventCode: FourCharCode, - ) -> Option> { - msg_send_id![self, keyWithAppleEventCode: appleEventCode] - } - pub unsafe fn defaultSubcontainerAttributeKey(&self) -> Option> { - msg_send_id![self, defaultSubcontainerAttributeKey] - } + ) -> Option>; + #[method_id(defaultSubcontainerAttributeKey)] + pub unsafe fn defaultSubcontainerAttributeKey(&self) -> Option>; + # [method (isLocationRequiredToCreateForKey :)] pub unsafe fn isLocationRequiredToCreateForKey( &self, toManyRelationshipKey: &NSString, - ) -> bool { - msg_send![ - self, - isLocationRequiredToCreateForKey: toManyRelationshipKey - ] - } - pub unsafe fn hasPropertyForKey(&self, key: &NSString) -> bool { - msg_send![self, hasPropertyForKey: key] - } - pub unsafe fn hasOrderedToManyRelationshipForKey(&self, key: &NSString) -> bool { - msg_send![self, hasOrderedToManyRelationshipForKey: key] - } - pub unsafe fn hasReadablePropertyForKey(&self, key: &NSString) -> bool { - msg_send![self, hasReadablePropertyForKey: key] - } - pub unsafe fn hasWritablePropertyForKey(&self, key: &NSString) -> bool { - msg_send![self, hasWritablePropertyForKey: key] - } + ) -> bool; + # [method (hasPropertyForKey :)] + pub unsafe fn hasPropertyForKey(&self, key: &NSString) -> bool; + # [method (hasOrderedToManyRelationshipForKey :)] + pub unsafe fn hasOrderedToManyRelationshipForKey(&self, key: &NSString) -> bool; + # [method (hasReadablePropertyForKey :)] + pub unsafe fn hasReadablePropertyForKey(&self, key: &NSString) -> bool; + # [method (hasWritablePropertyForKey :)] + pub unsafe fn hasWritablePropertyForKey(&self, key: &NSString) -> bool; } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSScriptClassDescription { - pub unsafe fn isReadOnlyKey(&self, key: &NSString) -> bool { - msg_send![self, isReadOnlyKey: key] - } + # [method (isReadOnlyKey :)] + pub unsafe fn isReadOnlyKey(&self, key: &NSString) -> bool; } ); extern_methods!( #[doc = "NSScriptClassDescription"] unsafe impl NSObject { - pub unsafe fn classCode(&self) -> FourCharCode { - msg_send![self, classCode] - } - pub unsafe fn className(&self) -> Id { - msg_send_id![self, className] - } + #[method(classCode)] + pub unsafe fn classCode(&self) -> FourCharCode; + #[method_id(className)] + pub unsafe fn className(&self) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSScriptCoercionHandler.rs b/icrate/src/Foundation/generated/NSScriptCoercionHandler.rs index 09ae0e227..f3f76a81c 100644 --- a/icrate/src/Foundation/generated/NSScriptCoercionHandler.rs +++ b/icrate/src/Foundation/generated/NSScriptCoercionHandler.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSScriptCoercionHandler; @@ -12,30 +12,21 @@ extern_class!( ); extern_methods!( unsafe impl NSScriptCoercionHandler { - pub unsafe fn sharedCoercionHandler() -> Id { - msg_send_id![Self::class(), sharedCoercionHandler] - } + #[method_id(sharedCoercionHandler)] + pub unsafe fn sharedCoercionHandler() -> Id; + # [method_id (coerceValue : toClass :)] pub unsafe fn coerceValue_toClass( &self, value: &Object, toClass: &Class, - ) -> Option> { - msg_send_id![self, coerceValue: value, toClass: toClass] - } + ) -> Option>; + # [method (registerCoercer : selector : toConvertFromClass : toClass :)] pub unsafe fn registerCoercer_selector_toConvertFromClass_toClass( &self, coercer: &Object, selector: Sel, fromClass: &Class, toClass: &Class, - ) { - msg_send![ - self, - registerCoercer: coercer, - selector: selector, - toConvertFromClass: fromClass, - toClass: toClass - ] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSScriptCommand.rs b/icrate/src/Foundation/generated/NSScriptCommand.rs index 56dc4faa9..aa7e61a64 100644 --- a/icrate/src/Foundation/generated/NSScriptCommand.rs +++ b/icrate/src/Foundation/generated/NSScriptCommand.rs @@ -8,7 +8,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSScriptCommand; @@ -18,107 +18,75 @@ extern_class!( ); extern_methods!( unsafe impl NSScriptCommand { + # [method_id (initWithCommandDescription :)] pub unsafe fn initWithCommandDescription( &self, commandDef: &NSScriptCommandDescription, - ) -> Id { - msg_send_id![self, initWithCommandDescription: commandDef] - } - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } - pub unsafe fn commandDescription(&self) -> Id { - msg_send_id![self, commandDescription] - } - pub unsafe fn directParameter(&self) -> Option> { - msg_send_id![self, directParameter] - } - pub unsafe fn setDirectParameter(&self, directParameter: Option<&Object>) { - msg_send![self, setDirectParameter: directParameter] - } - pub unsafe fn receiversSpecifier(&self) -> Option> { - msg_send_id![self, receiversSpecifier] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + #[method_id(commandDescription)] + pub unsafe fn commandDescription(&self) -> Id; + #[method_id(directParameter)] + pub unsafe fn directParameter(&self) -> Option>; + # [method (setDirectParameter :)] + pub unsafe fn setDirectParameter(&self, directParameter: Option<&Object>); + #[method_id(receiversSpecifier)] + pub unsafe fn receiversSpecifier(&self) -> Option>; + # [method (setReceiversSpecifier :)] pub unsafe fn setReceiversSpecifier( &self, receiversSpecifier: Option<&NSScriptObjectSpecifier>, - ) { - msg_send![self, setReceiversSpecifier: receiversSpecifier] - } - pub unsafe fn evaluatedReceivers(&self) -> Option> { - msg_send_id![self, evaluatedReceivers] - } - pub unsafe fn arguments(&self) -> Option, Shared>> { - msg_send_id![self, arguments] - } - pub unsafe fn setArguments(&self, arguments: Option<&NSDictionary>) { - msg_send![self, setArguments: arguments] - } + ); + #[method_id(evaluatedReceivers)] + pub unsafe fn evaluatedReceivers(&self) -> Option>; + #[method_id(arguments)] + pub unsafe fn arguments(&self) -> Option, Shared>>; + # [method (setArguments :)] + pub unsafe fn setArguments(&self, arguments: Option<&NSDictionary>); + #[method_id(evaluatedArguments)] pub unsafe fn evaluatedArguments( &self, - ) -> Option, Shared>> { - msg_send_id![self, evaluatedArguments] - } - pub unsafe fn isWellFormed(&self) -> bool { - msg_send![self, isWellFormed] - } - pub unsafe fn performDefaultImplementation(&self) -> Option> { - msg_send_id![self, performDefaultImplementation] - } - pub unsafe fn executeCommand(&self) -> Option> { - msg_send_id![self, executeCommand] - } - pub unsafe fn scriptErrorNumber(&self) -> NSInteger { - msg_send![self, scriptErrorNumber] - } - pub unsafe fn setScriptErrorNumber(&self, scriptErrorNumber: NSInteger) { - msg_send![self, setScriptErrorNumber: scriptErrorNumber] - } + ) -> Option, Shared>>; + #[method(isWellFormed)] + pub unsafe fn isWellFormed(&self) -> bool; + #[method_id(performDefaultImplementation)] + pub unsafe fn performDefaultImplementation(&self) -> Option>; + #[method_id(executeCommand)] + pub unsafe fn executeCommand(&self) -> Option>; + #[method(scriptErrorNumber)] + pub unsafe fn scriptErrorNumber(&self) -> NSInteger; + # [method (setScriptErrorNumber :)] + pub unsafe fn setScriptErrorNumber(&self, scriptErrorNumber: NSInteger); + #[method_id(scriptErrorOffendingObjectDescriptor)] pub unsafe fn scriptErrorOffendingObjectDescriptor( &self, - ) -> Option> { - msg_send_id![self, scriptErrorOffendingObjectDescriptor] - } + ) -> Option>; + # [method (setScriptErrorOffendingObjectDescriptor :)] pub unsafe fn setScriptErrorOffendingObjectDescriptor( &self, scriptErrorOffendingObjectDescriptor: Option<&NSAppleEventDescriptor>, - ) { - msg_send![ - self, - setScriptErrorOffendingObjectDescriptor: scriptErrorOffendingObjectDescriptor - ] - } + ); + #[method_id(scriptErrorExpectedTypeDescriptor)] pub unsafe fn scriptErrorExpectedTypeDescriptor( &self, - ) -> Option> { - msg_send_id![self, scriptErrorExpectedTypeDescriptor] - } + ) -> Option>; + # [method (setScriptErrorExpectedTypeDescriptor :)] pub unsafe fn setScriptErrorExpectedTypeDescriptor( &self, scriptErrorExpectedTypeDescriptor: Option<&NSAppleEventDescriptor>, - ) { - msg_send![ - self, - setScriptErrorExpectedTypeDescriptor: scriptErrorExpectedTypeDescriptor - ] - } - pub unsafe fn scriptErrorString(&self) -> Option> { - msg_send_id![self, scriptErrorString] - } - pub unsafe fn setScriptErrorString(&self, scriptErrorString: Option<&NSString>) { - msg_send![self, setScriptErrorString: scriptErrorString] - } - pub unsafe fn currentCommand() -> Option> { - msg_send_id![Self::class(), currentCommand] - } - pub unsafe fn appleEvent(&self) -> Option> { - msg_send_id![self, appleEvent] - } - pub unsafe fn suspendExecution(&self) { - msg_send![self, suspendExecution] - } - pub unsafe fn resumeExecutionWithResult(&self, result: Option<&Object>) { - msg_send![self, resumeExecutionWithResult: result] - } + ); + #[method_id(scriptErrorString)] + pub unsafe fn scriptErrorString(&self) -> Option>; + # [method (setScriptErrorString :)] + pub unsafe fn setScriptErrorString(&self, scriptErrorString: Option<&NSString>); + #[method_id(currentCommand)] + pub unsafe fn currentCommand() -> Option>; + #[method_id(appleEvent)] + pub unsafe fn appleEvent(&self) -> Option>; + #[method(suspendExecution)] + pub unsafe fn suspendExecution(&self); + # [method (resumeExecutionWithResult :)] + pub unsafe fn resumeExecutionWithResult(&self, result: Option<&Object>); } ); diff --git a/icrate/src/Foundation/generated/NSScriptCommandDescription.rs b/icrate/src/Foundation/generated/NSScriptCommandDescription.rs index 19b124953..4bbbce1f5 100644 --- a/icrate/src/Foundation/generated/NSScriptCommandDescription.rs +++ b/icrate/src/Foundation/generated/NSScriptCommandDescription.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSScriptCommandDescription; @@ -16,72 +16,51 @@ extern_class!( ); extern_methods!( unsafe impl NSScriptCommandDescription { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithSuiteName : commandName : dictionary :)] pub unsafe fn initWithSuiteName_commandName_dictionary( &self, suiteName: &NSString, commandName: &NSString, commandDeclaration: Option<&NSDictionary>, - ) -> Option> { - msg_send_id![ - self, - initWithSuiteName: suiteName, - commandName: commandName, - dictionary: commandDeclaration - ] - } - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } - pub unsafe fn suiteName(&self) -> Id { - msg_send_id![self, suiteName] - } - pub unsafe fn commandName(&self) -> Id { - msg_send_id![self, commandName] - } - pub unsafe fn appleEventClassCode(&self) -> FourCharCode { - msg_send![self, appleEventClassCode] - } - pub unsafe fn appleEventCode(&self) -> FourCharCode { - msg_send![self, appleEventCode] - } - pub unsafe fn commandClassName(&self) -> Id { - msg_send_id![self, commandClassName] - } - pub unsafe fn returnType(&self) -> Option> { - msg_send_id![self, returnType] - } - pub unsafe fn appleEventCodeForReturnType(&self) -> FourCharCode { - msg_send![self, appleEventCodeForReturnType] - } - pub unsafe fn argumentNames(&self) -> Id, Shared> { - msg_send_id![self, argumentNames] - } + ) -> Option>; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + #[method_id(suiteName)] + pub unsafe fn suiteName(&self) -> Id; + #[method_id(commandName)] + pub unsafe fn commandName(&self) -> Id; + #[method(appleEventClassCode)] + pub unsafe fn appleEventClassCode(&self) -> FourCharCode; + #[method(appleEventCode)] + pub unsafe fn appleEventCode(&self) -> FourCharCode; + #[method_id(commandClassName)] + pub unsafe fn commandClassName(&self) -> Id; + #[method_id(returnType)] + pub unsafe fn returnType(&self) -> Option>; + #[method(appleEventCodeForReturnType)] + pub unsafe fn appleEventCodeForReturnType(&self) -> FourCharCode; + #[method_id(argumentNames)] + pub unsafe fn argumentNames(&self) -> Id, Shared>; + # [method_id (typeForArgumentWithName :)] pub unsafe fn typeForArgumentWithName( &self, argumentName: &NSString, - ) -> Option> { - msg_send_id![self, typeForArgumentWithName: argumentName] - } + ) -> Option>; + # [method (appleEventCodeForArgumentWithName :)] pub unsafe fn appleEventCodeForArgumentWithName( &self, argumentName: &NSString, - ) -> FourCharCode { - msg_send![self, appleEventCodeForArgumentWithName: argumentName] - } - pub unsafe fn isOptionalArgumentWithName(&self, argumentName: &NSString) -> bool { - msg_send![self, isOptionalArgumentWithName: argumentName] - } - pub unsafe fn createCommandInstance(&self) -> Id { - msg_send_id![self, createCommandInstance] - } + ) -> FourCharCode; + # [method (isOptionalArgumentWithName :)] + pub unsafe fn isOptionalArgumentWithName(&self, argumentName: &NSString) -> bool; + #[method_id(createCommandInstance)] + pub unsafe fn createCommandInstance(&self) -> Id; + # [method_id (createCommandInstanceWithZone :)] pub unsafe fn createCommandInstanceWithZone( &self, zone: *mut NSZone, - ) -> Id { - msg_send_id![self, createCommandInstanceWithZone: zone] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSScriptExecutionContext.rs b/icrate/src/Foundation/generated/NSScriptExecutionContext.rs index 2ecb01b1e..aea8a81a3 100644 --- a/icrate/src/Foundation/generated/NSScriptExecutionContext.rs +++ b/icrate/src/Foundation/generated/NSScriptExecutionContext.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSScriptExecutionContext; @@ -13,26 +13,19 @@ extern_class!( ); extern_methods!( unsafe impl NSScriptExecutionContext { - pub unsafe fn sharedScriptExecutionContext() -> Id { - msg_send_id![Self::class(), sharedScriptExecutionContext] - } - pub unsafe fn topLevelObject(&self) -> Option> { - msg_send_id![self, topLevelObject] - } - pub unsafe fn setTopLevelObject(&self, topLevelObject: Option<&Object>) { - msg_send![self, setTopLevelObject: topLevelObject] - } - pub unsafe fn objectBeingTested(&self) -> Option> { - msg_send_id![self, objectBeingTested] - } - pub unsafe fn setObjectBeingTested(&self, objectBeingTested: Option<&Object>) { - msg_send![self, setObjectBeingTested: objectBeingTested] - } - pub unsafe fn rangeContainerObject(&self) -> Option> { - msg_send_id![self, rangeContainerObject] - } - pub unsafe fn setRangeContainerObject(&self, rangeContainerObject: Option<&Object>) { - msg_send![self, setRangeContainerObject: rangeContainerObject] - } + #[method_id(sharedScriptExecutionContext)] + pub unsafe fn sharedScriptExecutionContext() -> Id; + #[method_id(topLevelObject)] + pub unsafe fn topLevelObject(&self) -> Option>; + # [method (setTopLevelObject :)] + pub unsafe fn setTopLevelObject(&self, topLevelObject: Option<&Object>); + #[method_id(objectBeingTested)] + pub unsafe fn objectBeingTested(&self) -> Option>; + # [method (setObjectBeingTested :)] + pub unsafe fn setObjectBeingTested(&self, objectBeingTested: Option<&Object>); + #[method_id(rangeContainerObject)] + pub unsafe fn rangeContainerObject(&self) -> Option>; + # [method (setRangeContainerObject :)] + pub unsafe fn setRangeContainerObject(&self, rangeContainerObject: Option<&Object>); } ); diff --git a/icrate/src/Foundation/generated/NSScriptKeyValueCoding.rs b/icrate/src/Foundation/generated/NSScriptKeyValueCoding.rs index 10229bfea..85ab9427d 100644 --- a/icrate/src/Foundation/generated/NSScriptKeyValueCoding.rs +++ b/icrate/src/Foundation/generated/NSScriptKeyValueCoding.rs @@ -3,73 +3,55 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_methods!( #[doc = "NSScriptKeyValueCoding"] unsafe impl NSObject { + # [method_id (valueAtIndex : inPropertyWithKey :)] pub unsafe fn valueAtIndex_inPropertyWithKey( &self, index: NSUInteger, key: &NSString, - ) -> Option> { - msg_send_id![self, valueAtIndex: index, inPropertyWithKey: key] - } + ) -> Option>; + # [method_id (valueWithName : inPropertyWithKey :)] pub unsafe fn valueWithName_inPropertyWithKey( &self, name: &NSString, key: &NSString, - ) -> Option> { - msg_send_id![self, valueWithName: name, inPropertyWithKey: key] - } + ) -> Option>; + # [method_id (valueWithUniqueID : inPropertyWithKey :)] pub unsafe fn valueWithUniqueID_inPropertyWithKey( &self, uniqueID: &Object, key: &NSString, - ) -> Option> { - msg_send_id![self, valueWithUniqueID: uniqueID, inPropertyWithKey: key] - } + ) -> Option>; + # [method (insertValue : atIndex : inPropertyWithKey :)] pub unsafe fn insertValue_atIndex_inPropertyWithKey( &self, value: &Object, index: NSUInteger, key: &NSString, - ) { - msg_send![ - self, - insertValue: value, - atIndex: index, - inPropertyWithKey: key - ] - } + ); + # [method (removeValueAtIndex : fromPropertyWithKey :)] pub unsafe fn removeValueAtIndex_fromPropertyWithKey( &self, index: NSUInteger, key: &NSString, - ) { - msg_send![self, removeValueAtIndex: index, fromPropertyWithKey: key] - } + ); + # [method (replaceValueAtIndex : inPropertyWithKey : withValue :)] pub unsafe fn replaceValueAtIndex_inPropertyWithKey_withValue( &self, index: NSUInteger, key: &NSString, value: &Object, - ) { - msg_send![ - self, - replaceValueAtIndex: index, - inPropertyWithKey: key, - withValue: value - ] - } - pub unsafe fn insertValue_inPropertyWithKey(&self, value: &Object, key: &NSString) { - msg_send![self, insertValue: value, inPropertyWithKey: key] - } + ); + # [method (insertValue : inPropertyWithKey :)] + pub unsafe fn insertValue_inPropertyWithKey(&self, value: &Object, key: &NSString); + # [method_id (coerceValue : forKey :)] pub unsafe fn coerceValue_forKey( &self, value: Option<&Object>, key: &NSString, - ) -> Option> { - msg_send_id![self, coerceValue: value, forKey: key] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSScriptObjectSpecifiers.rs b/icrate/src/Foundation/generated/NSScriptObjectSpecifiers.rs index 96515f761..5429540e1 100644 --- a/icrate/src/Foundation/generated/NSScriptObjectSpecifiers.rs +++ b/icrate/src/Foundation/generated/NSScriptObjectSpecifiers.rs @@ -8,7 +8,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSScriptObjectSpecifier; @@ -18,141 +18,97 @@ extern_class!( ); extern_methods!( unsafe impl NSScriptObjectSpecifier { + # [method_id (objectSpecifierWithDescriptor :)] pub unsafe fn objectSpecifierWithDescriptor( descriptor: &NSAppleEventDescriptor, - ) -> Option> { - msg_send_id![Self::class(), objectSpecifierWithDescriptor: descriptor] - } + ) -> Option>; + # [method_id (initWithContainerSpecifier : key :)] pub unsafe fn initWithContainerSpecifier_key( &self, container: &NSScriptObjectSpecifier, property: &NSString, - ) -> Id { - msg_send_id![self, initWithContainerSpecifier: container, key: property] - } + ) -> Id; + # [method_id (initWithContainerClassDescription : containerSpecifier : key :)] pub unsafe fn initWithContainerClassDescription_containerSpecifier_key( &self, classDesc: &NSScriptClassDescription, container: Option<&NSScriptObjectSpecifier>, property: &NSString, - ) -> Id { - msg_send_id![ - self, - initWithContainerClassDescription: classDesc, - containerSpecifier: container, - key: property - ] - } - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } - pub unsafe fn childSpecifier(&self) -> Option> { - msg_send_id![self, childSpecifier] - } - pub unsafe fn setChildSpecifier(&self, childSpecifier: Option<&NSScriptObjectSpecifier>) { - msg_send![self, setChildSpecifier: childSpecifier] - } - pub unsafe fn containerSpecifier(&self) -> Option> { - msg_send_id![self, containerSpecifier] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + #[method_id(childSpecifier)] + pub unsafe fn childSpecifier(&self) -> Option>; + # [method (setChildSpecifier :)] + pub unsafe fn setChildSpecifier(&self, childSpecifier: Option<&NSScriptObjectSpecifier>); + #[method_id(containerSpecifier)] + pub unsafe fn containerSpecifier(&self) -> Option>; + # [method (setContainerSpecifier :)] pub unsafe fn setContainerSpecifier( &self, containerSpecifier: Option<&NSScriptObjectSpecifier>, - ) { - msg_send![self, setContainerSpecifier: containerSpecifier] - } - pub unsafe fn containerIsObjectBeingTested(&self) -> bool { - msg_send![self, containerIsObjectBeingTested] - } - pub unsafe fn setContainerIsObjectBeingTested(&self, containerIsObjectBeingTested: bool) { - msg_send![ - self, - setContainerIsObjectBeingTested: containerIsObjectBeingTested - ] - } - pub unsafe fn containerIsRangeContainerObject(&self) -> bool { - msg_send![self, containerIsRangeContainerObject] - } + ); + #[method(containerIsObjectBeingTested)] + pub unsafe fn containerIsObjectBeingTested(&self) -> bool; + # [method (setContainerIsObjectBeingTested :)] + pub unsafe fn setContainerIsObjectBeingTested(&self, containerIsObjectBeingTested: bool); + #[method(containerIsRangeContainerObject)] + pub unsafe fn containerIsRangeContainerObject(&self) -> bool; + # [method (setContainerIsRangeContainerObject :)] pub unsafe fn setContainerIsRangeContainerObject( &self, containerIsRangeContainerObject: bool, - ) { - msg_send![ - self, - setContainerIsRangeContainerObject: containerIsRangeContainerObject - ] - } - pub unsafe fn key(&self) -> Id { - msg_send_id![self, key] - } - pub unsafe fn setKey(&self, key: &NSString) { - msg_send![self, setKey: key] - } + ); + #[method_id(key)] + pub unsafe fn key(&self) -> Id; + # [method (setKey :)] + pub unsafe fn setKey(&self, key: &NSString); + #[method_id(containerClassDescription)] pub unsafe fn containerClassDescription( &self, - ) -> Option> { - msg_send_id![self, containerClassDescription] - } + ) -> Option>; + # [method (setContainerClassDescription :)] pub unsafe fn setContainerClassDescription( &self, containerClassDescription: Option<&NSScriptClassDescription>, - ) { - msg_send![ - self, - setContainerClassDescription: containerClassDescription - ] - } - pub unsafe fn keyClassDescription(&self) -> Option> { - msg_send_id![self, keyClassDescription] - } + ); + #[method_id(keyClassDescription)] + pub unsafe fn keyClassDescription(&self) -> Option>; + # [method (indicesOfObjectsByEvaluatingWithContainer : count :)] pub unsafe fn indicesOfObjectsByEvaluatingWithContainer_count( &self, container: &Object, count: NonNull, - ) -> *mut NSInteger { - msg_send![ - self, - indicesOfObjectsByEvaluatingWithContainer: container, - count: count - ] - } + ) -> *mut NSInteger; + # [method_id (objectsByEvaluatingWithContainers :)] pub unsafe fn objectsByEvaluatingWithContainers( &self, containers: &Object, - ) -> Option> { - msg_send_id![self, objectsByEvaluatingWithContainers: containers] - } - pub unsafe fn objectsByEvaluatingSpecifier(&self) -> Option> { - msg_send_id![self, objectsByEvaluatingSpecifier] - } - pub unsafe fn evaluationErrorNumber(&self) -> NSInteger { - msg_send![self, evaluationErrorNumber] - } - pub unsafe fn setEvaluationErrorNumber(&self, evaluationErrorNumber: NSInteger) { - msg_send![self, setEvaluationErrorNumber: evaluationErrorNumber] - } + ) -> Option>; + #[method_id(objectsByEvaluatingSpecifier)] + pub unsafe fn objectsByEvaluatingSpecifier(&self) -> Option>; + #[method(evaluationErrorNumber)] + pub unsafe fn evaluationErrorNumber(&self) -> NSInteger; + # [method (setEvaluationErrorNumber :)] + pub unsafe fn setEvaluationErrorNumber(&self, evaluationErrorNumber: NSInteger); + #[method_id(evaluationErrorSpecifier)] pub unsafe fn evaluationErrorSpecifier( &self, - ) -> Option> { - msg_send_id![self, evaluationErrorSpecifier] - } - pub unsafe fn descriptor(&self) -> Option> { - msg_send_id![self, descriptor] - } + ) -> Option>; + #[method_id(descriptor)] + pub unsafe fn descriptor(&self) -> Option>; } ); extern_methods!( #[doc = "NSScriptObjectSpecifiers"] unsafe impl NSObject { - pub unsafe fn objectSpecifier(&self) -> Option> { - msg_send_id![self, objectSpecifier] - } + #[method_id(objectSpecifier)] + pub unsafe fn objectSpecifier(&self) -> Option>; + # [method_id (indicesOfObjectsByEvaluatingObjectSpecifier :)] pub unsafe fn indicesOfObjectsByEvaluatingObjectSpecifier( &self, specifier: &NSScriptObjectSpecifier, - ) -> Option, Shared>> { - msg_send_id![self, indicesOfObjectsByEvaluatingObjectSpecifier: specifier] - } + ) -> Option, Shared>>; } ); extern_class!( @@ -164,27 +120,18 @@ extern_class!( ); extern_methods!( unsafe impl NSIndexSpecifier { + # [method_id (initWithContainerClassDescription : containerSpecifier : key : index :)] pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_index( &self, classDesc: &NSScriptClassDescription, container: Option<&NSScriptObjectSpecifier>, property: &NSString, index: NSInteger, - ) -> Id { - msg_send_id![ - self, - initWithContainerClassDescription: classDesc, - containerSpecifier: container, - key: property, - index: index - ] - } - pub unsafe fn index(&self) -> NSInteger { - msg_send![self, index] - } - pub unsafe fn setIndex(&self, index: NSInteger) { - msg_send![self, setIndex: index] - } + ) -> Id; + #[method(index)] + pub unsafe fn index(&self) -> NSInteger; + # [method (setIndex :)] + pub unsafe fn setIndex(&self, index: NSInteger); } ); extern_class!( @@ -206,30 +153,20 @@ extern_class!( ); extern_methods!( unsafe impl NSNameSpecifier { - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + # [method_id (initWithContainerClassDescription : containerSpecifier : key : name :)] pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_name( &self, classDesc: &NSScriptClassDescription, container: Option<&NSScriptObjectSpecifier>, property: &NSString, name: &NSString, - ) -> Id { - msg_send_id![ - self, - initWithContainerClassDescription: classDesc, - containerSpecifier: container, - key: property, - name: name - ] - } - pub unsafe fn name(&self) -> Id { - msg_send_id![self, name] - } - pub unsafe fn setName(&self, name: &NSString) { - msg_send![self, setName: name] - } + ) -> Id; + #[method_id(name)] + pub unsafe fn name(&self) -> Id; + # [method (setName :)] + pub unsafe fn setName(&self, name: &NSString); } ); extern_class!( @@ -241,40 +178,31 @@ extern_class!( ); extern_methods!( unsafe impl NSPositionalSpecifier { + # [method_id (initWithPosition : objectSpecifier :)] pub unsafe fn initWithPosition_objectSpecifier( &self, position: NSInsertionPosition, specifier: &NSScriptObjectSpecifier, - ) -> Id { - msg_send_id![self, initWithPosition: position, objectSpecifier: specifier] - } - pub unsafe fn position(&self) -> NSInsertionPosition { - msg_send![self, position] - } - pub unsafe fn objectSpecifier(&self) -> Id { - msg_send_id![self, objectSpecifier] - } + ) -> Id; + #[method(position)] + pub unsafe fn position(&self) -> NSInsertionPosition; + #[method_id(objectSpecifier)] + pub unsafe fn objectSpecifier(&self) -> Id; + # [method (setInsertionClassDescription :)] pub unsafe fn setInsertionClassDescription( &self, classDescription: &NSScriptClassDescription, - ) { - msg_send![self, setInsertionClassDescription: classDescription] - } - pub unsafe fn evaluate(&self) { - msg_send![self, evaluate] - } - pub unsafe fn insertionContainer(&self) -> Option> { - msg_send_id![self, insertionContainer] - } - pub unsafe fn insertionKey(&self) -> Option> { - msg_send_id![self, insertionKey] - } - pub unsafe fn insertionIndex(&self) -> NSInteger { - msg_send![self, insertionIndex] - } - pub unsafe fn insertionReplaces(&self) -> bool { - msg_send![self, insertionReplaces] - } + ); + #[method(evaluate)] + pub unsafe fn evaluate(&self); + #[method_id(insertionContainer)] + pub unsafe fn insertionContainer(&self) -> Option>; + #[method_id(insertionKey)] + pub unsafe fn insertionKey(&self) -> Option>; + #[method(insertionIndex)] + pub unsafe fn insertionIndex(&self) -> NSInteger; + #[method(insertionReplaces)] + pub unsafe fn insertionReplaces(&self) -> bool; } ); extern_class!( @@ -306,9 +234,9 @@ extern_class!( ); extern_methods!( unsafe impl NSRangeSpecifier { - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + # [method_id (initWithContainerClassDescription : containerSpecifier : key : startSpecifier : endSpecifier :)] pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_startSpecifier_endSpecifier( &self, classDesc: &NSScriptClassDescription, @@ -316,28 +244,15 @@ extern_methods!( property: &NSString, startSpec: Option<&NSScriptObjectSpecifier>, endSpec: Option<&NSScriptObjectSpecifier>, - ) -> Id { - msg_send_id![ - self, - initWithContainerClassDescription: classDesc, - containerSpecifier: container, - key: property, - startSpecifier: startSpec, - endSpecifier: endSpec - ] - } - pub unsafe fn startSpecifier(&self) -> Option> { - msg_send_id![self, startSpecifier] - } - pub unsafe fn setStartSpecifier(&self, startSpecifier: Option<&NSScriptObjectSpecifier>) { - msg_send![self, setStartSpecifier: startSpecifier] - } - pub unsafe fn endSpecifier(&self) -> Option> { - msg_send_id![self, endSpecifier] - } - pub unsafe fn setEndSpecifier(&self, endSpecifier: Option<&NSScriptObjectSpecifier>) { - msg_send![self, setEndSpecifier: endSpecifier] - } + ) -> Id; + #[method_id(startSpecifier)] + pub unsafe fn startSpecifier(&self) -> Option>; + # [method (setStartSpecifier :)] + pub unsafe fn setStartSpecifier(&self, startSpecifier: Option<&NSScriptObjectSpecifier>); + #[method_id(endSpecifier)] + pub unsafe fn endSpecifier(&self) -> Option>; + # [method (setEndSpecifier :)] + pub unsafe fn setEndSpecifier(&self, endSpecifier: Option<&NSScriptObjectSpecifier>); } ); extern_class!( @@ -349,9 +264,9 @@ extern_class!( ); extern_methods!( unsafe impl NSRelativeSpecifier { - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + # [method_id (initWithContainerClassDescription : containerSpecifier : key : relativePosition : baseSpecifier :)] pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_relativePosition_baseSpecifier( &self, classDesc: &NSScriptClassDescription, @@ -359,28 +274,15 @@ extern_methods!( property: &NSString, relPos: NSRelativePosition, baseSpecifier: Option<&NSScriptObjectSpecifier>, - ) -> Id { - msg_send_id![ - self, - initWithContainerClassDescription: classDesc, - containerSpecifier: container, - key: property, - relativePosition: relPos, - baseSpecifier: baseSpecifier - ] - } - pub unsafe fn relativePosition(&self) -> NSRelativePosition { - msg_send![self, relativePosition] - } - pub unsafe fn setRelativePosition(&self, relativePosition: NSRelativePosition) { - msg_send![self, setRelativePosition: relativePosition] - } - pub unsafe fn baseSpecifier(&self) -> Option> { - msg_send_id![self, baseSpecifier] - } - pub unsafe fn setBaseSpecifier(&self, baseSpecifier: Option<&NSScriptObjectSpecifier>) { - msg_send![self, setBaseSpecifier: baseSpecifier] - } + ) -> Id; + #[method(relativePosition)] + pub unsafe fn relativePosition(&self) -> NSRelativePosition; + # [method (setRelativePosition :)] + pub unsafe fn setRelativePosition(&self, relativePosition: NSRelativePosition); + #[method_id(baseSpecifier)] + pub unsafe fn baseSpecifier(&self) -> Option>; + # [method (setBaseSpecifier :)] + pub unsafe fn setBaseSpecifier(&self, baseSpecifier: Option<&NSScriptObjectSpecifier>); } ); extern_class!( @@ -392,30 +294,20 @@ extern_class!( ); extern_methods!( unsafe impl NSUniqueIDSpecifier { - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + # [method_id (initWithContainerClassDescription : containerSpecifier : key : uniqueID :)] pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_uniqueID( &self, classDesc: &NSScriptClassDescription, container: Option<&NSScriptObjectSpecifier>, property: &NSString, uniqueID: &Object, - ) -> Id { - msg_send_id![ - self, - initWithContainerClassDescription: classDesc, - containerSpecifier: container, - key: property, - uniqueID: uniqueID - ] - } - pub unsafe fn uniqueID(&self) -> Id { - msg_send_id![self, uniqueID] - } - pub unsafe fn setUniqueID(&self, uniqueID: &Object) { - msg_send![self, setUniqueID: uniqueID] - } + ) -> Id; + #[method_id(uniqueID)] + pub unsafe fn uniqueID(&self) -> Id; + # [method (setUniqueID :)] + pub unsafe fn setUniqueID(&self, uniqueID: &Object); } ); extern_class!( @@ -427,62 +319,41 @@ extern_class!( ); extern_methods!( unsafe impl NSWhoseSpecifier { - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + # [method_id (initWithContainerClassDescription : containerSpecifier : key : test :)] pub unsafe fn initWithContainerClassDescription_containerSpecifier_key_test( &self, classDesc: &NSScriptClassDescription, container: Option<&NSScriptObjectSpecifier>, property: &NSString, test: &NSScriptWhoseTest, - ) -> Id { - msg_send_id![ - self, - initWithContainerClassDescription: classDesc, - containerSpecifier: container, - key: property, - test: test - ] - } - pub unsafe fn test(&self) -> Id { - msg_send_id![self, test] - } - pub unsafe fn setTest(&self, test: &NSScriptWhoseTest) { - msg_send![self, setTest: test] - } - pub unsafe fn startSubelementIdentifier(&self) -> NSWhoseSubelementIdentifier { - msg_send![self, startSubelementIdentifier] - } + ) -> Id; + #[method_id(test)] + pub unsafe fn test(&self) -> Id; + # [method (setTest :)] + pub unsafe fn setTest(&self, test: &NSScriptWhoseTest); + #[method(startSubelementIdentifier)] + pub unsafe fn startSubelementIdentifier(&self) -> NSWhoseSubelementIdentifier; + # [method (setStartSubelementIdentifier :)] pub unsafe fn setStartSubelementIdentifier( &self, startSubelementIdentifier: NSWhoseSubelementIdentifier, - ) { - msg_send![ - self, - setStartSubelementIdentifier: startSubelementIdentifier - ] - } - pub unsafe fn startSubelementIndex(&self) -> NSInteger { - msg_send![self, startSubelementIndex] - } - pub unsafe fn setStartSubelementIndex(&self, startSubelementIndex: NSInteger) { - msg_send![self, setStartSubelementIndex: startSubelementIndex] - } - pub unsafe fn endSubelementIdentifier(&self) -> NSWhoseSubelementIdentifier { - msg_send![self, endSubelementIdentifier] - } + ); + #[method(startSubelementIndex)] + pub unsafe fn startSubelementIndex(&self) -> NSInteger; + # [method (setStartSubelementIndex :)] + pub unsafe fn setStartSubelementIndex(&self, startSubelementIndex: NSInteger); + #[method(endSubelementIdentifier)] + pub unsafe fn endSubelementIdentifier(&self) -> NSWhoseSubelementIdentifier; + # [method (setEndSubelementIdentifier :)] pub unsafe fn setEndSubelementIdentifier( &self, endSubelementIdentifier: NSWhoseSubelementIdentifier, - ) { - msg_send![self, setEndSubelementIdentifier: endSubelementIdentifier] - } - pub unsafe fn endSubelementIndex(&self) -> NSInteger { - msg_send![self, endSubelementIndex] - } - pub unsafe fn setEndSubelementIndex(&self, endSubelementIndex: NSInteger) { - msg_send![self, setEndSubelementIndex: endSubelementIndex] - } + ); + #[method(endSubelementIndex)] + pub unsafe fn endSubelementIndex(&self) -> NSInteger; + # [method (setEndSubelementIndex :)] + pub unsafe fn setEndSubelementIndex(&self, endSubelementIndex: NSInteger); } ); diff --git a/icrate/src/Foundation/generated/NSScriptStandardSuiteCommands.rs b/icrate/src/Foundation/generated/NSScriptStandardSuiteCommands.rs index 383dd84c6..f2af3ca09 100644 --- a/icrate/src/Foundation/generated/NSScriptStandardSuiteCommands.rs +++ b/icrate/src/Foundation/generated/NSScriptStandardSuiteCommands.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSScriptCommand::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSCloneCommand; @@ -16,12 +16,10 @@ extern_class!( ); extern_methods!( unsafe impl NSCloneCommand { - pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>) { - msg_send![self, setReceiversSpecifier: receiversRef] - } - pub unsafe fn keySpecifier(&self) -> Id { - msg_send_id![self, keySpecifier] - } + # [method (setReceiversSpecifier :)] + pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>); + #[method_id(keySpecifier)] + pub unsafe fn keySpecifier(&self) -> Id; } ); extern_class!( @@ -33,9 +31,8 @@ extern_class!( ); extern_methods!( unsafe impl NSCloseCommand { - pub unsafe fn saveOptions(&self) -> NSSaveOptions { - msg_send![self, saveOptions] - } + #[method(saveOptions)] + pub unsafe fn saveOptions(&self) -> NSSaveOptions; } ); extern_class!( @@ -57,12 +54,10 @@ extern_class!( ); extern_methods!( unsafe impl NSCreateCommand { - pub unsafe fn createClassDescription(&self) -> Id { - msg_send_id![self, createClassDescription] - } - pub unsafe fn resolvedKeyDictionary(&self) -> Id, Shared> { - msg_send_id![self, resolvedKeyDictionary] - } + #[method_id(createClassDescription)] + pub unsafe fn createClassDescription(&self) -> Id; + #[method_id(resolvedKeyDictionary)] + pub unsafe fn resolvedKeyDictionary(&self) -> Id, Shared>; } ); extern_class!( @@ -74,12 +69,10 @@ extern_class!( ); extern_methods!( unsafe impl NSDeleteCommand { - pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>) { - msg_send![self, setReceiversSpecifier: receiversRef] - } - pub unsafe fn keySpecifier(&self) -> Id { - msg_send_id![self, keySpecifier] - } + # [method (setReceiversSpecifier :)] + pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>); + #[method_id(keySpecifier)] + pub unsafe fn keySpecifier(&self) -> Id; } ); extern_class!( @@ -111,12 +104,10 @@ extern_class!( ); extern_methods!( unsafe impl NSMoveCommand { - pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>) { - msg_send![self, setReceiversSpecifier: receiversRef] - } - pub unsafe fn keySpecifier(&self) -> Id { - msg_send_id![self, keySpecifier] - } + # [method (setReceiversSpecifier :)] + pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>); + #[method_id(keySpecifier)] + pub unsafe fn keySpecifier(&self) -> Id; } ); extern_class!( @@ -128,9 +119,8 @@ extern_class!( ); extern_methods!( unsafe impl NSQuitCommand { - pub unsafe fn saveOptions(&self) -> NSSaveOptions { - msg_send![self, saveOptions] - } + #[method(saveOptions)] + pub unsafe fn saveOptions(&self) -> NSSaveOptions; } ); extern_class!( @@ -142,11 +132,9 @@ extern_class!( ); extern_methods!( unsafe impl NSSetCommand { - pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>) { - msg_send![self, setReceiversSpecifier: receiversRef] - } - pub unsafe fn keySpecifier(&self) -> Id { - msg_send_id![self, keySpecifier] - } + # [method (setReceiversSpecifier :)] + pub unsafe fn setReceiversSpecifier(&self, receiversRef: Option<&NSScriptObjectSpecifier>); + #[method_id(keySpecifier)] + pub unsafe fn keySpecifier(&self) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSScriptSuiteRegistry.rs b/icrate/src/Foundation/generated/NSScriptSuiteRegistry.rs index 7be399198..4185e790d 100644 --- a/icrate/src/Foundation/generated/NSScriptSuiteRegistry.rs +++ b/icrate/src/Foundation/generated/NSScriptSuiteRegistry.rs @@ -11,7 +11,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSScriptSuiteRegistry; @@ -21,81 +21,58 @@ extern_class!( ); extern_methods!( unsafe impl NSScriptSuiteRegistry { - pub unsafe fn sharedScriptSuiteRegistry() -> Id { - msg_send_id![Self::class(), sharedScriptSuiteRegistry] - } - pub unsafe fn setSharedScriptSuiteRegistry(registry: &NSScriptSuiteRegistry) { - msg_send![Self::class(), setSharedScriptSuiteRegistry: registry] - } - pub unsafe fn loadSuitesFromBundle(&self, bundle: &NSBundle) { - msg_send![self, loadSuitesFromBundle: bundle] - } + #[method_id(sharedScriptSuiteRegistry)] + pub unsafe fn sharedScriptSuiteRegistry() -> Id; + # [method (setSharedScriptSuiteRegistry :)] + pub unsafe fn setSharedScriptSuiteRegistry(registry: &NSScriptSuiteRegistry); + # [method (loadSuitesFromBundle :)] + pub unsafe fn loadSuitesFromBundle(&self, bundle: &NSBundle); + # [method (loadSuiteWithDictionary : fromBundle :)] pub unsafe fn loadSuiteWithDictionary_fromBundle( &self, suiteDeclaration: &NSDictionary, bundle: &NSBundle, - ) { - msg_send![ - self, - loadSuiteWithDictionary: suiteDeclaration, - fromBundle: bundle - ] - } - pub unsafe fn registerClassDescription(&self, classDescription: &NSScriptClassDescription) { - msg_send![self, registerClassDescription: classDescription] - } + ); + # [method (registerClassDescription :)] + pub unsafe fn registerClassDescription(&self, classDescription: &NSScriptClassDescription); + # [method (registerCommandDescription :)] pub unsafe fn registerCommandDescription( &self, commandDescription: &NSScriptCommandDescription, - ) { - msg_send![self, registerCommandDescription: commandDescription] - } - pub unsafe fn suiteNames(&self) -> Id, Shared> { - msg_send_id![self, suiteNames] - } - pub unsafe fn appleEventCodeForSuite(&self, suiteName: &NSString) -> FourCharCode { - msg_send![self, appleEventCodeForSuite: suiteName] - } - pub unsafe fn bundleForSuite(&self, suiteName: &NSString) -> Option> { - msg_send_id![self, bundleForSuite: suiteName] - } + ); + #[method_id(suiteNames)] + pub unsafe fn suiteNames(&self) -> Id, Shared>; + # [method (appleEventCodeForSuite :)] + pub unsafe fn appleEventCodeForSuite(&self, suiteName: &NSString) -> FourCharCode; + # [method_id (bundleForSuite :)] + pub unsafe fn bundleForSuite(&self, suiteName: &NSString) -> Option>; + # [method_id (classDescriptionsInSuite :)] pub unsafe fn classDescriptionsInSuite( &self, suiteName: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, classDescriptionsInSuite: suiteName] - } + ) -> Option, Shared>>; + # [method_id (commandDescriptionsInSuite :)] pub unsafe fn commandDescriptionsInSuite( &self, suiteName: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, commandDescriptionsInSuite: suiteName] - } + ) -> Option, Shared>>; + # [method_id (suiteForAppleEventCode :)] pub unsafe fn suiteForAppleEventCode( &self, appleEventCode: FourCharCode, - ) -> Option> { - msg_send_id![self, suiteForAppleEventCode: appleEventCode] - } + ) -> Option>; + # [method_id (classDescriptionWithAppleEventCode :)] pub unsafe fn classDescriptionWithAppleEventCode( &self, appleEventCode: FourCharCode, - ) -> Option> { - msg_send_id![self, classDescriptionWithAppleEventCode: appleEventCode] - } + ) -> Option>; + # [method_id (commandDescriptionWithAppleEventClass : andAppleEventCode :)] pub unsafe fn commandDescriptionWithAppleEventClass_andAppleEventCode( &self, appleEventClassCode: FourCharCode, appleEventIDCode: FourCharCode, - ) -> Option> { - msg_send_id![ - self, - commandDescriptionWithAppleEventClass: appleEventClassCode, - andAppleEventCode: appleEventIDCode - ] - } - pub unsafe fn aeteResource(&self, languageName: &NSString) -> Option> { - msg_send_id![self, aeteResource: languageName] - } + ) -> Option>; + # [method_id (aeteResource :)] + pub unsafe fn aeteResource(&self, languageName: &NSString) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSScriptWhoseTests.rs b/icrate/src/Foundation/generated/NSScriptWhoseTests.rs index c99a907cb..fe3a58358 100644 --- a/icrate/src/Foundation/generated/NSScriptWhoseTests.rs +++ b/icrate/src/Foundation/generated/NSScriptWhoseTests.rs @@ -5,7 +5,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSScriptWhoseTest; @@ -15,15 +15,12 @@ extern_class!( ); extern_methods!( unsafe impl NSScriptWhoseTest { - pub unsafe fn isTrue(&self) -> bool { - msg_send![self, isTrue] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } + #[method(isTrue)] + pub unsafe fn isTrue(&self) -> bool; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; } ); extern_class!( @@ -35,21 +32,18 @@ extern_class!( ); extern_methods!( unsafe impl NSLogicalTest { + # [method_id (initAndTestWithTests :)] pub unsafe fn initAndTestWithTests( &self, subTests: &NSArray, - ) -> Id { - msg_send_id![self, initAndTestWithTests: subTests] - } + ) -> Id; + # [method_id (initOrTestWithTests :)] pub unsafe fn initOrTestWithTests( &self, subTests: &NSArray, - ) -> Id { - msg_send_id![self, initOrTestWithTests: subTests] - } - pub unsafe fn initNotTestWithTest(&self, subTest: &NSScriptWhoseTest) -> Id { - msg_send_id![self, initNotTestWithTest: subTest] - } + ) -> Id; + # [method_id (initNotTestWithTest :)] + pub unsafe fn initNotTestWithTest(&self, subTest: &NSScriptWhoseTest) -> Id; } ); extern_class!( @@ -61,85 +55,60 @@ extern_class!( ); extern_methods!( unsafe impl NSSpecifierTest { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: inCoder] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, inCoder: &NSCoder) -> Option>; + # [method_id (initWithObjectSpecifier : comparisonOperator : testObject :)] pub unsafe fn initWithObjectSpecifier_comparisonOperator_testObject( &self, obj1: Option<&NSScriptObjectSpecifier>, compOp: NSTestComparisonOperation, obj2: Option<&Object>, - ) -> Id { - msg_send_id![ - self, - initWithObjectSpecifier: obj1, - comparisonOperator: compOp, - testObject: obj2 - ] - } + ) -> Id; } ); extern_methods!( #[doc = "NSComparisonMethods"] unsafe impl NSObject { - pub unsafe fn isEqualTo(&self, object: Option<&Object>) -> bool { - msg_send![self, isEqualTo: object] - } - pub unsafe fn isLessThanOrEqualTo(&self, object: Option<&Object>) -> bool { - msg_send![self, isLessThanOrEqualTo: object] - } - pub unsafe fn isLessThan(&self, object: Option<&Object>) -> bool { - msg_send![self, isLessThan: object] - } - pub unsafe fn isGreaterThanOrEqualTo(&self, object: Option<&Object>) -> bool { - msg_send![self, isGreaterThanOrEqualTo: object] - } - pub unsafe fn isGreaterThan(&self, object: Option<&Object>) -> bool { - msg_send![self, isGreaterThan: object] - } - pub unsafe fn isNotEqualTo(&self, object: Option<&Object>) -> bool { - msg_send![self, isNotEqualTo: object] - } - pub unsafe fn doesContain(&self, object: &Object) -> bool { - msg_send![self, doesContain: object] - } - pub unsafe fn isLike(&self, object: &NSString) -> bool { - msg_send![self, isLike: object] - } - pub unsafe fn isCaseInsensitiveLike(&self, object: &NSString) -> bool { - msg_send![self, isCaseInsensitiveLike: object] - } + # [method (isEqualTo :)] + pub unsafe fn isEqualTo(&self, object: Option<&Object>) -> bool; + # [method (isLessThanOrEqualTo :)] + pub unsafe fn isLessThanOrEqualTo(&self, object: Option<&Object>) -> bool; + # [method (isLessThan :)] + pub unsafe fn isLessThan(&self, object: Option<&Object>) -> bool; + # [method (isGreaterThanOrEqualTo :)] + pub unsafe fn isGreaterThanOrEqualTo(&self, object: Option<&Object>) -> bool; + # [method (isGreaterThan :)] + pub unsafe fn isGreaterThan(&self, object: Option<&Object>) -> bool; + # [method (isNotEqualTo :)] + pub unsafe fn isNotEqualTo(&self, object: Option<&Object>) -> bool; + # [method (doesContain :)] + pub unsafe fn doesContain(&self, object: &Object) -> bool; + # [method (isLike :)] + pub unsafe fn isLike(&self, object: &NSString) -> bool; + # [method (isCaseInsensitiveLike :)] + pub unsafe fn isCaseInsensitiveLike(&self, object: &NSString) -> bool; } ); extern_methods!( #[doc = "NSScriptingComparisonMethods"] unsafe impl NSObject { - pub unsafe fn scriptingIsEqualTo(&self, object: &Object) -> bool { - msg_send![self, scriptingIsEqualTo: object] - } - pub unsafe fn scriptingIsLessThanOrEqualTo(&self, object: &Object) -> bool { - msg_send![self, scriptingIsLessThanOrEqualTo: object] - } - pub unsafe fn scriptingIsLessThan(&self, object: &Object) -> bool { - msg_send![self, scriptingIsLessThan: object] - } - pub unsafe fn scriptingIsGreaterThanOrEqualTo(&self, object: &Object) -> bool { - msg_send![self, scriptingIsGreaterThanOrEqualTo: object] - } - pub unsafe fn scriptingIsGreaterThan(&self, object: &Object) -> bool { - msg_send![self, scriptingIsGreaterThan: object] - } - pub unsafe fn scriptingBeginsWith(&self, object: &Object) -> bool { - msg_send![self, scriptingBeginsWith: object] - } - pub unsafe fn scriptingEndsWith(&self, object: &Object) -> bool { - msg_send![self, scriptingEndsWith: object] - } - pub unsafe fn scriptingContains(&self, object: &Object) -> bool { - msg_send![self, scriptingContains: object] - } + # [method (scriptingIsEqualTo :)] + pub unsafe fn scriptingIsEqualTo(&self, object: &Object) -> bool; + # [method (scriptingIsLessThanOrEqualTo :)] + pub unsafe fn scriptingIsLessThanOrEqualTo(&self, object: &Object) -> bool; + # [method (scriptingIsLessThan :)] + pub unsafe fn scriptingIsLessThan(&self, object: &Object) -> bool; + # [method (scriptingIsGreaterThanOrEqualTo :)] + pub unsafe fn scriptingIsGreaterThanOrEqualTo(&self, object: &Object) -> bool; + # [method (scriptingIsGreaterThan :)] + pub unsafe fn scriptingIsGreaterThan(&self, object: &Object) -> bool; + # [method (scriptingBeginsWith :)] + pub unsafe fn scriptingBeginsWith(&self, object: &Object) -> bool; + # [method (scriptingEndsWith :)] + pub unsafe fn scriptingEndsWith(&self, object: &Object) -> bool; + # [method (scriptingContains :)] + pub unsafe fn scriptingContains(&self, object: &Object) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSSet.rs b/icrate/src/Foundation/generated/NSSet.rs index cd9b80645..2f56d9a68 100644 --- a/icrate/src/Foundation/generated/NSSet.rs +++ b/icrate/src/Foundation/generated/NSSet.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; __inner_extern_class!( #[derive(Debug)] pub struct NSSet; @@ -16,151 +16,112 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSSet { - pub unsafe fn count(&self) -> NSUInteger { - msg_send![self, count] - } - pub unsafe fn member(&self, object: &ObjectType) -> Option> { - msg_send_id![self, member: object] - } - pub unsafe fn objectEnumerator(&self) -> Id, Shared> { - msg_send_id![self, objectEnumerator] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method(count)] + pub unsafe fn count(&self) -> NSUInteger; + # [method_id (member :)] + pub unsafe fn member(&self, object: &ObjectType) -> Option>; + #[method_id(objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithObjects : count :)] pub unsafe fn initWithObjects_count( &self, objects: TodoArray, cnt: NSUInteger, - ) -> Id { - msg_send_id![self, initWithObjects: objects, count: cnt] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSExtendedSet"] unsafe impl NSSet { - pub unsafe fn allObjects(&self) -> Id, Shared> { - msg_send_id![self, allObjects] - } - pub unsafe fn anyObject(&self) -> Option> { - msg_send_id![self, anyObject] - } - pub unsafe fn containsObject(&self, anObject: &ObjectType) -> bool { - msg_send![self, containsObject: anObject] - } - pub unsafe fn description(&self) -> Id { - msg_send_id![self, description] - } - pub unsafe fn descriptionWithLocale( - &self, - locale: Option<&Object>, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale] - } - pub unsafe fn intersectsSet(&self, otherSet: &NSSet) -> bool { - msg_send![self, intersectsSet: otherSet] - } - pub unsafe fn isEqualToSet(&self, otherSet: &NSSet) -> bool { - msg_send![self, isEqualToSet: otherSet] - } - pub unsafe fn isSubsetOfSet(&self, otherSet: &NSSet) -> bool { - msg_send![self, isSubsetOfSet: otherSet] - } - pub unsafe fn makeObjectsPerformSelector(&self, aSelector: Sel) { - msg_send![self, makeObjectsPerformSelector: aSelector] - } + #[method_id(allObjects)] + pub unsafe fn allObjects(&self) -> Id, Shared>; + #[method_id(anyObject)] + pub unsafe fn anyObject(&self) -> Option>; + # [method (containsObject :)] + pub unsafe fn containsObject(&self, anObject: &ObjectType) -> bool; + #[method_id(description)] + pub unsafe fn description(&self) -> Id; + # [method_id (descriptionWithLocale :)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; + # [method (intersectsSet :)] + pub unsafe fn intersectsSet(&self, otherSet: &NSSet) -> bool; + # [method (isEqualToSet :)] + pub unsafe fn isEqualToSet(&self, otherSet: &NSSet) -> bool; + # [method (isSubsetOfSet :)] + pub unsafe fn isSubsetOfSet(&self, otherSet: &NSSet) -> bool; + # [method (makeObjectsPerformSelector :)] + pub unsafe fn makeObjectsPerformSelector(&self, aSelector: Sel); + # [method (makeObjectsPerformSelector : withObject :)] pub unsafe fn makeObjectsPerformSelector_withObject( &self, aSelector: Sel, argument: Option<&Object>, - ) { - msg_send![ - self, - makeObjectsPerformSelector: aSelector, - withObject: argument - ] - } + ); + # [method_id (setByAddingObject :)] pub unsafe fn setByAddingObject( &self, anObject: &ObjectType, - ) -> Id, Shared> { - msg_send_id![self, setByAddingObject: anObject] - } + ) -> Id, Shared>; + # [method_id (setByAddingObjectsFromSet :)] pub unsafe fn setByAddingObjectsFromSet( &self, other: &NSSet, - ) -> Id, Shared> { - msg_send_id![self, setByAddingObjectsFromSet: other] - } + ) -> Id, Shared>; + # [method_id (setByAddingObjectsFromArray :)] pub unsafe fn setByAddingObjectsFromArray( &self, other: &NSArray, - ) -> Id, Shared> { - msg_send_id![self, setByAddingObjectsFromArray: other] - } - pub unsafe fn enumerateObjectsUsingBlock(&self, block: TodoBlock) { - msg_send![self, enumerateObjectsUsingBlock: block] - } + ) -> Id, Shared>; + # [method (enumerateObjectsUsingBlock :)] + pub unsafe fn enumerateObjectsUsingBlock(&self, block: TodoBlock); + # [method (enumerateObjectsWithOptions : usingBlock :)] pub unsafe fn enumerateObjectsWithOptions_usingBlock( &self, opts: NSEnumerationOptions, block: TodoBlock, - ) { - msg_send![self, enumerateObjectsWithOptions: opts, usingBlock: block] - } + ); + # [method_id (objectsPassingTest :)] pub unsafe fn objectsPassingTest( &self, predicate: TodoBlock, - ) -> Id, Shared> { - msg_send_id![self, objectsPassingTest: predicate] - } + ) -> Id, Shared>; + # [method_id (objectsWithOptions : passingTest :)] pub unsafe fn objectsWithOptions_passingTest( &self, opts: NSEnumerationOptions, predicate: TodoBlock, - ) -> Id, Shared> { - msg_send_id![self, objectsWithOptions: opts, passingTest: predicate] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSSetCreation"] unsafe impl NSSet { - pub unsafe fn set() -> Id { - msg_send_id![Self::class(), set] - } - pub unsafe fn setWithObject(object: &ObjectType) -> Id { - msg_send_id![Self::class(), setWithObject: object] - } - pub unsafe fn setWithObjects_count( - objects: TodoArray, - cnt: NSUInteger, - ) -> Id { - msg_send_id![Self::class(), setWithObjects: objects, count: cnt] - } - pub unsafe fn setWithSet(set: &NSSet) -> Id { - msg_send_id![Self::class(), setWithSet: set] - } - pub unsafe fn setWithArray(array: &NSArray) -> Id { - msg_send_id![Self::class(), setWithArray: array] - } - pub unsafe fn initWithSet(&self, set: &NSSet) -> Id { - msg_send_id![self, initWithSet: set] - } + #[method_id(set)] + pub unsafe fn set() -> Id; + # [method_id (setWithObject :)] + pub unsafe fn setWithObject(object: &ObjectType) -> Id; + # [method_id (setWithObjects : count :)] + pub unsafe fn setWithObjects_count(objects: TodoArray, cnt: NSUInteger) + -> Id; + # [method_id (setWithSet :)] + pub unsafe fn setWithSet(set: &NSSet) -> Id; + # [method_id (setWithArray :)] + pub unsafe fn setWithArray(array: &NSArray) -> Id; + # [method_id (initWithSet :)] + pub unsafe fn initWithSet(&self, set: &NSSet) -> Id; + # [method_id (initWithSet : copyItems :)] pub unsafe fn initWithSet_copyItems( &self, set: &NSSet, flag: bool, - ) -> Id { - msg_send_id![self, initWithSet: set, copyItems: flag] - } - pub unsafe fn initWithArray(&self, array: &NSArray) -> Id { - msg_send_id![self, initWithArray: array] - } + ) -> Id; + # [method_id (initWithArray :)] + pub unsafe fn initWithArray(&self, array: &NSArray) -> Id; } ); __inner_extern_class!( @@ -172,52 +133,40 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSMutableSet { - pub unsafe fn addObject(&self, object: &ObjectType) { - msg_send![self, addObject: object] - } - pub unsafe fn removeObject(&self, object: &ObjectType) { - msg_send![self, removeObject: object] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithCapacity(&self, numItems: NSUInteger) -> Id { - msg_send_id![self, initWithCapacity: numItems] - } + # [method (addObject :)] + pub unsafe fn addObject(&self, object: &ObjectType); + # [method (removeObject :)] + pub unsafe fn removeObject(&self, object: &ObjectType); + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithCapacity :)] + pub unsafe fn initWithCapacity(&self, numItems: NSUInteger) -> Id; } ); extern_methods!( #[doc = "NSExtendedMutableSet"] unsafe impl NSMutableSet { - pub unsafe fn addObjectsFromArray(&self, array: &NSArray) { - msg_send![self, addObjectsFromArray: array] - } - pub unsafe fn intersectSet(&self, otherSet: &NSSet) { - msg_send![self, intersectSet: otherSet] - } - pub unsafe fn minusSet(&self, otherSet: &NSSet) { - msg_send![self, minusSet: otherSet] - } - pub unsafe fn removeAllObjects(&self) { - msg_send![self, removeAllObjects] - } - pub unsafe fn unionSet(&self, otherSet: &NSSet) { - msg_send![self, unionSet: otherSet] - } - pub unsafe fn setSet(&self, otherSet: &NSSet) { - msg_send![self, setSet: otherSet] - } + # [method (addObjectsFromArray :)] + pub unsafe fn addObjectsFromArray(&self, array: &NSArray); + # [method (intersectSet :)] + pub unsafe fn intersectSet(&self, otherSet: &NSSet); + # [method (minusSet :)] + pub unsafe fn minusSet(&self, otherSet: &NSSet); + #[method(removeAllObjects)] + pub unsafe fn removeAllObjects(&self); + # [method (unionSet :)] + pub unsafe fn unionSet(&self, otherSet: &NSSet); + # [method (setSet :)] + pub unsafe fn setSet(&self, otherSet: &NSSet); } ); extern_methods!( #[doc = "NSMutableSetCreation"] unsafe impl NSMutableSet { - pub unsafe fn setWithCapacity(numItems: NSUInteger) -> Id { - msg_send_id![Self::class(), setWithCapacity: numItems] - } + # [method_id (setWithCapacity :)] + pub unsafe fn setWithCapacity(numItems: NSUInteger) -> Id; } ); __inner_extern_class!( @@ -229,26 +178,19 @@ __inner_extern_class!( ); extern_methods!( unsafe impl NSCountedSet { - pub unsafe fn initWithCapacity(&self, numItems: NSUInteger) -> Id { - msg_send_id![self, initWithCapacity: numItems] - } - pub unsafe fn initWithArray(&self, array: &NSArray) -> Id { - msg_send_id![self, initWithArray: array] - } - pub unsafe fn initWithSet(&self, set: &NSSet) -> Id { - msg_send_id![self, initWithSet: set] - } - pub unsafe fn countForObject(&self, object: &ObjectType) -> NSUInteger { - msg_send![self, countForObject: object] - } - pub unsafe fn objectEnumerator(&self) -> Id, Shared> { - msg_send_id![self, objectEnumerator] - } - pub unsafe fn addObject(&self, object: &ObjectType) { - msg_send![self, addObject: object] - } - pub unsafe fn removeObject(&self, object: &ObjectType) { - msg_send![self, removeObject: object] - } + # [method_id (initWithCapacity :)] + pub unsafe fn initWithCapacity(&self, numItems: NSUInteger) -> Id; + # [method_id (initWithArray :)] + pub unsafe fn initWithArray(&self, array: &NSArray) -> Id; + # [method_id (initWithSet :)] + pub unsafe fn initWithSet(&self, set: &NSSet) -> Id; + # [method (countForObject :)] + pub unsafe fn countForObject(&self, object: &ObjectType) -> NSUInteger; + #[method_id(objectEnumerator)] + pub unsafe fn objectEnumerator(&self) -> Id, Shared>; + # [method (addObject :)] + pub unsafe fn addObject(&self, object: &ObjectType); + # [method (removeObject :)] + pub unsafe fn removeObject(&self, object: &ObjectType); } ); diff --git a/icrate/src/Foundation/generated/NSSortDescriptor.rs b/icrate/src/Foundation/generated/NSSortDescriptor.rs index 8b4e5b2c5..8b6bdc95c 100644 --- a/icrate/src/Foundation/generated/NSSortDescriptor.rs +++ b/icrate/src/Foundation/generated/NSSortDescriptor.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSSet::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSSortDescriptor; @@ -14,149 +14,106 @@ extern_class!( ); extern_methods!( unsafe impl NSSortDescriptor { + # [method_id (sortDescriptorWithKey : ascending :)] pub unsafe fn sortDescriptorWithKey_ascending( key: Option<&NSString>, ascending: bool, - ) -> Id { - msg_send_id![ - Self::class(), - sortDescriptorWithKey: key, - ascending: ascending - ] - } + ) -> Id; + # [method_id (sortDescriptorWithKey : ascending : selector :)] pub unsafe fn sortDescriptorWithKey_ascending_selector( key: Option<&NSString>, ascending: bool, selector: Option, - ) -> Id { - msg_send_id![ - Self::class(), - sortDescriptorWithKey: key, - ascending: ascending, - selector: selector - ] - } + ) -> Id; + # [method_id (initWithKey : ascending :)] pub unsafe fn initWithKey_ascending( &self, key: Option<&NSString>, ascending: bool, - ) -> Id { - msg_send_id![self, initWithKey: key, ascending: ascending] - } + ) -> Id; + # [method_id (initWithKey : ascending : selector :)] pub unsafe fn initWithKey_ascending_selector( &self, key: Option<&NSString>, ascending: bool, selector: Option, - ) -> Id { - msg_send_id![ - self, - initWithKey: key, - ascending: ascending, - selector: selector - ] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } - pub unsafe fn key(&self) -> Option> { - msg_send_id![self, key] - } - pub unsafe fn ascending(&self) -> bool { - msg_send![self, ascending] - } - pub unsafe fn selector(&self) -> Option { - msg_send![self, selector] - } - pub unsafe fn allowEvaluation(&self) { - msg_send![self, allowEvaluation] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; + #[method_id(key)] + pub unsafe fn key(&self) -> Option>; + #[method(ascending)] + pub unsafe fn ascending(&self) -> bool; + #[method(selector)] + pub unsafe fn selector(&self) -> Option; + #[method(allowEvaluation)] + pub unsafe fn allowEvaluation(&self); + # [method_id (sortDescriptorWithKey : ascending : comparator :)] pub unsafe fn sortDescriptorWithKey_ascending_comparator( key: Option<&NSString>, ascending: bool, cmptr: NSComparator, - ) -> Id { - msg_send_id![ - Self::class(), - sortDescriptorWithKey: key, - ascending: ascending, - comparator: cmptr - ] - } + ) -> Id; + # [method_id (initWithKey : ascending : comparator :)] pub unsafe fn initWithKey_ascending_comparator( &self, key: Option<&NSString>, ascending: bool, cmptr: NSComparator, - ) -> Id { - msg_send_id![ - self, - initWithKey: key, - ascending: ascending, - comparator: cmptr - ] - } - pub unsafe fn comparator(&self) -> NSComparator { - msg_send![self, comparator] - } + ) -> Id; + #[method(comparator)] + pub unsafe fn comparator(&self) -> NSComparator; + # [method (compareObject : toObject :)] pub unsafe fn compareObject_toObject( &self, object1: &Object, object2: &Object, - ) -> NSComparisonResult { - msg_send![self, compareObject: object1, toObject: object2] - } - pub unsafe fn reversedSortDescriptor(&self) -> Id { - msg_send_id![self, reversedSortDescriptor] - } + ) -> NSComparisonResult; + #[method_id(reversedSortDescriptor)] + pub unsafe fn reversedSortDescriptor(&self) -> Id; } ); extern_methods!( #[doc = "NSSortDescriptorSorting"] unsafe impl NSSet { + # [method_id (sortedArrayUsingDescriptors :)] pub unsafe fn sortedArrayUsingDescriptors( &self, sortDescriptors: &NSArray, - ) -> Id, Shared> { - msg_send_id![self, sortedArrayUsingDescriptors: sortDescriptors] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSSortDescriptorSorting"] unsafe impl NSArray { + # [method_id (sortedArrayUsingDescriptors :)] pub unsafe fn sortedArrayUsingDescriptors( &self, sortDescriptors: &NSArray, - ) -> Id, Shared> { - msg_send_id![self, sortedArrayUsingDescriptors: sortDescriptors] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSSortDescriptorSorting"] unsafe impl NSMutableArray { - pub unsafe fn sortUsingDescriptors(&self, sortDescriptors: &NSArray) { - msg_send![self, sortUsingDescriptors: sortDescriptors] - } + # [method (sortUsingDescriptors :)] + pub unsafe fn sortUsingDescriptors(&self, sortDescriptors: &NSArray); } ); extern_methods!( #[doc = "NSKeyValueSorting"] unsafe impl NSOrderedSet { + # [method_id (sortedArrayUsingDescriptors :)] pub unsafe fn sortedArrayUsingDescriptors( &self, sortDescriptors: &NSArray, - ) -> Id, Shared> { - msg_send_id![self, sortedArrayUsingDescriptors: sortDescriptors] - } + ) -> Id, Shared>; } ); extern_methods!( #[doc = "NSKeyValueSorting"] unsafe impl NSMutableOrderedSet { - pub unsafe fn sortUsingDescriptors(&self, sortDescriptors: &NSArray) { - msg_send![self, sortUsingDescriptors: sortDescriptors] - } + # [method (sortUsingDescriptors :)] + pub unsafe fn sortUsingDescriptors(&self, sortDescriptors: &NSArray); } ); diff --git a/icrate/src/Foundation/generated/NSSpellServer.rs b/icrate/src/Foundation/generated/NSSpellServer.rs index a0b879c8c..d168fa3a6 100644 --- a/icrate/src/Foundation/generated/NSSpellServer.rs +++ b/icrate/src/Foundation/generated/NSSpellServer.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSTextCheckingResult::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSSpellServer; @@ -17,29 +17,24 @@ extern_class!( ); extern_methods!( unsafe impl NSSpellServer { - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSSpellServerDelegate>) { - msg_send![self, setDelegate: delegate] - } + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSSpellServerDelegate>); + # [method (registerLanguage : byVendor :)] pub unsafe fn registerLanguage_byVendor( &self, language: Option<&NSString>, vendor: Option<&NSString>, - ) -> bool { - msg_send![self, registerLanguage: language, byVendor: vendor] - } + ) -> bool; + # [method (isWordInUserDictionaries : caseSensitive :)] pub unsafe fn isWordInUserDictionaries_caseSensitive( &self, word: &NSString, flag: bool, - ) -> bool { - msg_send![self, isWordInUserDictionaries: word, caseSensitive: flag] - } - pub unsafe fn run(&self) { - msg_send![self, run] - } + ) -> bool; + #[method(run)] + pub unsafe fn run(&self); } ); pub type NSSpellServerDelegate = NSObject; diff --git a/icrate/src/Foundation/generated/NSStream.rs b/icrate/src/Foundation/generated/NSStream.rs index d0e53a4c2..07f9dbb92 100644 --- a/icrate/src/Foundation/generated/NSStream.rs +++ b/icrate/src/Foundation/generated/NSStream.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSStreamPropertyKey = NSString; extern_class!( #[derive(Debug)] @@ -21,43 +21,33 @@ extern_class!( ); extern_methods!( unsafe impl NSStream { - pub unsafe fn open(&self) { - msg_send![self, open] - } - pub unsafe fn close(&self) { - msg_send![self, close] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSStreamDelegate>) { - msg_send![self, setDelegate: delegate] - } + #[method(open)] + pub unsafe fn open(&self); + #[method(close)] + pub unsafe fn close(&self); + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSStreamDelegate>); + # [method_id (propertyForKey :)] pub unsafe fn propertyForKey( &self, key: &NSStreamPropertyKey, - ) -> Option> { - msg_send_id![self, propertyForKey: key] - } + ) -> Option>; + # [method (setProperty : forKey :)] pub unsafe fn setProperty_forKey( &self, property: Option<&Object>, key: &NSStreamPropertyKey, - ) -> bool { - msg_send![self, setProperty: property, forKey: key] - } - pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, scheduleInRunLoop: aRunLoop, forMode: mode] - } - pub unsafe fn removeFromRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, removeFromRunLoop: aRunLoop, forMode: mode] - } - pub unsafe fn streamStatus(&self) -> NSStreamStatus { - msg_send![self, streamStatus] - } - pub unsafe fn streamError(&self) -> Option> { - msg_send_id![self, streamError] - } + ) -> bool; + # [method (scheduleInRunLoop : forMode :)] + pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + # [method (removeFromRunLoop : forMode :)] + pub unsafe fn removeFromRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + #[method(streamStatus)] + pub unsafe fn streamStatus(&self) -> NSStreamStatus; + #[method_id(streamError)] + pub unsafe fn streamError(&self) -> Option>; } ); extern_class!( @@ -69,25 +59,20 @@ extern_class!( ); extern_methods!( unsafe impl NSInputStream { - pub unsafe fn read_maxLength(&self, buffer: NonNull, len: NSUInteger) -> NSInteger { - msg_send![self, read: buffer, maxLength: len] - } + # [method (read : maxLength :)] + pub unsafe fn read_maxLength(&self, buffer: NonNull, len: NSUInteger) -> NSInteger; + # [method (getBuffer : length :)] pub unsafe fn getBuffer_length( &self, buffer: NonNull<*mut u8>, len: NonNull, - ) -> bool { - msg_send![self, getBuffer: buffer, length: len] - } - pub unsafe fn hasBytesAvailable(&self) -> bool { - msg_send![self, hasBytesAvailable] - } - pub unsafe fn initWithData(&self, data: &NSData) -> Id { - msg_send_id![self, initWithData: data] - } - pub unsafe fn initWithURL(&self, url: &NSURL) -> Option> { - msg_send_id![self, initWithURL: url] - } + ) -> bool; + #[method(hasBytesAvailable)] + pub unsafe fn hasBytesAvailable(&self) -> bool; + # [method_id (initWithData :)] + pub unsafe fn initWithData(&self, data: &NSData) -> Id; + # [method_id (initWithURL :)] + pub unsafe fn initWithURL(&self, url: &NSURL) -> Option>; } ); extern_class!( @@ -99,141 +84,95 @@ extern_class!( ); extern_methods!( unsafe impl NSOutputStream { - pub unsafe fn write_maxLength(&self, buffer: NonNull, len: NSUInteger) -> NSInteger { - msg_send![self, write: buffer, maxLength: len] - } - pub unsafe fn hasSpaceAvailable(&self) -> bool { - msg_send![self, hasSpaceAvailable] - } - pub unsafe fn initToMemory(&self) -> Id { - msg_send_id![self, initToMemory] - } + # [method (write : maxLength :)] + pub unsafe fn write_maxLength(&self, buffer: NonNull, len: NSUInteger) -> NSInteger; + #[method(hasSpaceAvailable)] + pub unsafe fn hasSpaceAvailable(&self) -> bool; + #[method_id(initToMemory)] + pub unsafe fn initToMemory(&self) -> Id; + # [method_id (initToBuffer : capacity :)] pub unsafe fn initToBuffer_capacity( &self, buffer: NonNull, capacity: NSUInteger, - ) -> Id { - msg_send_id![self, initToBuffer: buffer, capacity: capacity] - } + ) -> Id; + # [method_id (initWithURL : append :)] pub unsafe fn initWithURL_append( &self, url: &NSURL, shouldAppend: bool, - ) -> Option> { - msg_send_id![self, initWithURL: url, append: shouldAppend] - } + ) -> Option>; } ); extern_methods!( #[doc = "NSSocketStreamCreationExtensions"] unsafe impl NSStream { + # [method (getStreamsToHostWithName : port : inputStream : outputStream :)] pub unsafe fn getStreamsToHostWithName_port_inputStream_outputStream( hostname: &NSString, port: NSInteger, inputStream: Option<&mut Option>>, outputStream: Option<&mut Option>>, - ) { - msg_send![ - Self::class(), - getStreamsToHostWithName: hostname, - port: port, - inputStream: inputStream, - outputStream: outputStream - ] - } + ); + # [method (getStreamsToHost : port : inputStream : outputStream :)] pub unsafe fn getStreamsToHost_port_inputStream_outputStream( host: &NSHost, port: NSInteger, inputStream: Option<&mut Option>>, outputStream: Option<&mut Option>>, - ) { - msg_send![ - Self::class(), - getStreamsToHost: host, - port: port, - inputStream: inputStream, - outputStream: outputStream - ] - } + ); } ); extern_methods!( #[doc = "NSStreamBoundPairCreationExtensions"] unsafe impl NSStream { + # [method (getBoundStreamsWithBufferSize : inputStream : outputStream :)] pub unsafe fn getBoundStreamsWithBufferSize_inputStream_outputStream( bufferSize: NSUInteger, inputStream: Option<&mut Option>>, outputStream: Option<&mut Option>>, - ) { - msg_send![ - Self::class(), - getBoundStreamsWithBufferSize: bufferSize, - inputStream: inputStream, - outputStream: outputStream - ] - } + ); } ); extern_methods!( #[doc = "NSInputStreamExtensions"] unsafe impl NSInputStream { - pub unsafe fn initWithFileAtPath(&self, path: &NSString) -> Option> { - msg_send_id![self, initWithFileAtPath: path] - } - pub unsafe fn inputStreamWithData(data: &NSData) -> Option> { - msg_send_id![Self::class(), inputStreamWithData: data] - } - pub unsafe fn inputStreamWithFileAtPath(path: &NSString) -> Option> { - msg_send_id![Self::class(), inputStreamWithFileAtPath: path] - } - pub unsafe fn inputStreamWithURL(url: &NSURL) -> Option> { - msg_send_id![Self::class(), inputStreamWithURL: url] - } + # [method_id (initWithFileAtPath :)] + pub unsafe fn initWithFileAtPath(&self, path: &NSString) -> Option>; + # [method_id (inputStreamWithData :)] + pub unsafe fn inputStreamWithData(data: &NSData) -> Option>; + # [method_id (inputStreamWithFileAtPath :)] + pub unsafe fn inputStreamWithFileAtPath(path: &NSString) -> Option>; + # [method_id (inputStreamWithURL :)] + pub unsafe fn inputStreamWithURL(url: &NSURL) -> Option>; } ); extern_methods!( #[doc = "NSOutputStreamExtensions"] unsafe impl NSOutputStream { + # [method_id (initToFileAtPath : append :)] pub unsafe fn initToFileAtPath_append( &self, path: &NSString, shouldAppend: bool, - ) -> Option> { - msg_send_id![self, initToFileAtPath: path, append: shouldAppend] - } - pub unsafe fn outputStreamToMemory() -> Id { - msg_send_id![Self::class(), outputStreamToMemory] - } + ) -> Option>; + #[method_id(outputStreamToMemory)] + pub unsafe fn outputStreamToMemory() -> Id; + # [method_id (outputStreamToBuffer : capacity :)] pub unsafe fn outputStreamToBuffer_capacity( buffer: NonNull, capacity: NSUInteger, - ) -> Id { - msg_send_id![ - Self::class(), - outputStreamToBuffer: buffer, - capacity: capacity - ] - } + ) -> Id; + # [method_id (outputStreamToFileAtPath : append :)] pub unsafe fn outputStreamToFileAtPath_append( path: &NSString, shouldAppend: bool, - ) -> Id { - msg_send_id![ - Self::class(), - outputStreamToFileAtPath: path, - append: shouldAppend - ] - } + ) -> Id; + # [method_id (outputStreamWithURL : append :)] pub unsafe fn outputStreamWithURL_append( url: &NSURL, shouldAppend: bool, - ) -> Option> { - msg_send_id![ - Self::class(), - outputStreamWithURL: url, - append: shouldAppend - ] - } + ) -> Option>; } ); pub type NSStreamDelegate = NSObject; diff --git a/icrate/src/Foundation/generated/NSString.rs b/icrate/src/Foundation/generated/NSString.rs index c5ff11b2b..0e513d45e 100644 --- a/icrate/src/Foundation/generated/NSString.rs +++ b/icrate/src/Foundation/generated/NSString.rs @@ -11,7 +11,7 @@ use crate::Foundation::generated::NSRange::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSStringEncoding = NSUInteger; extern_class!( #[derive(Debug)] @@ -22,338 +22,223 @@ extern_class!( ); extern_methods!( unsafe impl NSString { - pub fn length(&self) -> NSUInteger { - msg_send![self, length] - } - pub unsafe fn characterAtIndex(&self, index: NSUInteger) -> unichar { - msg_send![self, characterAtIndex: index] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + #[method(length)] + pub fn length(&self) -> NSUInteger; + # [method (characterAtIndex :)] + pub unsafe fn characterAtIndex(&self, index: NSUInteger) -> unichar; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); pub type NSStringTransform = NSString; extern_methods!( #[doc = "NSStringExtensionMethods"] unsafe impl NSString { - pub unsafe fn substringFromIndex(&self, from: NSUInteger) -> Id { - msg_send_id![self, substringFromIndex: from] - } - pub unsafe fn substringToIndex(&self, to: NSUInteger) -> Id { - msg_send_id![self, substringToIndex: to] - } - pub unsafe fn substringWithRange(&self, range: NSRange) -> Id { - msg_send_id![self, substringWithRange: range] - } - pub unsafe fn getCharacters_range(&self, buffer: NonNull, range: NSRange) { - msg_send![self, getCharacters: buffer, range: range] - } - pub unsafe fn compare(&self, string: &NSString) -> NSComparisonResult { - msg_send![self, compare: string] - } + # [method_id (substringFromIndex :)] + pub unsafe fn substringFromIndex(&self, from: NSUInteger) -> Id; + # [method_id (substringToIndex :)] + pub unsafe fn substringToIndex(&self, to: NSUInteger) -> Id; + # [method_id (substringWithRange :)] + pub unsafe fn substringWithRange(&self, range: NSRange) -> Id; + # [method (getCharacters : range :)] + pub unsafe fn getCharacters_range(&self, buffer: NonNull, range: NSRange); + # [method (compare :)] + pub unsafe fn compare(&self, string: &NSString) -> NSComparisonResult; + # [method (compare : options :)] pub unsafe fn compare_options( &self, string: &NSString, mask: NSStringCompareOptions, - ) -> NSComparisonResult { - msg_send![self, compare: string, options: mask] - } + ) -> NSComparisonResult; + # [method (compare : options : range :)] pub unsafe fn compare_options_range( &self, string: &NSString, mask: NSStringCompareOptions, rangeOfReceiverToCompare: NSRange, - ) -> NSComparisonResult { - msg_send![ - self, - compare: string, - options: mask, - range: rangeOfReceiverToCompare - ] - } + ) -> NSComparisonResult; + # [method (compare : options : range : locale :)] pub unsafe fn compare_options_range_locale( &self, string: &NSString, mask: NSStringCompareOptions, rangeOfReceiverToCompare: NSRange, locale: Option<&Object>, - ) -> NSComparisonResult { - msg_send![ - self, - compare: string, - options: mask, - range: rangeOfReceiverToCompare, - locale: locale - ] - } - pub unsafe fn caseInsensitiveCompare(&self, string: &NSString) -> NSComparisonResult { - msg_send![self, caseInsensitiveCompare: string] - } - pub unsafe fn localizedCompare(&self, string: &NSString) -> NSComparisonResult { - msg_send![self, localizedCompare: string] - } + ) -> NSComparisonResult; + # [method (caseInsensitiveCompare :)] + pub unsafe fn caseInsensitiveCompare(&self, string: &NSString) -> NSComparisonResult; + # [method (localizedCompare :)] + pub unsafe fn localizedCompare(&self, string: &NSString) -> NSComparisonResult; + # [method (localizedCaseInsensitiveCompare :)] pub unsafe fn localizedCaseInsensitiveCompare( &self, string: &NSString, - ) -> NSComparisonResult { - msg_send![self, localizedCaseInsensitiveCompare: string] - } - pub unsafe fn localizedStandardCompare(&self, string: &NSString) -> NSComparisonResult { - msg_send![self, localizedStandardCompare: string] - } - pub unsafe fn isEqualToString(&self, aString: &NSString) -> bool { - msg_send![self, isEqualToString: aString] - } - pub unsafe fn hasPrefix(&self, str: &NSString) -> bool { - msg_send![self, hasPrefix: str] - } - pub unsafe fn hasSuffix(&self, str: &NSString) -> bool { - msg_send![self, hasSuffix: str] - } + ) -> NSComparisonResult; + # [method (localizedStandardCompare :)] + pub unsafe fn localizedStandardCompare(&self, string: &NSString) -> NSComparisonResult; + # [method (isEqualToString :)] + pub unsafe fn isEqualToString(&self, aString: &NSString) -> bool; + # [method (hasPrefix :)] + pub unsafe fn hasPrefix(&self, str: &NSString) -> bool; + # [method (hasSuffix :)] + pub unsafe fn hasSuffix(&self, str: &NSString) -> bool; + # [method_id (commonPrefixWithString : options :)] pub unsafe fn commonPrefixWithString_options( &self, str: &NSString, mask: NSStringCompareOptions, - ) -> Id { - msg_send_id![self, commonPrefixWithString: str, options: mask] - } - pub unsafe fn containsString(&self, str: &NSString) -> bool { - msg_send![self, containsString: str] - } - pub unsafe fn localizedCaseInsensitiveContainsString(&self, str: &NSString) -> bool { - msg_send![self, localizedCaseInsensitiveContainsString: str] - } - pub unsafe fn localizedStandardContainsString(&self, str: &NSString) -> bool { - msg_send![self, localizedStandardContainsString: str] - } - pub unsafe fn localizedStandardRangeOfString(&self, str: &NSString) -> NSRange { - msg_send![self, localizedStandardRangeOfString: str] - } - pub unsafe fn rangeOfString(&self, searchString: &NSString) -> NSRange { - msg_send![self, rangeOfString: searchString] - } + ) -> Id; + # [method (containsString :)] + pub unsafe fn containsString(&self, str: &NSString) -> bool; + # [method (localizedCaseInsensitiveContainsString :)] + pub unsafe fn localizedCaseInsensitiveContainsString(&self, str: &NSString) -> bool; + # [method (localizedStandardContainsString :)] + pub unsafe fn localizedStandardContainsString(&self, str: &NSString) -> bool; + # [method (localizedStandardRangeOfString :)] + pub unsafe fn localizedStandardRangeOfString(&self, str: &NSString) -> NSRange; + # [method (rangeOfString :)] + pub unsafe fn rangeOfString(&self, searchString: &NSString) -> NSRange; + # [method (rangeOfString : options :)] pub unsafe fn rangeOfString_options( &self, searchString: &NSString, mask: NSStringCompareOptions, - ) -> NSRange { - msg_send![self, rangeOfString: searchString, options: mask] - } + ) -> NSRange; + # [method (rangeOfString : options : range :)] pub unsafe fn rangeOfString_options_range( &self, searchString: &NSString, mask: NSStringCompareOptions, rangeOfReceiverToSearch: NSRange, - ) -> NSRange { - msg_send![ - self, - rangeOfString: searchString, - options: mask, - range: rangeOfReceiverToSearch - ] - } + ) -> NSRange; + # [method (rangeOfString : options : range : locale :)] pub unsafe fn rangeOfString_options_range_locale( &self, searchString: &NSString, mask: NSStringCompareOptions, rangeOfReceiverToSearch: NSRange, locale: Option<&NSLocale>, - ) -> NSRange { - msg_send![ - self, - rangeOfString: searchString, - options: mask, - range: rangeOfReceiverToSearch, - locale: locale - ] - } - pub unsafe fn rangeOfCharacterFromSet(&self, searchSet: &NSCharacterSet) -> NSRange { - msg_send![self, rangeOfCharacterFromSet: searchSet] - } + ) -> NSRange; + # [method (rangeOfCharacterFromSet :)] + pub unsafe fn rangeOfCharacterFromSet(&self, searchSet: &NSCharacterSet) -> NSRange; + # [method (rangeOfCharacterFromSet : options :)] pub unsafe fn rangeOfCharacterFromSet_options( &self, searchSet: &NSCharacterSet, mask: NSStringCompareOptions, - ) -> NSRange { - msg_send![self, rangeOfCharacterFromSet: searchSet, options: mask] - } + ) -> NSRange; + # [method (rangeOfCharacterFromSet : options : range :)] pub unsafe fn rangeOfCharacterFromSet_options_range( &self, searchSet: &NSCharacterSet, mask: NSStringCompareOptions, rangeOfReceiverToSearch: NSRange, - ) -> NSRange { - msg_send![ - self, - rangeOfCharacterFromSet: searchSet, - options: mask, - range: rangeOfReceiverToSearch - ] - } - pub unsafe fn rangeOfComposedCharacterSequenceAtIndex(&self, index: NSUInteger) -> NSRange { - msg_send![self, rangeOfComposedCharacterSequenceAtIndex: index] - } - pub unsafe fn rangeOfComposedCharacterSequencesForRange(&self, range: NSRange) -> NSRange { - msg_send![self, rangeOfComposedCharacterSequencesForRange: range] - } - pub fn stringByAppendingString(&self, aString: &NSString) -> Id { - msg_send_id![self, stringByAppendingString: aString] - } - pub unsafe fn doubleValue(&self) -> c_double { - msg_send![self, doubleValue] - } - pub unsafe fn floatValue(&self) -> c_float { - msg_send![self, floatValue] - } - pub unsafe fn intValue(&self) -> c_int { - msg_send![self, intValue] - } - pub unsafe fn integerValue(&self) -> NSInteger { - msg_send![self, integerValue] - } - pub unsafe fn longLongValue(&self) -> c_longlong { - msg_send![self, longLongValue] - } - pub unsafe fn boolValue(&self) -> bool { - msg_send![self, boolValue] - } - pub unsafe fn uppercaseString(&self) -> Id { - msg_send_id![self, uppercaseString] - } - pub unsafe fn lowercaseString(&self) -> Id { - msg_send_id![self, lowercaseString] - } - pub unsafe fn capitalizedString(&self) -> Id { - msg_send_id![self, capitalizedString] - } - pub unsafe fn localizedUppercaseString(&self) -> Id { - msg_send_id![self, localizedUppercaseString] - } - pub unsafe fn localizedLowercaseString(&self) -> Id { - msg_send_id![self, localizedLowercaseString] - } - pub unsafe fn localizedCapitalizedString(&self) -> Id { - msg_send_id![self, localizedCapitalizedString] - } + ) -> NSRange; + # [method (rangeOfComposedCharacterSequenceAtIndex :)] + pub unsafe fn rangeOfComposedCharacterSequenceAtIndex(&self, index: NSUInteger) -> NSRange; + # [method (rangeOfComposedCharacterSequencesForRange :)] + pub unsafe fn rangeOfComposedCharacterSequencesForRange(&self, range: NSRange) -> NSRange; + # [method_id (stringByAppendingString :)] + pub fn stringByAppendingString(&self, aString: &NSString) -> Id; + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + #[method(floatValue)] + pub unsafe fn floatValue(&self) -> c_float; + #[method(intValue)] + pub unsafe fn intValue(&self) -> c_int; + #[method(integerValue)] + pub unsafe fn integerValue(&self) -> NSInteger; + #[method(longLongValue)] + pub unsafe fn longLongValue(&self) -> c_longlong; + #[method(boolValue)] + pub unsafe fn boolValue(&self) -> bool; + #[method_id(uppercaseString)] + pub unsafe fn uppercaseString(&self) -> Id; + #[method_id(lowercaseString)] + pub unsafe fn lowercaseString(&self) -> Id; + #[method_id(capitalizedString)] + pub unsafe fn capitalizedString(&self) -> Id; + #[method_id(localizedUppercaseString)] + pub unsafe fn localizedUppercaseString(&self) -> Id; + #[method_id(localizedLowercaseString)] + pub unsafe fn localizedLowercaseString(&self) -> Id; + #[method_id(localizedCapitalizedString)] + pub unsafe fn localizedCapitalizedString(&self) -> Id; + # [method_id (uppercaseStringWithLocale :)] pub unsafe fn uppercaseStringWithLocale( &self, locale: Option<&NSLocale>, - ) -> Id { - msg_send_id![self, uppercaseStringWithLocale: locale] - } + ) -> Id; + # [method_id (lowercaseStringWithLocale :)] pub unsafe fn lowercaseStringWithLocale( &self, locale: Option<&NSLocale>, - ) -> Id { - msg_send_id![self, lowercaseStringWithLocale: locale] - } + ) -> Id; + # [method_id (capitalizedStringWithLocale :)] pub unsafe fn capitalizedStringWithLocale( &self, locale: Option<&NSLocale>, - ) -> Id { - msg_send_id![self, capitalizedStringWithLocale: locale] - } + ) -> Id; + # [method (getLineStart : end : contentsEnd : forRange :)] pub unsafe fn getLineStart_end_contentsEnd_forRange( &self, startPtr: *mut NSUInteger, lineEndPtr: *mut NSUInteger, contentsEndPtr: *mut NSUInteger, range: NSRange, - ) { - msg_send![ - self, - getLineStart: startPtr, - end: lineEndPtr, - contentsEnd: contentsEndPtr, - forRange: range - ] - } - pub unsafe fn lineRangeForRange(&self, range: NSRange) -> NSRange { - msg_send![self, lineRangeForRange: range] - } + ); + # [method (lineRangeForRange :)] + pub unsafe fn lineRangeForRange(&self, range: NSRange) -> NSRange; + # [method (getParagraphStart : end : contentsEnd : forRange :)] pub unsafe fn getParagraphStart_end_contentsEnd_forRange( &self, startPtr: *mut NSUInteger, parEndPtr: *mut NSUInteger, contentsEndPtr: *mut NSUInteger, range: NSRange, - ) { - msg_send![ - self, - getParagraphStart: startPtr, - end: parEndPtr, - contentsEnd: contentsEndPtr, - forRange: range - ] - } - pub unsafe fn paragraphRangeForRange(&self, range: NSRange) -> NSRange { - msg_send![self, paragraphRangeForRange: range] - } + ); + # [method (paragraphRangeForRange :)] + pub unsafe fn paragraphRangeForRange(&self, range: NSRange) -> NSRange; + # [method (enumerateSubstringsInRange : options : usingBlock :)] pub unsafe fn enumerateSubstringsInRange_options_usingBlock( &self, range: NSRange, opts: NSStringEnumerationOptions, block: TodoBlock, - ) { - msg_send![ - self, - enumerateSubstringsInRange: range, - options: opts, - usingBlock: block - ] - } - pub unsafe fn enumerateLinesUsingBlock(&self, block: TodoBlock) { - msg_send![self, enumerateLinesUsingBlock: block] - } - pub fn UTF8String(&self) -> *mut c_char { - msg_send![self, UTF8String] - } - pub unsafe fn fastestEncoding(&self) -> NSStringEncoding { - msg_send![self, fastestEncoding] - } - pub unsafe fn smallestEncoding(&self) -> NSStringEncoding { - msg_send![self, smallestEncoding] - } + ); + # [method (enumerateLinesUsingBlock :)] + pub unsafe fn enumerateLinesUsingBlock(&self, block: TodoBlock); + #[method(UTF8String)] + pub fn UTF8String(&self) -> *mut c_char; + #[method(fastestEncoding)] + pub unsafe fn fastestEncoding(&self) -> NSStringEncoding; + #[method(smallestEncoding)] + pub unsafe fn smallestEncoding(&self) -> NSStringEncoding; + # [method_id (dataUsingEncoding : allowLossyConversion :)] pub unsafe fn dataUsingEncoding_allowLossyConversion( &self, encoding: NSStringEncoding, lossy: bool, - ) -> Option> { - msg_send_id![ - self, - dataUsingEncoding: encoding, - allowLossyConversion: lossy - ] - } + ) -> Option>; + # [method_id (dataUsingEncoding :)] pub unsafe fn dataUsingEncoding( &self, encoding: NSStringEncoding, - ) -> Option> { - msg_send_id![self, dataUsingEncoding: encoding] - } - pub unsafe fn canBeConvertedToEncoding(&self, encoding: NSStringEncoding) -> bool { - msg_send![self, canBeConvertedToEncoding: encoding] - } - pub unsafe fn cStringUsingEncoding(&self, encoding: NSStringEncoding) -> *mut c_char { - msg_send![self, cStringUsingEncoding: encoding] - } + ) -> Option>; + # [method (canBeConvertedToEncoding :)] + pub unsafe fn canBeConvertedToEncoding(&self, encoding: NSStringEncoding) -> bool; + # [method (cStringUsingEncoding :)] + pub unsafe fn cStringUsingEncoding(&self, encoding: NSStringEncoding) -> *mut c_char; + # [method (getCString : maxLength : encoding :)] pub unsafe fn getCString_maxLength_encoding( &self, buffer: NonNull, maxBufferCount: NSUInteger, encoding: NSStringEncoding, - ) -> bool { - msg_send![ - self, - getCString: buffer, - maxLength: maxBufferCount, - encoding: encoding - ] - } + ) -> bool; + # [method (getBytes : maxLength : usedLength : encoding : options : range : remainingRange :)] pub unsafe fn getBytes_maxLength_usedLength_encoding_options_range_remainingRange( &self, buffer: *mut c_void, @@ -363,413 +248,250 @@ extern_methods!( options: NSStringEncodingConversionOptions, range: NSRange, leftover: NSRangePointer, - ) -> bool { - msg_send![ - self, - getBytes: buffer, - maxLength: maxBufferCount, - usedLength: usedBufferCount, - encoding: encoding, - options: options, - range: range, - remainingRange: leftover - ] - } - pub unsafe fn maximumLengthOfBytesUsingEncoding( - &self, - enc: NSStringEncoding, - ) -> NSUInteger { - msg_send![self, maximumLengthOfBytesUsingEncoding: enc] - } - pub fn lengthOfBytesUsingEncoding(&self, enc: NSStringEncoding) -> NSUInteger { - msg_send![self, lengthOfBytesUsingEncoding: enc] - } - pub unsafe fn availableStringEncodings() -> NonNull { - msg_send![Self::class(), availableStringEncodings] - } + ) -> bool; + # [method (maximumLengthOfBytesUsingEncoding :)] + pub unsafe fn maximumLengthOfBytesUsingEncoding(&self, enc: NSStringEncoding) + -> NSUInteger; + # [method (lengthOfBytesUsingEncoding :)] + pub fn lengthOfBytesUsingEncoding(&self, enc: NSStringEncoding) -> NSUInteger; + #[method(availableStringEncodings)] + pub unsafe fn availableStringEncodings() -> NonNull; + # [method_id (localizedNameOfStringEncoding :)] pub unsafe fn localizedNameOfStringEncoding( encoding: NSStringEncoding, - ) -> Id { - msg_send_id![Self::class(), localizedNameOfStringEncoding: encoding] - } - pub unsafe fn defaultCStringEncoding() -> NSStringEncoding { - msg_send![Self::class(), defaultCStringEncoding] - } - pub unsafe fn decomposedStringWithCanonicalMapping(&self) -> Id { - msg_send_id![self, decomposedStringWithCanonicalMapping] - } - pub unsafe fn precomposedStringWithCanonicalMapping(&self) -> Id { - msg_send_id![self, precomposedStringWithCanonicalMapping] - } - pub unsafe fn decomposedStringWithCompatibilityMapping(&self) -> Id { - msg_send_id![self, decomposedStringWithCompatibilityMapping] - } - pub unsafe fn precomposedStringWithCompatibilityMapping(&self) -> Id { - msg_send_id![self, precomposedStringWithCompatibilityMapping] - } + ) -> Id; + #[method(defaultCStringEncoding)] + pub unsafe fn defaultCStringEncoding() -> NSStringEncoding; + #[method_id(decomposedStringWithCanonicalMapping)] + pub unsafe fn decomposedStringWithCanonicalMapping(&self) -> Id; + #[method_id(precomposedStringWithCanonicalMapping)] + pub unsafe fn precomposedStringWithCanonicalMapping(&self) -> Id; + #[method_id(decomposedStringWithCompatibilityMapping)] + pub unsafe fn decomposedStringWithCompatibilityMapping(&self) -> Id; + #[method_id(precomposedStringWithCompatibilityMapping)] + pub unsafe fn precomposedStringWithCompatibilityMapping(&self) -> Id; + # [method_id (componentsSeparatedByString :)] pub unsafe fn componentsSeparatedByString( &self, separator: &NSString, - ) -> Id, Shared> { - msg_send_id![self, componentsSeparatedByString: separator] - } + ) -> Id, Shared>; + # [method_id (componentsSeparatedByCharactersInSet :)] pub unsafe fn componentsSeparatedByCharactersInSet( &self, separator: &NSCharacterSet, - ) -> Id, Shared> { - msg_send_id![self, componentsSeparatedByCharactersInSet: separator] - } + ) -> Id, Shared>; + # [method_id (stringByTrimmingCharactersInSet :)] pub unsafe fn stringByTrimmingCharactersInSet( &self, set: &NSCharacterSet, - ) -> Id { - msg_send_id![self, stringByTrimmingCharactersInSet: set] - } + ) -> Id; + # [method_id (stringByPaddingToLength : withString : startingAtIndex :)] pub unsafe fn stringByPaddingToLength_withString_startingAtIndex( &self, newLength: NSUInteger, padString: &NSString, padIndex: NSUInteger, - ) -> Id { - msg_send_id![ - self, - stringByPaddingToLength: newLength, - withString: padString, - startingAtIndex: padIndex - ] - } + ) -> Id; + # [method_id (stringByFoldingWithOptions : locale :)] pub unsafe fn stringByFoldingWithOptions_locale( &self, options: NSStringCompareOptions, locale: Option<&NSLocale>, - ) -> Id { - msg_send_id![self, stringByFoldingWithOptions: options, locale: locale] - } + ) -> Id; + # [method_id (stringByReplacingOccurrencesOfString : withString : options : range :)] pub unsafe fn stringByReplacingOccurrencesOfString_withString_options_range( &self, target: &NSString, replacement: &NSString, options: NSStringCompareOptions, searchRange: NSRange, - ) -> Id { - msg_send_id![ - self, - stringByReplacingOccurrencesOfString: target, - withString: replacement, - options: options, - range: searchRange - ] - } + ) -> Id; + # [method_id (stringByReplacingOccurrencesOfString : withString :)] pub unsafe fn stringByReplacingOccurrencesOfString_withString( &self, target: &NSString, replacement: &NSString, - ) -> Id { - msg_send_id![ - self, - stringByReplacingOccurrencesOfString: target, - withString: replacement - ] - } + ) -> Id; + # [method_id (stringByReplacingCharactersInRange : withString :)] pub unsafe fn stringByReplacingCharactersInRange_withString( &self, range: NSRange, replacement: &NSString, - ) -> Id { - msg_send_id![ - self, - stringByReplacingCharactersInRange: range, - withString: replacement - ] - } + ) -> Id; + # [method_id (stringByApplyingTransform : reverse :)] pub unsafe fn stringByApplyingTransform_reverse( &self, transform: &NSStringTransform, reverse: bool, - ) -> Option> { - msg_send_id![self, stringByApplyingTransform: transform, reverse: reverse] - } + ) -> Option>; + # [method (writeToURL : atomically : encoding : error :)] pub unsafe fn writeToURL_atomically_encoding_error( &self, url: &NSURL, useAuxiliaryFile: bool, enc: NSStringEncoding, - ) -> Result<(), Id> { - msg_send![ - self, - writeToURL: url, - atomically: useAuxiliaryFile, - encoding: enc, - error: _ - ] - } + ) -> Result<(), Id>; + # [method (writeToFile : atomically : encoding : error :)] pub unsafe fn writeToFile_atomically_encoding_error( &self, path: &NSString, useAuxiliaryFile: bool, enc: NSStringEncoding, - ) -> Result<(), Id> { - msg_send![ - self, - writeToFile: path, - atomically: useAuxiliaryFile, - encoding: enc, - error: _ - ] - } - pub unsafe fn description(&self) -> Id { - msg_send_id![self, description] - } - pub unsafe fn hash(&self) -> NSUInteger { - msg_send![self, hash] - } + ) -> Result<(), Id>; + #[method_id(description)] + pub unsafe fn description(&self) -> Id; + #[method(hash)] + pub unsafe fn hash(&self) -> NSUInteger; + # [method_id (initWithCharactersNoCopy : length : freeWhenDone :)] pub unsafe fn initWithCharactersNoCopy_length_freeWhenDone( &self, characters: NonNull, length: NSUInteger, freeBuffer: bool, - ) -> Id { - msg_send_id![ - self, - initWithCharactersNoCopy: characters, - length: length, - freeWhenDone: freeBuffer - ] - } + ) -> Id; + # [method_id (initWithCharactersNoCopy : length : deallocator :)] pub unsafe fn initWithCharactersNoCopy_length_deallocator( &self, chars: NonNull, len: NSUInteger, deallocator: TodoBlock, - ) -> Id { - msg_send_id![ - self, - initWithCharactersNoCopy: chars, - length: len, - deallocator: deallocator - ] - } + ) -> Id; + # [method_id (initWithCharacters : length :)] pub unsafe fn initWithCharacters_length( &self, characters: NonNull, length: NSUInteger, - ) -> Id { - msg_send_id![self, initWithCharacters: characters, length: length] - } + ) -> Id; + # [method_id (initWithUTF8String :)] pub unsafe fn initWithUTF8String( &self, nullTerminatedCString: NonNull, - ) -> Option> { - msg_send_id![self, initWithUTF8String: nullTerminatedCString] - } - pub unsafe fn initWithString(&self, aString: &NSString) -> Id { - msg_send_id![self, initWithString: aString] - } + ) -> Option>; + # [method_id (initWithString :)] + pub unsafe fn initWithString(&self, aString: &NSString) -> Id; + # [method_id (initWithFormat : arguments :)] pub unsafe fn initWithFormat_arguments( &self, format: &NSString, argList: va_list, - ) -> Id { - msg_send_id![self, initWithFormat: format, arguments: argList] - } + ) -> Id; + # [method_id (initWithFormat : locale : arguments :)] pub unsafe fn initWithFormat_locale_arguments( &self, format: &NSString, locale: Option<&Object>, argList: va_list, - ) -> Id { - msg_send_id![ - self, - initWithFormat: format, - locale: locale, - arguments: argList - ] - } + ) -> Id; + # [method_id (initWithData : encoding :)] pub unsafe fn initWithData_encoding( &self, data: &NSData, encoding: NSStringEncoding, - ) -> Option> { - msg_send_id![self, initWithData: data, encoding: encoding] - } + ) -> Option>; + # [method_id (initWithBytes : length : encoding :)] pub unsafe fn initWithBytes_length_encoding( &self, bytes: NonNull, len: NSUInteger, encoding: NSStringEncoding, - ) -> Option> { - msg_send_id![self, initWithBytes: bytes, length: len, encoding: encoding] - } + ) -> Option>; + # [method_id (initWithBytesNoCopy : length : encoding : freeWhenDone :)] pub unsafe fn initWithBytesNoCopy_length_encoding_freeWhenDone( &self, bytes: NonNull, len: NSUInteger, encoding: NSStringEncoding, freeBuffer: bool, - ) -> Option> { - msg_send_id![ - self, - initWithBytesNoCopy: bytes, - length: len, - encoding: encoding, - freeWhenDone: freeBuffer - ] - } + ) -> Option>; + # [method_id (initWithBytesNoCopy : length : encoding : deallocator :)] pub unsafe fn initWithBytesNoCopy_length_encoding_deallocator( &self, bytes: NonNull, len: NSUInteger, encoding: NSStringEncoding, deallocator: TodoBlock, - ) -> Option> { - msg_send_id![ - self, - initWithBytesNoCopy: bytes, - length: len, - encoding: encoding, - deallocator: deallocator - ] - } - pub unsafe fn string() -> Id { - msg_send_id![Self::class(), string] - } - pub unsafe fn stringWithString(string: &NSString) -> Id { - msg_send_id![Self::class(), stringWithString: string] - } + ) -> Option>; + #[method_id(string)] + pub unsafe fn string() -> Id; + # [method_id (stringWithString :)] + pub unsafe fn stringWithString(string: &NSString) -> Id; + # [method_id (stringWithCharacters : length :)] pub unsafe fn stringWithCharacters_length( characters: NonNull, length: NSUInteger, - ) -> Id { - msg_send_id![ - Self::class(), - stringWithCharacters: characters, - length: length - ] - } + ) -> Id; + # [method_id (stringWithUTF8String :)] pub unsafe fn stringWithUTF8String( nullTerminatedCString: NonNull, - ) -> Option> { - msg_send_id![Self::class(), stringWithUTF8String: nullTerminatedCString] - } + ) -> Option>; + # [method_id (initWithCString : encoding :)] pub unsafe fn initWithCString_encoding( &self, nullTerminatedCString: NonNull, encoding: NSStringEncoding, - ) -> Option> { - msg_send_id![ - self, - initWithCString: nullTerminatedCString, - encoding: encoding - ] - } + ) -> Option>; + # [method_id (stringWithCString : encoding :)] pub unsafe fn stringWithCString_encoding( cString: NonNull, enc: NSStringEncoding, - ) -> Option> { - msg_send_id![Self::class(), stringWithCString: cString, encoding: enc] - } + ) -> Option>; + # [method_id (initWithContentsOfURL : encoding : error :)] pub unsafe fn initWithContentsOfURL_encoding_error( &self, url: &NSURL, enc: NSStringEncoding, - ) -> Result, Id> { - msg_send_id![self, initWithContentsOfURL: url, encoding: enc, error: _] - } + ) -> Result, Id>; + # [method_id (initWithContentsOfFile : encoding : error :)] pub unsafe fn initWithContentsOfFile_encoding_error( &self, path: &NSString, enc: NSStringEncoding, - ) -> Result, Id> { - msg_send_id![self, initWithContentsOfFile: path, encoding: enc, error: _] - } + ) -> Result, Id>; + # [method_id (stringWithContentsOfURL : encoding : error :)] pub unsafe fn stringWithContentsOfURL_encoding_error( url: &NSURL, enc: NSStringEncoding, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - stringWithContentsOfURL: url, - encoding: enc, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (stringWithContentsOfFile : encoding : error :)] pub unsafe fn stringWithContentsOfFile_encoding_error( path: &NSString, enc: NSStringEncoding, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - stringWithContentsOfFile: path, - encoding: enc, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (initWithContentsOfURL : usedEncoding : error :)] pub unsafe fn initWithContentsOfURL_usedEncoding_error( &self, url: &NSURL, enc: *mut NSStringEncoding, - ) -> Result, Id> { - msg_send_id![ - self, - initWithContentsOfURL: url, - usedEncoding: enc, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (initWithContentsOfFile : usedEncoding : error :)] pub unsafe fn initWithContentsOfFile_usedEncoding_error( &self, path: &NSString, enc: *mut NSStringEncoding, - ) -> Result, Id> { - msg_send_id![ - self, - initWithContentsOfFile: path, - usedEncoding: enc, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (stringWithContentsOfURL : usedEncoding : error :)] pub unsafe fn stringWithContentsOfURL_usedEncoding_error( url: &NSURL, enc: *mut NSStringEncoding, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - stringWithContentsOfURL: url, - usedEncoding: enc, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (stringWithContentsOfFile : usedEncoding : error :)] pub unsafe fn stringWithContentsOfFile_usedEncoding_error( path: &NSString, enc: *mut NSStringEncoding, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - stringWithContentsOfFile: path, - usedEncoding: enc, - error: _ - ] - } + ) -> Result, Id>; } ); pub type NSStringEncodingDetectionOptionsKey = NSString; extern_methods!( #[doc = "NSStringEncodingDetection"] unsafe impl NSString { + # [method (stringEncodingForData : encodingOptions : convertedString : usedLossyConversion :)] pub unsafe fn stringEncodingForData_encodingOptions_convertedString_usedLossyConversion( data: &NSData, opts: Option<&NSDictionary>, string: Option<&mut Option>>, usedLossyConversion: *mut bool, - ) -> NSStringEncoding { - msg_send![ - Self::class(), - stringEncodingForData: data, - encodingOptions: opts, - convertedString: string, - usedLossyConversion: usedLossyConversion - ] - } + ) -> NSStringEncoding; } ); extern_methods!( @@ -785,169 +507,117 @@ extern_class!( ); extern_methods!( unsafe impl NSMutableString { + # [method (replaceCharactersInRange : withString :)] pub unsafe fn replaceCharactersInRange_withString( &self, range: NSRange, aString: &NSString, - ) { - msg_send![self, replaceCharactersInRange: range, withString: aString] - } + ); } ); extern_methods!( #[doc = "NSMutableStringExtensionMethods"] unsafe impl NSMutableString { - pub unsafe fn insertString_atIndex(&self, aString: &NSString, loc: NSUInteger) { - msg_send![self, insertString: aString, atIndex: loc] - } - pub unsafe fn deleteCharactersInRange(&self, range: NSRange) { - msg_send![self, deleteCharactersInRange: range] - } - pub unsafe fn appendString(&self, aString: &NSString) { - msg_send![self, appendString: aString] - } - pub unsafe fn setString(&self, aString: &NSString) { - msg_send![self, setString: aString] - } + # [method (insertString : atIndex :)] + pub unsafe fn insertString_atIndex(&self, aString: &NSString, loc: NSUInteger); + # [method (deleteCharactersInRange :)] + pub unsafe fn deleteCharactersInRange(&self, range: NSRange); + # [method (appendString :)] + pub unsafe fn appendString(&self, aString: &NSString); + # [method (setString :)] + pub unsafe fn setString(&self, aString: &NSString); + # [method (replaceOccurrencesOfString : withString : options : range :)] pub unsafe fn replaceOccurrencesOfString_withString_options_range( &self, target: &NSString, replacement: &NSString, options: NSStringCompareOptions, searchRange: NSRange, - ) -> NSUInteger { - msg_send![ - self, - replaceOccurrencesOfString: target, - withString: replacement, - options: options, - range: searchRange - ] - } + ) -> NSUInteger; + # [method (applyTransform : reverse : range : updatedRange :)] pub unsafe fn applyTransform_reverse_range_updatedRange( &self, transform: &NSStringTransform, reverse: bool, range: NSRange, resultingRange: NSRangePointer, - ) -> bool { - msg_send![ - self, - applyTransform: transform, - reverse: reverse, - range: range, - updatedRange: resultingRange - ] - } - pub unsafe fn initWithCapacity(&self, capacity: NSUInteger) -> Id { - msg_send_id![self, initWithCapacity: capacity] - } - pub unsafe fn stringWithCapacity(capacity: NSUInteger) -> Id { - msg_send_id![Self::class(), stringWithCapacity: capacity] - } + ) -> bool; + # [method_id (initWithCapacity :)] + pub unsafe fn initWithCapacity(&self, capacity: NSUInteger) -> Id; + # [method_id (stringWithCapacity :)] + pub unsafe fn stringWithCapacity(capacity: NSUInteger) -> Id; } ); extern_methods!( #[doc = "NSExtendedStringPropertyListParsing"] unsafe impl NSString { - pub unsafe fn propertyList(&self) -> Id { - msg_send_id![self, propertyList] - } - pub unsafe fn propertyListFromStringsFileFormat(&self) -> Option> { - msg_send_id![self, propertyListFromStringsFileFormat] - } + #[method_id(propertyList)] + pub unsafe fn propertyList(&self) -> Id; + #[method_id(propertyListFromStringsFileFormat)] + pub unsafe fn propertyListFromStringsFileFormat(&self) -> Option>; } ); extern_methods!( #[doc = "NSStringDeprecated"] unsafe impl NSString { - pub unsafe fn cString(&self) -> *mut c_char { - msg_send![self, cString] - } - pub unsafe fn lossyCString(&self) -> *mut c_char { - msg_send![self, lossyCString] - } - pub unsafe fn cStringLength(&self) -> NSUInteger { - msg_send![self, cStringLength] - } - pub unsafe fn getCString(&self, bytes: NonNull) { - msg_send![self, getCString: bytes] - } - pub unsafe fn getCString_maxLength(&self, bytes: NonNull, maxLength: NSUInteger) { - msg_send![self, getCString: bytes, maxLength: maxLength] - } + #[method(cString)] + pub unsafe fn cString(&self) -> *mut c_char; + #[method(lossyCString)] + pub unsafe fn lossyCString(&self) -> *mut c_char; + #[method(cStringLength)] + pub unsafe fn cStringLength(&self) -> NSUInteger; + # [method (getCString :)] + pub unsafe fn getCString(&self, bytes: NonNull); + # [method (getCString : maxLength :)] + pub unsafe fn getCString_maxLength(&self, bytes: NonNull, maxLength: NSUInteger); + # [method (getCString : maxLength : range : remainingRange :)] pub unsafe fn getCString_maxLength_range_remainingRange( &self, bytes: NonNull, maxLength: NSUInteger, aRange: NSRange, leftoverRange: NSRangePointer, - ) { - msg_send![ - self, - getCString: bytes, - maxLength: maxLength, - range: aRange, - remainingRange: leftoverRange - ] - } + ); + # [method (writeToFile : atomically :)] pub unsafe fn writeToFile_atomically( &self, path: &NSString, useAuxiliaryFile: bool, - ) -> bool { - msg_send![self, writeToFile: path, atomically: useAuxiliaryFile] - } - pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool { - msg_send![self, writeToURL: url, atomically: atomically] - } - pub unsafe fn initWithContentsOfFile(&self, path: &NSString) -> Option> { - msg_send_id![self, initWithContentsOfFile: path] - } - pub unsafe fn initWithContentsOfURL(&self, url: &NSURL) -> Option> { - msg_send_id![self, initWithContentsOfURL: url] - } - pub unsafe fn stringWithContentsOfFile(path: &NSString) -> Option> { - msg_send_id![Self::class(), stringWithContentsOfFile: path] - } - pub unsafe fn stringWithContentsOfURL(url: &NSURL) -> Option> { - msg_send_id![Self::class(), stringWithContentsOfURL: url] - } + ) -> bool; + # [method (writeToURL : atomically :)] + pub unsafe fn writeToURL_atomically(&self, url: &NSURL, atomically: bool) -> bool; + # [method_id (initWithContentsOfFile :)] + pub unsafe fn initWithContentsOfFile(&self, path: &NSString) -> Option>; + # [method_id (initWithContentsOfURL :)] + pub unsafe fn initWithContentsOfURL(&self, url: &NSURL) -> Option>; + # [method_id (stringWithContentsOfFile :)] + pub unsafe fn stringWithContentsOfFile(path: &NSString) -> Option>; + # [method_id (stringWithContentsOfURL :)] + pub unsafe fn stringWithContentsOfURL(url: &NSURL) -> Option>; + # [method_id (initWithCStringNoCopy : length : freeWhenDone :)] pub unsafe fn initWithCStringNoCopy_length_freeWhenDone( &self, bytes: NonNull, length: NSUInteger, freeBuffer: bool, - ) -> Option> { - msg_send_id![ - self, - initWithCStringNoCopy: bytes, - length: length, - freeWhenDone: freeBuffer - ] - } + ) -> Option>; + # [method_id (initWithCString : length :)] pub unsafe fn initWithCString_length( &self, bytes: NonNull, length: NSUInteger, - ) -> Option> { - msg_send_id![self, initWithCString: bytes, length: length] - } - pub unsafe fn initWithCString(&self, bytes: NonNull) -> Option> { - msg_send_id![self, initWithCString: bytes] - } + ) -> Option>; + # [method_id (initWithCString :)] + pub unsafe fn initWithCString(&self, bytes: NonNull) -> Option>; + # [method_id (stringWithCString : length :)] pub unsafe fn stringWithCString_length( bytes: NonNull, length: NSUInteger, - ) -> Option> { - msg_send_id![Self::class(), stringWithCString: bytes, length: length] - } - pub unsafe fn stringWithCString(bytes: NonNull) -> Option> { - msg_send_id![Self::class(), stringWithCString: bytes] - } - pub unsafe fn getCharacters(&self, buffer: NonNull) { - msg_send![self, getCharacters: buffer] - } + ) -> Option>; + # [method_id (stringWithCString :)] + pub unsafe fn stringWithCString(bytes: NonNull) -> Option>; + # [method (getCharacters :)] + pub unsafe fn getCharacters(&self, buffer: NonNull); } ); extern_class!( diff --git a/icrate/src/Foundation/generated/NSTask.rs b/icrate/src/Foundation/generated/NSTask.rs index d2c26b751..78716e939 100644 --- a/icrate/src/Foundation/generated/NSTask.rs +++ b/icrate/src/Foundation/generated/NSTask.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSTask; @@ -16,144 +16,95 @@ extern_class!( ); extern_methods!( unsafe impl NSTask { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn executableURL(&self) -> Option> { - msg_send_id![self, executableURL] - } - pub unsafe fn setExecutableURL(&self, executableURL: Option<&NSURL>) { - msg_send![self, setExecutableURL: executableURL] - } - pub unsafe fn arguments(&self) -> Option, Shared>> { - msg_send_id![self, arguments] - } - pub unsafe fn setArguments(&self, arguments: Option<&NSArray>) { - msg_send![self, setArguments: arguments] - } - pub unsafe fn environment(&self) -> Option, Shared>> { - msg_send_id![self, environment] - } - pub unsafe fn setEnvironment( - &self, - environment: Option<&NSDictionary>, - ) { - msg_send![self, setEnvironment: environment] - } - pub unsafe fn currentDirectoryURL(&self) -> Option> { - msg_send_id![self, currentDirectoryURL] - } - pub unsafe fn setCurrentDirectoryURL(&self, currentDirectoryURL: Option<&NSURL>) { - msg_send![self, setCurrentDirectoryURL: currentDirectoryURL] - } - pub unsafe fn standardInput(&self) -> Option> { - msg_send_id![self, standardInput] - } - pub unsafe fn setStandardInput(&self, standardInput: Option<&Object>) { - msg_send![self, setStandardInput: standardInput] - } - pub unsafe fn standardOutput(&self) -> Option> { - msg_send_id![self, standardOutput] - } - pub unsafe fn setStandardOutput(&self, standardOutput: Option<&Object>) { - msg_send![self, setStandardOutput: standardOutput] - } - pub unsafe fn standardError(&self) -> Option> { - msg_send_id![self, standardError] - } - pub unsafe fn setStandardError(&self, standardError: Option<&Object>) { - msg_send![self, setStandardError: standardError] - } - pub unsafe fn launchAndReturnError(&self) -> Result<(), Id> { - msg_send![self, launchAndReturnError: _] - } - pub unsafe fn interrupt(&self) { - msg_send![self, interrupt] - } - pub unsafe fn terminate(&self) { - msg_send![self, terminate] - } - pub unsafe fn suspend(&self) -> bool { - msg_send![self, suspend] - } - pub unsafe fn resume(&self) -> bool { - msg_send![self, resume] - } - pub unsafe fn processIdentifier(&self) -> c_int { - msg_send![self, processIdentifier] - } - pub unsafe fn isRunning(&self) -> bool { - msg_send![self, isRunning] - } - pub unsafe fn terminationStatus(&self) -> c_int { - msg_send![self, terminationStatus] - } - pub unsafe fn terminationReason(&self) -> NSTaskTerminationReason { - msg_send![self, terminationReason] - } - pub unsafe fn terminationHandler(&self) -> TodoBlock { - msg_send![self, terminationHandler] - } - pub unsafe fn setTerminationHandler(&self, terminationHandler: TodoBlock) { - msg_send![self, setTerminationHandler: terminationHandler] - } - pub unsafe fn qualityOfService(&self) -> NSQualityOfService { - msg_send![self, qualityOfService] - } - pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService) { - msg_send![self, setQualityOfService: qualityOfService] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(executableURL)] + pub unsafe fn executableURL(&self) -> Option>; + # [method (setExecutableURL :)] + pub unsafe fn setExecutableURL(&self, executableURL: Option<&NSURL>); + #[method_id(arguments)] + pub unsafe fn arguments(&self) -> Option, Shared>>; + # [method (setArguments :)] + pub unsafe fn setArguments(&self, arguments: Option<&NSArray>); + #[method_id(environment)] + pub unsafe fn environment(&self) -> Option, Shared>>; + # [method (setEnvironment :)] + pub unsafe fn setEnvironment(&self, environment: Option<&NSDictionary>); + #[method_id(currentDirectoryURL)] + pub unsafe fn currentDirectoryURL(&self) -> Option>; + # [method (setCurrentDirectoryURL :)] + pub unsafe fn setCurrentDirectoryURL(&self, currentDirectoryURL: Option<&NSURL>); + #[method_id(standardInput)] + pub unsafe fn standardInput(&self) -> Option>; + # [method (setStandardInput :)] + pub unsafe fn setStandardInput(&self, standardInput: Option<&Object>); + #[method_id(standardOutput)] + pub unsafe fn standardOutput(&self) -> Option>; + # [method (setStandardOutput :)] + pub unsafe fn setStandardOutput(&self, standardOutput: Option<&Object>); + #[method_id(standardError)] + pub unsafe fn standardError(&self) -> Option>; + # [method (setStandardError :)] + pub unsafe fn setStandardError(&self, standardError: Option<&Object>); + # [method (launchAndReturnError :)] + pub unsafe fn launchAndReturnError(&self) -> Result<(), Id>; + #[method(interrupt)] + pub unsafe fn interrupt(&self); + #[method(terminate)] + pub unsafe fn terminate(&self); + #[method(suspend)] + pub unsafe fn suspend(&self) -> bool; + #[method(resume)] + pub unsafe fn resume(&self) -> bool; + #[method(processIdentifier)] + pub unsafe fn processIdentifier(&self) -> c_int; + #[method(isRunning)] + pub unsafe fn isRunning(&self) -> bool; + #[method(terminationStatus)] + pub unsafe fn terminationStatus(&self) -> c_int; + #[method(terminationReason)] + pub unsafe fn terminationReason(&self) -> NSTaskTerminationReason; + #[method(terminationHandler)] + pub unsafe fn terminationHandler(&self) -> TodoBlock; + # [method (setTerminationHandler :)] + pub unsafe fn setTerminationHandler(&self, terminationHandler: TodoBlock); + #[method(qualityOfService)] + pub unsafe fn qualityOfService(&self) -> NSQualityOfService; + # [method (setQualityOfService :)] + pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService); } ); extern_methods!( #[doc = "NSTaskConveniences"] unsafe impl NSTask { + # [method_id (launchedTaskWithExecutableURL : arguments : error : terminationHandler :)] pub unsafe fn launchedTaskWithExecutableURL_arguments_error_terminationHandler( url: &NSURL, arguments: &NSArray, error: *mut *mut NSError, terminationHandler: TodoBlock, - ) -> Option> { - msg_send_id![ - Self::class(), - launchedTaskWithExecutableURL: url, - arguments: arguments, - error: error, - terminationHandler: terminationHandler - ] - } - pub unsafe fn waitUntilExit(&self) { - msg_send![self, waitUntilExit] - } + ) -> Option>; + #[method(waitUntilExit)] + pub unsafe fn waitUntilExit(&self); } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSTask { - pub unsafe fn launchPath(&self) -> Option> { - msg_send_id![self, launchPath] - } - pub unsafe fn setLaunchPath(&self, launchPath: Option<&NSString>) { - msg_send![self, setLaunchPath: launchPath] - } - pub unsafe fn currentDirectoryPath(&self) -> Id { - msg_send_id![self, currentDirectoryPath] - } - pub unsafe fn setCurrentDirectoryPath(&self, currentDirectoryPath: &NSString) { - msg_send![self, setCurrentDirectoryPath: currentDirectoryPath] - } - pub unsafe fn launch(&self) { - msg_send![self, launch] - } + #[method_id(launchPath)] + pub unsafe fn launchPath(&self) -> Option>; + # [method (setLaunchPath :)] + pub unsafe fn setLaunchPath(&self, launchPath: Option<&NSString>); + #[method_id(currentDirectoryPath)] + pub unsafe fn currentDirectoryPath(&self) -> Id; + # [method (setCurrentDirectoryPath :)] + pub unsafe fn setCurrentDirectoryPath(&self, currentDirectoryPath: &NSString); + #[method(launch)] + pub unsafe fn launch(&self); + # [method_id (launchedTaskWithLaunchPath : arguments :)] pub unsafe fn launchedTaskWithLaunchPath_arguments( path: &NSString, arguments: &NSArray, - ) -> Id { - msg_send_id![ - Self::class(), - launchedTaskWithLaunchPath: path, - arguments: arguments - ] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSTextCheckingResult.rs b/icrate/src/Foundation/generated/NSTextCheckingResult.rs index 42b34293c..707fc814e 100644 --- a/icrate/src/Foundation/generated/NSTextCheckingResult.rs +++ b/icrate/src/Foundation/generated/NSTextCheckingResult.rs @@ -12,7 +12,7 @@ use crate::Foundation::generated::NSRange::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSTextCheckingTypes = u64; pub type NSTextCheckingKey = NSString; extern_class!( @@ -24,227 +24,138 @@ extern_class!( ); extern_methods!( unsafe impl NSTextCheckingResult { - pub unsafe fn resultType(&self) -> NSTextCheckingType { - msg_send![self, resultType] - } - pub unsafe fn range(&self) -> NSRange { - msg_send![self, range] - } + #[method(resultType)] + pub unsafe fn resultType(&self) -> NSTextCheckingType; + #[method(range)] + pub unsafe fn range(&self) -> NSRange; } ); extern_methods!( #[doc = "NSTextCheckingResultOptional"] unsafe impl NSTextCheckingResult { - pub unsafe fn orthography(&self) -> Option> { - msg_send_id![self, orthography] - } + #[method_id(orthography)] + pub unsafe fn orthography(&self) -> Option>; + #[method_id(grammarDetails)] pub unsafe fn grammarDetails( &self, - ) -> Option>, Shared>> { - msg_send_id![self, grammarDetails] - } - pub unsafe fn date(&self) -> Option> { - msg_send_id![self, date] - } - pub unsafe fn timeZone(&self) -> Option> { - msg_send_id![self, timeZone] - } - pub unsafe fn duration(&self) -> NSTimeInterval { - msg_send![self, duration] - } + ) -> Option>, Shared>>; + #[method_id(date)] + pub unsafe fn date(&self) -> Option>; + #[method_id(timeZone)] + pub unsafe fn timeZone(&self) -> Option>; + #[method(duration)] + pub unsafe fn duration(&self) -> NSTimeInterval; + #[method_id(components)] pub unsafe fn components( &self, - ) -> Option, Shared>> { - msg_send_id![self, components] - } - pub unsafe fn URL(&self) -> Option> { - msg_send_id![self, URL] - } - pub unsafe fn replacementString(&self) -> Option> { - msg_send_id![self, replacementString] - } - pub unsafe fn alternativeStrings(&self) -> Option, Shared>> { - msg_send_id![self, alternativeStrings] - } - pub unsafe fn regularExpression(&self) -> Option> { - msg_send_id![self, regularExpression] - } - pub unsafe fn phoneNumber(&self) -> Option> { - msg_send_id![self, phoneNumber] - } - pub unsafe fn numberOfRanges(&self) -> NSUInteger { - msg_send![self, numberOfRanges] - } - pub unsafe fn rangeAtIndex(&self, idx: NSUInteger) -> NSRange { - msg_send![self, rangeAtIndex: idx] - } - pub unsafe fn rangeWithName(&self, name: &NSString) -> NSRange { - msg_send![self, rangeWithName: name] - } + ) -> Option, Shared>>; + #[method_id(URL)] + pub unsafe fn URL(&self) -> Option>; + #[method_id(replacementString)] + pub unsafe fn replacementString(&self) -> Option>; + #[method_id(alternativeStrings)] + pub unsafe fn alternativeStrings(&self) -> Option, Shared>>; + #[method_id(regularExpression)] + pub unsafe fn regularExpression(&self) -> Option>; + #[method_id(phoneNumber)] + pub unsafe fn phoneNumber(&self) -> Option>; + #[method(numberOfRanges)] + pub unsafe fn numberOfRanges(&self) -> NSUInteger; + # [method (rangeAtIndex :)] + pub unsafe fn rangeAtIndex(&self, idx: NSUInteger) -> NSRange; + # [method (rangeWithName :)] + pub unsafe fn rangeWithName(&self, name: &NSString) -> NSRange; + # [method_id (resultByAdjustingRangesWithOffset :)] pub unsafe fn resultByAdjustingRangesWithOffset( &self, offset: NSInteger, - ) -> Id { - msg_send_id![self, resultByAdjustingRangesWithOffset: offset] - } + ) -> Id; + #[method_id(addressComponents)] pub unsafe fn addressComponents( &self, - ) -> Option, Shared>> { - msg_send_id![self, addressComponents] - } + ) -> Option, Shared>>; } ); extern_methods!( #[doc = "NSTextCheckingResultCreation"] unsafe impl NSTextCheckingResult { + # [method_id (orthographyCheckingResultWithRange : orthography :)] pub unsafe fn orthographyCheckingResultWithRange_orthography( range: NSRange, orthography: &NSOrthography, - ) -> Id { - msg_send_id![ - Self::class(), - orthographyCheckingResultWithRange: range, - orthography: orthography - ] - } + ) -> Id; + # [method_id (spellCheckingResultWithRange :)] pub unsafe fn spellCheckingResultWithRange( range: NSRange, - ) -> Id { - msg_send_id![Self::class(), spellCheckingResultWithRange: range] - } + ) -> Id; + # [method_id (grammarCheckingResultWithRange : details :)] pub unsafe fn grammarCheckingResultWithRange_details( range: NSRange, details: &NSArray>, - ) -> Id { - msg_send_id![ - Self::class(), - grammarCheckingResultWithRange: range, - details: details - ] - } + ) -> Id; + # [method_id (dateCheckingResultWithRange : date :)] pub unsafe fn dateCheckingResultWithRange_date( range: NSRange, date: &NSDate, - ) -> Id { - msg_send_id![ - Self::class(), - dateCheckingResultWithRange: range, - date: date - ] - } + ) -> Id; + # [method_id (dateCheckingResultWithRange : date : timeZone : duration :)] pub unsafe fn dateCheckingResultWithRange_date_timeZone_duration( range: NSRange, date: &NSDate, timeZone: &NSTimeZone, duration: NSTimeInterval, - ) -> Id { - msg_send_id![ - Self::class(), - dateCheckingResultWithRange: range, - date: date, - timeZone: timeZone, - duration: duration - ] - } + ) -> Id; + # [method_id (addressCheckingResultWithRange : components :)] pub unsafe fn addressCheckingResultWithRange_components( range: NSRange, components: &NSDictionary, - ) -> Id { - msg_send_id![ - Self::class(), - addressCheckingResultWithRange: range, - components: components - ] - } + ) -> Id; + # [method_id (linkCheckingResultWithRange : URL :)] pub unsafe fn linkCheckingResultWithRange_URL( range: NSRange, url: &NSURL, - ) -> Id { - msg_send_id![Self::class(), linkCheckingResultWithRange: range, URL: url] - } + ) -> Id; + # [method_id (quoteCheckingResultWithRange : replacementString :)] pub unsafe fn quoteCheckingResultWithRange_replacementString( range: NSRange, replacementString: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - quoteCheckingResultWithRange: range, - replacementString: replacementString - ] - } + ) -> Id; + # [method_id (dashCheckingResultWithRange : replacementString :)] pub unsafe fn dashCheckingResultWithRange_replacementString( range: NSRange, replacementString: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - dashCheckingResultWithRange: range, - replacementString: replacementString - ] - } + ) -> Id; + # [method_id (replacementCheckingResultWithRange : replacementString :)] pub unsafe fn replacementCheckingResultWithRange_replacementString( range: NSRange, replacementString: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - replacementCheckingResultWithRange: range, - replacementString: replacementString - ] - } + ) -> Id; + # [method_id (correctionCheckingResultWithRange : replacementString :)] pub unsafe fn correctionCheckingResultWithRange_replacementString( range: NSRange, replacementString: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - correctionCheckingResultWithRange: range, - replacementString: replacementString - ] - } + ) -> Id; + # [method_id (correctionCheckingResultWithRange : replacementString : alternativeStrings :)] pub unsafe fn correctionCheckingResultWithRange_replacementString_alternativeStrings( range: NSRange, replacementString: &NSString, alternativeStrings: &NSArray, - ) -> Id { - msg_send_id![ - Self::class(), - correctionCheckingResultWithRange: range, - replacementString: replacementString, - alternativeStrings: alternativeStrings - ] - } + ) -> Id; + # [method_id (regularExpressionCheckingResultWithRanges : count : regularExpression :)] pub unsafe fn regularExpressionCheckingResultWithRanges_count_regularExpression( ranges: NSRangePointer, count: NSUInteger, regularExpression: &NSRegularExpression, - ) -> Id { - msg_send_id![ - Self::class(), - regularExpressionCheckingResultWithRanges: ranges, - count: count, - regularExpression: regularExpression - ] - } + ) -> Id; + # [method_id (phoneNumberCheckingResultWithRange : phoneNumber :)] pub unsafe fn phoneNumberCheckingResultWithRange_phoneNumber( range: NSRange, phoneNumber: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - phoneNumberCheckingResultWithRange: range, - phoneNumber: phoneNumber - ] - } + ) -> Id; + # [method_id (transitInformationCheckingResultWithRange : components :)] pub unsafe fn transitInformationCheckingResultWithRange_components( range: NSRange, components: &NSDictionary, - ) -> Id { - msg_send_id![ - Self::class(), - transitInformationCheckingResultWithRange: range, - components: components - ] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSThread.rs b/icrate/src/Foundation/generated/NSThread.rs index d35a4de12..60d3b9e62 100644 --- a/icrate/src/Foundation/generated/NSThread.rs +++ b/icrate/src/Foundation/generated/NSThread.rs @@ -9,7 +9,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSThread; @@ -19,154 +19,100 @@ extern_class!( ); extern_methods!( unsafe impl NSThread { - pub unsafe fn currentThread() -> Id { - msg_send_id![Self::class(), currentThread] - } - pub unsafe fn detachNewThreadWithBlock(block: TodoBlock) { - msg_send![Self::class(), detachNewThreadWithBlock: block] - } + #[method_id(currentThread)] + pub unsafe fn currentThread() -> Id; + # [method (detachNewThreadWithBlock :)] + pub unsafe fn detachNewThreadWithBlock(block: TodoBlock); + # [method (detachNewThreadSelector : toTarget : withObject :)] pub unsafe fn detachNewThreadSelector_toTarget_withObject( selector: Sel, target: &Object, argument: Option<&Object>, - ) { - msg_send![ - Self::class(), - detachNewThreadSelector: selector, - toTarget: target, - withObject: argument - ] - } - pub unsafe fn isMultiThreaded() -> bool { - msg_send![Self::class(), isMultiThreaded] - } - pub unsafe fn threadDictionary(&self) -> Id { - msg_send_id![self, threadDictionary] - } - pub unsafe fn sleepUntilDate(date: &NSDate) { - msg_send![Self::class(), sleepUntilDate: date] - } - pub unsafe fn sleepForTimeInterval(ti: NSTimeInterval) { - msg_send![Self::class(), sleepForTimeInterval: ti] - } - pub unsafe fn exit() { - msg_send![Self::class(), exit] - } - pub unsafe fn threadPriority() -> c_double { - msg_send![Self::class(), threadPriority] - } - pub unsafe fn setThreadPriority(p: c_double) -> bool { - msg_send![Self::class(), setThreadPriority: p] - } - pub unsafe fn threadPriority(&self) -> c_double { - msg_send![self, threadPriority] - } - pub unsafe fn setThreadPriority(&self, threadPriority: c_double) { - msg_send![self, setThreadPriority: threadPriority] - } - pub unsafe fn qualityOfService(&self) -> NSQualityOfService { - msg_send![self, qualityOfService] - } - pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService) { - msg_send![self, setQualityOfService: qualityOfService] - } - pub unsafe fn callStackReturnAddresses() -> Id, Shared> { - msg_send_id![Self::class(), callStackReturnAddresses] - } - pub unsafe fn callStackSymbols() -> Id, Shared> { - msg_send_id![Self::class(), callStackSymbols] - } - pub unsafe fn name(&self) -> Option> { - msg_send_id![self, name] - } - pub unsafe fn setName(&self, name: Option<&NSString>) { - msg_send![self, setName: name] - } - pub unsafe fn stackSize(&self) -> NSUInteger { - msg_send![self, stackSize] - } - pub unsafe fn setStackSize(&self, stackSize: NSUInteger) { - msg_send![self, setStackSize: stackSize] - } - pub unsafe fn isMainThread(&self) -> bool { - msg_send![self, isMainThread] - } - pub unsafe fn isMainThread() -> bool { - msg_send![Self::class(), isMainThread] - } - pub unsafe fn mainThread() -> Id { - msg_send_id![Self::class(), mainThread] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + ); + #[method(isMultiThreaded)] + pub unsafe fn isMultiThreaded() -> bool; + #[method_id(threadDictionary)] + pub unsafe fn threadDictionary(&self) -> Id; + # [method (sleepUntilDate :)] + pub unsafe fn sleepUntilDate(date: &NSDate); + # [method (sleepForTimeInterval :)] + pub unsafe fn sleepForTimeInterval(ti: NSTimeInterval); + #[method(exit)] + pub unsafe fn exit(); + #[method(threadPriority)] + pub unsafe fn threadPriority() -> c_double; + # [method (setThreadPriority :)] + pub unsafe fn setThreadPriority(p: c_double) -> bool; + #[method(threadPriority)] + pub unsafe fn threadPriority(&self) -> c_double; + # [method (setThreadPriority :)] + pub unsafe fn setThreadPriority(&self, threadPriority: c_double); + #[method(qualityOfService)] + pub unsafe fn qualityOfService(&self) -> NSQualityOfService; + # [method (setQualityOfService :)] + pub unsafe fn setQualityOfService(&self, qualityOfService: NSQualityOfService); + #[method_id(callStackReturnAddresses)] + pub unsafe fn callStackReturnAddresses() -> Id, Shared>; + #[method_id(callStackSymbols)] + pub unsafe fn callStackSymbols() -> Id, Shared>; + #[method_id(name)] + pub unsafe fn name(&self) -> Option>; + # [method (setName :)] + pub unsafe fn setName(&self, name: Option<&NSString>); + #[method(stackSize)] + pub unsafe fn stackSize(&self) -> NSUInteger; + # [method (setStackSize :)] + pub unsafe fn setStackSize(&self, stackSize: NSUInteger); + #[method(isMainThread)] + pub unsafe fn isMainThread(&self) -> bool; + #[method(isMainThread)] + pub unsafe fn isMainThread() -> bool; + #[method_id(mainThread)] + pub unsafe fn mainThread() -> Id; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithTarget : selector : object :)] pub unsafe fn initWithTarget_selector_object( &self, target: &Object, selector: Sel, argument: Option<&Object>, - ) -> Id { - msg_send_id![ - self, - initWithTarget: target, - selector: selector, - object: argument - ] - } - pub unsafe fn initWithBlock(&self, block: TodoBlock) -> Id { - msg_send_id![self, initWithBlock: block] - } - pub unsafe fn isExecuting(&self) -> bool { - msg_send![self, isExecuting] - } - pub unsafe fn isFinished(&self) -> bool { - msg_send![self, isFinished] - } - pub unsafe fn isCancelled(&self) -> bool { - msg_send![self, isCancelled] - } - pub unsafe fn cancel(&self) { - msg_send![self, cancel] - } - pub unsafe fn start(&self) { - msg_send![self, start] - } - pub unsafe fn main(&self) { - msg_send![self, main] - } + ) -> Id; + # [method_id (initWithBlock :)] + pub unsafe fn initWithBlock(&self, block: TodoBlock) -> Id; + #[method(isExecuting)] + pub unsafe fn isExecuting(&self) -> bool; + #[method(isFinished)] + pub unsafe fn isFinished(&self) -> bool; + #[method(isCancelled)] + pub unsafe fn isCancelled(&self) -> bool; + #[method(cancel)] + pub unsafe fn cancel(&self); + #[method(start)] + pub unsafe fn start(&self); + #[method(main)] + pub unsafe fn main(&self); } ); extern_methods!( #[doc = "NSThreadPerformAdditions"] unsafe impl NSObject { + # [method (performSelectorOnMainThread : withObject : waitUntilDone : modes :)] pub unsafe fn performSelectorOnMainThread_withObject_waitUntilDone_modes( &self, aSelector: Sel, arg: Option<&Object>, wait: bool, array: Option<&NSArray>, - ) { - msg_send![ - self, - performSelectorOnMainThread: aSelector, - withObject: arg, - waitUntilDone: wait, - modes: array - ] - } + ); + # [method (performSelectorOnMainThread : withObject : waitUntilDone :)] pub unsafe fn performSelectorOnMainThread_withObject_waitUntilDone( &self, aSelector: Sel, arg: Option<&Object>, wait: bool, - ) { - msg_send![ - self, - performSelectorOnMainThread: aSelector, - withObject: arg, - waitUntilDone: wait - ] - } + ); + # [method (performSelector : onThread : withObject : waitUntilDone : modes :)] pub unsafe fn performSelector_onThread_withObject_waitUntilDone_modes( &self, aSelector: Sel, @@ -174,41 +120,20 @@ extern_methods!( arg: Option<&Object>, wait: bool, array: Option<&NSArray>, - ) { - msg_send![ - self, - performSelector: aSelector, - onThread: thr, - withObject: arg, - waitUntilDone: wait, - modes: array - ] - } + ); + # [method (performSelector : onThread : withObject : waitUntilDone :)] pub unsafe fn performSelector_onThread_withObject_waitUntilDone( &self, aSelector: Sel, thr: &NSThread, arg: Option<&Object>, wait: bool, - ) { - msg_send![ - self, - performSelector: aSelector, - onThread: thr, - withObject: arg, - waitUntilDone: wait - ] - } + ); + # [method (performSelectorInBackground : withObject :)] pub unsafe fn performSelectorInBackground_withObject( &self, aSelector: Sel, arg: Option<&Object>, - ) { - msg_send![ - self, - performSelectorInBackground: aSelector, - withObject: arg - ] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSTimeZone.rs b/icrate/src/Foundation/generated/NSTimeZone.rs index 77c353155..5dfef59f4 100644 --- a/icrate/src/Foundation/generated/NSTimeZone.rs +++ b/icrate/src/Foundation/generated/NSTimeZone.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSTimeZone; @@ -20,126 +20,92 @@ extern_class!( ); extern_methods!( unsafe impl NSTimeZone { - pub unsafe fn name(&self) -> Id { - msg_send_id![self, name] - } - pub unsafe fn data(&self) -> Id { - msg_send_id![self, data] - } - pub unsafe fn secondsFromGMTForDate(&self, aDate: &NSDate) -> NSInteger { - msg_send![self, secondsFromGMTForDate: aDate] - } - pub unsafe fn abbreviationForDate(&self, aDate: &NSDate) -> Option> { - msg_send_id![self, abbreviationForDate: aDate] - } - pub unsafe fn isDaylightSavingTimeForDate(&self, aDate: &NSDate) -> bool { - msg_send![self, isDaylightSavingTimeForDate: aDate] - } - pub unsafe fn daylightSavingTimeOffsetForDate(&self, aDate: &NSDate) -> NSTimeInterval { - msg_send![self, daylightSavingTimeOffsetForDate: aDate] - } + #[method_id(name)] + pub unsafe fn name(&self) -> Id; + #[method_id(data)] + pub unsafe fn data(&self) -> Id; + # [method (secondsFromGMTForDate :)] + pub unsafe fn secondsFromGMTForDate(&self, aDate: &NSDate) -> NSInteger; + # [method_id (abbreviationForDate :)] + pub unsafe fn abbreviationForDate(&self, aDate: &NSDate) -> Option>; + # [method (isDaylightSavingTimeForDate :)] + pub unsafe fn isDaylightSavingTimeForDate(&self, aDate: &NSDate) -> bool; + # [method (daylightSavingTimeOffsetForDate :)] + pub unsafe fn daylightSavingTimeOffsetForDate(&self, aDate: &NSDate) -> NSTimeInterval; + # [method_id (nextDaylightSavingTimeTransitionAfterDate :)] pub unsafe fn nextDaylightSavingTimeTransitionAfterDate( &self, aDate: &NSDate, - ) -> Option> { - msg_send_id![self, nextDaylightSavingTimeTransitionAfterDate: aDate] - } + ) -> Option>; } ); extern_methods!( #[doc = "NSExtendedTimeZone"] unsafe impl NSTimeZone { - pub unsafe fn systemTimeZone() -> Id { - msg_send_id![Self::class(), systemTimeZone] - } - pub unsafe fn resetSystemTimeZone() { - msg_send![Self::class(), resetSystemTimeZone] - } - pub unsafe fn defaultTimeZone() -> Id { - msg_send_id![Self::class(), defaultTimeZone] - } - pub unsafe fn setDefaultTimeZone(defaultTimeZone: &NSTimeZone) { - msg_send![Self::class(), setDefaultTimeZone: defaultTimeZone] - } - pub unsafe fn localTimeZone() -> Id { - msg_send_id![Self::class(), localTimeZone] - } - pub unsafe fn knownTimeZoneNames() -> Id, Shared> { - msg_send_id![Self::class(), knownTimeZoneNames] - } - pub unsafe fn abbreviationDictionary() -> Id, Shared> { - msg_send_id![Self::class(), abbreviationDictionary] - } + #[method_id(systemTimeZone)] + pub unsafe fn systemTimeZone() -> Id; + #[method(resetSystemTimeZone)] + pub unsafe fn resetSystemTimeZone(); + #[method_id(defaultTimeZone)] + pub unsafe fn defaultTimeZone() -> Id; + # [method (setDefaultTimeZone :)] + pub unsafe fn setDefaultTimeZone(defaultTimeZone: &NSTimeZone); + #[method_id(localTimeZone)] + pub unsafe fn localTimeZone() -> Id; + #[method_id(knownTimeZoneNames)] + pub unsafe fn knownTimeZoneNames() -> Id, Shared>; + #[method_id(abbreviationDictionary)] + pub unsafe fn abbreviationDictionary() -> Id, Shared>; + # [method (setAbbreviationDictionary :)] pub unsafe fn setAbbreviationDictionary( abbreviationDictionary: &NSDictionary, - ) { - msg_send![ - Self::class(), - setAbbreviationDictionary: abbreviationDictionary - ] - } - pub unsafe fn timeZoneDataVersion() -> Id { - msg_send_id![Self::class(), timeZoneDataVersion] - } - pub unsafe fn secondsFromGMT(&self) -> NSInteger { - msg_send![self, secondsFromGMT] - } - pub unsafe fn abbreviation(&self) -> Option> { - msg_send_id![self, abbreviation] - } - pub unsafe fn isDaylightSavingTime(&self) -> bool { - msg_send![self, isDaylightSavingTime] - } - pub unsafe fn daylightSavingTimeOffset(&self) -> NSTimeInterval { - msg_send![self, daylightSavingTimeOffset] - } - pub unsafe fn nextDaylightSavingTimeTransition(&self) -> Option> { - msg_send_id![self, nextDaylightSavingTimeTransition] - } - pub unsafe fn description(&self) -> Id { - msg_send_id![self, description] - } - pub unsafe fn isEqualToTimeZone(&self, aTimeZone: &NSTimeZone) -> bool { - msg_send![self, isEqualToTimeZone: aTimeZone] - } + ); + #[method_id(timeZoneDataVersion)] + pub unsafe fn timeZoneDataVersion() -> Id; + #[method(secondsFromGMT)] + pub unsafe fn secondsFromGMT(&self) -> NSInteger; + #[method_id(abbreviation)] + pub unsafe fn abbreviation(&self) -> Option>; + #[method(isDaylightSavingTime)] + pub unsafe fn isDaylightSavingTime(&self) -> bool; + #[method(daylightSavingTimeOffset)] + pub unsafe fn daylightSavingTimeOffset(&self) -> NSTimeInterval; + #[method_id(nextDaylightSavingTimeTransition)] + pub unsafe fn nextDaylightSavingTimeTransition(&self) -> Option>; + #[method_id(description)] + pub unsafe fn description(&self) -> Id; + # [method (isEqualToTimeZone :)] + pub unsafe fn isEqualToTimeZone(&self, aTimeZone: &NSTimeZone) -> bool; + # [method_id (localizedName : locale :)] pub unsafe fn localizedName_locale( &self, style: NSTimeZoneNameStyle, locale: Option<&NSLocale>, - ) -> Option> { - msg_send_id![self, localizedName: style, locale: locale] - } + ) -> Option>; } ); extern_methods!( #[doc = "NSTimeZoneCreation"] unsafe impl NSTimeZone { - pub unsafe fn timeZoneWithName(tzName: &NSString) -> Option> { - msg_send_id![Self::class(), timeZoneWithName: tzName] - } + # [method_id (timeZoneWithName :)] + pub unsafe fn timeZoneWithName(tzName: &NSString) -> Option>; + # [method_id (timeZoneWithName : data :)] pub unsafe fn timeZoneWithName_data( tzName: &NSString, aData: Option<&NSData>, - ) -> Option> { - msg_send_id![Self::class(), timeZoneWithName: tzName, data: aData] - } - pub unsafe fn initWithName(&self, tzName: &NSString) -> Option> { - msg_send_id![self, initWithName: tzName] - } + ) -> Option>; + # [method_id (initWithName :)] + pub unsafe fn initWithName(&self, tzName: &NSString) -> Option>; + # [method_id (initWithName : data :)] pub unsafe fn initWithName_data( &self, tzName: &NSString, aData: Option<&NSData>, - ) -> Option> { - msg_send_id![self, initWithName: tzName, data: aData] - } - pub unsafe fn timeZoneForSecondsFromGMT(seconds: NSInteger) -> Id { - msg_send_id![Self::class(), timeZoneForSecondsFromGMT: seconds] - } - pub unsafe fn timeZoneWithAbbreviation( - abbreviation: &NSString, - ) -> Option> { - msg_send_id![Self::class(), timeZoneWithAbbreviation: abbreviation] - } + ) -> Option>; + # [method_id (timeZoneForSecondsFromGMT :)] + pub unsafe fn timeZoneForSecondsFromGMT(seconds: NSInteger) -> Id; + # [method_id (timeZoneWithAbbreviation :)] + pub unsafe fn timeZoneWithAbbreviation(abbreviation: &NSString) + -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSTimer.rs b/icrate/src/Foundation/generated/NSTimer.rs index 50409eab8..9bb7632a0 100644 --- a/icrate/src/Foundation/generated/NSTimer.rs +++ b/icrate/src/Foundation/generated/NSTimer.rs @@ -3,7 +3,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSTimer; @@ -13,101 +13,55 @@ extern_class!( ); extern_methods!( unsafe impl NSTimer { + # [method_id (timerWithTimeInterval : invocation : repeats :)] pub unsafe fn timerWithTimeInterval_invocation_repeats( ti: NSTimeInterval, invocation: &NSInvocation, yesOrNo: bool, - ) -> Id { - msg_send_id![ - Self::class(), - timerWithTimeInterval: ti, - invocation: invocation, - repeats: yesOrNo - ] - } + ) -> Id; + # [method_id (scheduledTimerWithTimeInterval : invocation : repeats :)] pub unsafe fn scheduledTimerWithTimeInterval_invocation_repeats( ti: NSTimeInterval, invocation: &NSInvocation, yesOrNo: bool, - ) -> Id { - msg_send_id![ - Self::class(), - scheduledTimerWithTimeInterval: ti, - invocation: invocation, - repeats: yesOrNo - ] - } + ) -> Id; + # [method_id (timerWithTimeInterval : target : selector : userInfo : repeats :)] pub unsafe fn timerWithTimeInterval_target_selector_userInfo_repeats( ti: NSTimeInterval, aTarget: &Object, aSelector: Sel, userInfo: Option<&Object>, yesOrNo: bool, - ) -> Id { - msg_send_id![ - Self::class(), - timerWithTimeInterval: ti, - target: aTarget, - selector: aSelector, - userInfo: userInfo, - repeats: yesOrNo - ] - } + ) -> Id; + # [method_id (scheduledTimerWithTimeInterval : target : selector : userInfo : repeats :)] pub unsafe fn scheduledTimerWithTimeInterval_target_selector_userInfo_repeats( ti: NSTimeInterval, aTarget: &Object, aSelector: Sel, userInfo: Option<&Object>, yesOrNo: bool, - ) -> Id { - msg_send_id![ - Self::class(), - scheduledTimerWithTimeInterval: ti, - target: aTarget, - selector: aSelector, - userInfo: userInfo, - repeats: yesOrNo - ] - } + ) -> Id; + # [method_id (timerWithTimeInterval : repeats : block :)] pub unsafe fn timerWithTimeInterval_repeats_block( interval: NSTimeInterval, repeats: bool, block: TodoBlock, - ) -> Id { - msg_send_id![ - Self::class(), - timerWithTimeInterval: interval, - repeats: repeats, - block: block - ] - } + ) -> Id; + # [method_id (scheduledTimerWithTimeInterval : repeats : block :)] pub unsafe fn scheduledTimerWithTimeInterval_repeats_block( interval: NSTimeInterval, repeats: bool, block: TodoBlock, - ) -> Id { - msg_send_id![ - Self::class(), - scheduledTimerWithTimeInterval: interval, - repeats: repeats, - block: block - ] - } + ) -> Id; + # [method_id (initWithFireDate : interval : repeats : block :)] pub unsafe fn initWithFireDate_interval_repeats_block( &self, date: &NSDate, interval: NSTimeInterval, repeats: bool, block: TodoBlock, - ) -> Id { - msg_send_id![ - self, - initWithFireDate: date, - interval: interval, - repeats: repeats, - block: block - ] - } + ) -> Id; + # [method_id (initWithFireDate : interval : target : selector : userInfo : repeats :)] pub unsafe fn initWithFireDate_interval_target_selector_userInfo_repeats( &self, date: &NSDate, @@ -116,43 +70,24 @@ extern_methods!( s: Sel, ui: Option<&Object>, rep: bool, - ) -> Id { - msg_send_id![ - self, - initWithFireDate: date, - interval: ti, - target: t, - selector: s, - userInfo: ui, - repeats: rep - ] - } - pub unsafe fn fire(&self) { - msg_send![self, fire] - } - pub unsafe fn fireDate(&self) -> Id { - msg_send_id![self, fireDate] - } - pub unsafe fn setFireDate(&self, fireDate: &NSDate) { - msg_send![self, setFireDate: fireDate] - } - pub unsafe fn timeInterval(&self) -> NSTimeInterval { - msg_send![self, timeInterval] - } - pub unsafe fn tolerance(&self) -> NSTimeInterval { - msg_send![self, tolerance] - } - pub unsafe fn setTolerance(&self, tolerance: NSTimeInterval) { - msg_send![self, setTolerance: tolerance] - } - pub unsafe fn invalidate(&self) { - msg_send![self, invalidate] - } - pub unsafe fn isValid(&self) -> bool { - msg_send![self, isValid] - } - pub unsafe fn userInfo(&self) -> Option> { - msg_send_id![self, userInfo] - } + ) -> Id; + #[method(fire)] + pub unsafe fn fire(&self); + #[method_id(fireDate)] + pub unsafe fn fireDate(&self) -> Id; + # [method (setFireDate :)] + pub unsafe fn setFireDate(&self, fireDate: &NSDate); + #[method(timeInterval)] + pub unsafe fn timeInterval(&self) -> NSTimeInterval; + #[method(tolerance)] + pub unsafe fn tolerance(&self) -> NSTimeInterval; + # [method (setTolerance :)] + pub unsafe fn setTolerance(&self, tolerance: NSTimeInterval); + #[method(invalidate)] + pub unsafe fn invalidate(&self); + #[method(isValid)] + pub unsafe fn isValid(&self) -> bool; + #[method_id(userInfo)] + pub unsafe fn userInfo(&self) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSURL.rs b/icrate/src/Foundation/generated/NSURL.rs index a1a6a98e1..fa00b09ca 100644 --- a/icrate/src/Foundation/generated/NSURL.rs +++ b/icrate/src/Foundation/generated/NSURL.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSURLHandle::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSURLResourceKey = NSString; pub type NSURLFileResourceType = NSString; pub type NSURLThumbnailDictionaryItem = NSString; @@ -28,409 +28,256 @@ extern_class!( ); extern_methods!( unsafe impl NSURL { + # [method_id (initWithScheme : host : path :)] pub unsafe fn initWithScheme_host_path( &self, scheme: &NSString, host: Option<&NSString>, path: &NSString, - ) -> Option> { - msg_send_id![self, initWithScheme: scheme, host: host, path: path] - } + ) -> Option>; + # [method_id (initFileURLWithPath : isDirectory : relativeToURL :)] pub unsafe fn initFileURLWithPath_isDirectory_relativeToURL( &self, path: &NSString, isDir: bool, baseURL: Option<&NSURL>, - ) -> Id { - msg_send_id![ - self, - initFileURLWithPath: path, - isDirectory: isDir, - relativeToURL: baseURL - ] - } + ) -> Id; + # [method_id (initFileURLWithPath : relativeToURL :)] pub unsafe fn initFileURLWithPath_relativeToURL( &self, path: &NSString, baseURL: Option<&NSURL>, - ) -> Id { - msg_send_id![self, initFileURLWithPath: path, relativeToURL: baseURL] - } + ) -> Id; + # [method_id (initFileURLWithPath : isDirectory :)] pub unsafe fn initFileURLWithPath_isDirectory( &self, path: &NSString, isDir: bool, - ) -> Id { - msg_send_id![self, initFileURLWithPath: path, isDirectory: isDir] - } - pub unsafe fn initFileURLWithPath(&self, path: &NSString) -> Id { - msg_send_id![self, initFileURLWithPath: path] - } + ) -> Id; + # [method_id (initFileURLWithPath :)] + pub unsafe fn initFileURLWithPath(&self, path: &NSString) -> Id; + # [method_id (fileURLWithPath : isDirectory : relativeToURL :)] pub unsafe fn fileURLWithPath_isDirectory_relativeToURL( path: &NSString, isDir: bool, baseURL: Option<&NSURL>, - ) -> Id { - msg_send_id![ - Self::class(), - fileURLWithPath: path, - isDirectory: isDir, - relativeToURL: baseURL - ] - } + ) -> Id; + # [method_id (fileURLWithPath : relativeToURL :)] pub unsafe fn fileURLWithPath_relativeToURL( path: &NSString, baseURL: Option<&NSURL>, - ) -> Id { - msg_send_id![Self::class(), fileURLWithPath: path, relativeToURL: baseURL] - } + ) -> Id; + # [method_id (fileURLWithPath : isDirectory :)] pub unsafe fn fileURLWithPath_isDirectory( path: &NSString, isDir: bool, - ) -> Id { - msg_send_id![Self::class(), fileURLWithPath: path, isDirectory: isDir] - } - pub unsafe fn fileURLWithPath(path: &NSString) -> Id { - msg_send_id![Self::class(), fileURLWithPath: path] - } + ) -> Id; + # [method_id (fileURLWithPath :)] + pub unsafe fn fileURLWithPath(path: &NSString) -> Id; + # [method_id (initFileURLWithFileSystemRepresentation : isDirectory : relativeToURL :)] pub unsafe fn initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL( &self, path: NonNull, isDir: bool, baseURL: Option<&NSURL>, - ) -> Id { - msg_send_id![ - self, - initFileURLWithFileSystemRepresentation: path, - isDirectory: isDir, - relativeToURL: baseURL - ] - } + ) -> Id; + # [method_id (fileURLWithFileSystemRepresentation : isDirectory : relativeToURL :)] pub unsafe fn fileURLWithFileSystemRepresentation_isDirectory_relativeToURL( path: NonNull, isDir: bool, baseURL: Option<&NSURL>, - ) -> Id { - msg_send_id![ - Self::class(), - fileURLWithFileSystemRepresentation: path, - isDirectory: isDir, - relativeToURL: baseURL - ] - } - pub unsafe fn initWithString(&self, URLString: &NSString) -> Option> { - msg_send_id![self, initWithString: URLString] - } + ) -> Id; + # [method_id (initWithString :)] + pub unsafe fn initWithString(&self, URLString: &NSString) -> Option>; + # [method_id (initWithString : relativeToURL :)] pub unsafe fn initWithString_relativeToURL( &self, URLString: &NSString, baseURL: Option<&NSURL>, - ) -> Option> { - msg_send_id![self, initWithString: URLString, relativeToURL: baseURL] - } - pub unsafe fn URLWithString(URLString: &NSString) -> Option> { - msg_send_id![Self::class(), URLWithString: URLString] - } + ) -> Option>; + # [method_id (URLWithString :)] + pub unsafe fn URLWithString(URLString: &NSString) -> Option>; + # [method_id (URLWithString : relativeToURL :)] pub unsafe fn URLWithString_relativeToURL( URLString: &NSString, baseURL: Option<&NSURL>, - ) -> Option> { - msg_send_id![ - Self::class(), - URLWithString: URLString, - relativeToURL: baseURL - ] - } + ) -> Option>; + # [method_id (initWithDataRepresentation : relativeToURL :)] pub unsafe fn initWithDataRepresentation_relativeToURL( &self, data: &NSData, baseURL: Option<&NSURL>, - ) -> Id { - msg_send_id![ - self, - initWithDataRepresentation: data, - relativeToURL: baseURL - ] - } + ) -> Id; + # [method_id (URLWithDataRepresentation : relativeToURL :)] pub unsafe fn URLWithDataRepresentation_relativeToURL( data: &NSData, baseURL: Option<&NSURL>, - ) -> Id { - msg_send_id![ - Self::class(), - URLWithDataRepresentation: data, - relativeToURL: baseURL - ] - } + ) -> Id; + # [method_id (initAbsoluteURLWithDataRepresentation : relativeToURL :)] pub unsafe fn initAbsoluteURLWithDataRepresentation_relativeToURL( &self, data: &NSData, baseURL: Option<&NSURL>, - ) -> Id { - msg_send_id![ - self, - initAbsoluteURLWithDataRepresentation: data, - relativeToURL: baseURL - ] - } + ) -> Id; + # [method_id (absoluteURLWithDataRepresentation : relativeToURL :)] pub unsafe fn absoluteURLWithDataRepresentation_relativeToURL( data: &NSData, baseURL: Option<&NSURL>, - ) -> Id { - msg_send_id![ - Self::class(), - absoluteURLWithDataRepresentation: data, - relativeToURL: baseURL - ] - } - pub unsafe fn dataRepresentation(&self) -> Id { - msg_send_id![self, dataRepresentation] - } - pub unsafe fn absoluteString(&self) -> Option> { - msg_send_id![self, absoluteString] - } - pub unsafe fn relativeString(&self) -> Id { - msg_send_id![self, relativeString] - } - pub unsafe fn baseURL(&self) -> Option> { - msg_send_id![self, baseURL] - } - pub unsafe fn absoluteURL(&self) -> Option> { - msg_send_id![self, absoluteURL] - } - pub unsafe fn scheme(&self) -> Option> { - msg_send_id![self, scheme] - } - pub unsafe fn resourceSpecifier(&self) -> Option> { - msg_send_id![self, resourceSpecifier] - } - pub unsafe fn host(&self) -> Option> { - msg_send_id![self, host] - } - pub unsafe fn port(&self) -> Option> { - msg_send_id![self, port] - } - pub unsafe fn user(&self) -> Option> { - msg_send_id![self, user] - } - pub unsafe fn password(&self) -> Option> { - msg_send_id![self, password] - } - pub unsafe fn path(&self) -> Option> { - msg_send_id![self, path] - } - pub unsafe fn fragment(&self) -> Option> { - msg_send_id![self, fragment] - } - pub unsafe fn parameterString(&self) -> Option> { - msg_send_id![self, parameterString] - } - pub unsafe fn query(&self) -> Option> { - msg_send_id![self, query] - } - pub unsafe fn relativePath(&self) -> Option> { - msg_send_id![self, relativePath] - } - pub unsafe fn hasDirectoryPath(&self) -> bool { - msg_send![self, hasDirectoryPath] - } + ) -> Id; + #[method_id(dataRepresentation)] + pub unsafe fn dataRepresentation(&self) -> Id; + #[method_id(absoluteString)] + pub unsafe fn absoluteString(&self) -> Option>; + #[method_id(relativeString)] + pub unsafe fn relativeString(&self) -> Id; + #[method_id(baseURL)] + pub unsafe fn baseURL(&self) -> Option>; + #[method_id(absoluteURL)] + pub unsafe fn absoluteURL(&self) -> Option>; + #[method_id(scheme)] + pub unsafe fn scheme(&self) -> Option>; + #[method_id(resourceSpecifier)] + pub unsafe fn resourceSpecifier(&self) -> Option>; + #[method_id(host)] + pub unsafe fn host(&self) -> Option>; + #[method_id(port)] + pub unsafe fn port(&self) -> Option>; + #[method_id(user)] + pub unsafe fn user(&self) -> Option>; + #[method_id(password)] + pub unsafe fn password(&self) -> Option>; + #[method_id(path)] + pub unsafe fn path(&self) -> Option>; + #[method_id(fragment)] + pub unsafe fn fragment(&self) -> Option>; + #[method_id(parameterString)] + pub unsafe fn parameterString(&self) -> Option>; + #[method_id(query)] + pub unsafe fn query(&self) -> Option>; + #[method_id(relativePath)] + pub unsafe fn relativePath(&self) -> Option>; + #[method(hasDirectoryPath)] + pub unsafe fn hasDirectoryPath(&self) -> bool; + # [method (getFileSystemRepresentation : maxLength :)] pub unsafe fn getFileSystemRepresentation_maxLength( &self, buffer: NonNull, maxBufferLength: NSUInteger, - ) -> bool { - msg_send![ - self, - getFileSystemRepresentation: buffer, - maxLength: maxBufferLength - ] - } - pub unsafe fn fileSystemRepresentation(&self) -> NonNull { - msg_send![self, fileSystemRepresentation] - } - pub unsafe fn isFileURL(&self) -> bool { - msg_send![self, isFileURL] - } - pub unsafe fn standardizedURL(&self) -> Option> { - msg_send_id![self, standardizedURL] - } + ) -> bool; + #[method(fileSystemRepresentation)] + pub unsafe fn fileSystemRepresentation(&self) -> NonNull; + #[method(isFileURL)] + pub unsafe fn isFileURL(&self) -> bool; + #[method_id(standardizedURL)] + pub unsafe fn standardizedURL(&self) -> Option>; + # [method (checkResourceIsReachableAndReturnError :)] pub unsafe fn checkResourceIsReachableAndReturnError( &self, - ) -> Result<(), Id> { - msg_send![self, checkResourceIsReachableAndReturnError: _] - } - pub unsafe fn isFileReferenceURL(&self) -> bool { - msg_send![self, isFileReferenceURL] - } - pub unsafe fn fileReferenceURL(&self) -> Option> { - msg_send_id![self, fileReferenceURL] - } - pub unsafe fn filePathURL(&self) -> Option> { - msg_send_id![self, filePathURL] - } + ) -> Result<(), Id>; + #[method(isFileReferenceURL)] + pub unsafe fn isFileReferenceURL(&self) -> bool; + #[method_id(fileReferenceURL)] + pub unsafe fn fileReferenceURL(&self) -> Option>; + #[method_id(filePathURL)] + pub unsafe fn filePathURL(&self) -> Option>; + # [method (getResourceValue : forKey : error :)] pub unsafe fn getResourceValue_forKey_error( &self, value: &mut Option>, key: &NSURLResourceKey, - ) -> Result<(), Id> { - msg_send![self, getResourceValue: value, forKey: key, error: _] - } + ) -> Result<(), Id>; + # [method_id (resourceValuesForKeys : error :)] pub unsafe fn resourceValuesForKeys_error( &self, keys: &NSArray, - ) -> Result, Shared>, Id> - { - msg_send_id![self, resourceValuesForKeys: keys, error: _] - } + ) -> Result, Shared>, Id>; + # [method (setResourceValue : forKey : error :)] pub unsafe fn setResourceValue_forKey_error( &self, value: Option<&Object>, key: &NSURLResourceKey, - ) -> Result<(), Id> { - msg_send![self, setResourceValue: value, forKey: key, error: _] - } + ) -> Result<(), Id>; + # [method (setResourceValues : error :)] pub unsafe fn setResourceValues_error( &self, keyedValues: &NSDictionary, - ) -> Result<(), Id> { - msg_send![self, setResourceValues: keyedValues, error: _] - } - pub unsafe fn removeCachedResourceValueForKey(&self, key: &NSURLResourceKey) { - msg_send![self, removeCachedResourceValueForKey: key] - } - pub unsafe fn removeAllCachedResourceValues(&self) { - msg_send![self, removeAllCachedResourceValues] - } + ) -> Result<(), Id>; + # [method (removeCachedResourceValueForKey :)] + pub unsafe fn removeCachedResourceValueForKey(&self, key: &NSURLResourceKey); + #[method(removeAllCachedResourceValues)] + pub unsafe fn removeAllCachedResourceValues(&self); + # [method (setTemporaryResourceValue : forKey :)] pub unsafe fn setTemporaryResourceValue_forKey( &self, value: Option<&Object>, key: &NSURLResourceKey, - ) { - msg_send![self, setTemporaryResourceValue: value, forKey: key] - } + ); + # [method_id (bookmarkDataWithOptions : includingResourceValuesForKeys : relativeToURL : error :)] pub unsafe fn bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error( &self, options: NSURLBookmarkCreationOptions, keys: Option<&NSArray>, relativeURL: Option<&NSURL>, - ) -> Result, Id> { - msg_send_id![ - self, - bookmarkDataWithOptions: options, - includingResourceValuesForKeys: keys, - relativeToURL: relativeURL, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (initByResolvingBookmarkData : options : relativeToURL : bookmarkDataIsStale : error :)] pub unsafe fn initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error( &self, bookmarkData: &NSData, options: NSURLBookmarkResolutionOptions, relativeURL: Option<&NSURL>, isStale: *mut bool, - ) -> Result, Id> { - msg_send_id![ - self, - initByResolvingBookmarkData: bookmarkData, - options: options, - relativeToURL: relativeURL, - bookmarkDataIsStale: isStale, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (URLByResolvingBookmarkData : options : relativeToURL : bookmarkDataIsStale : error :)] pub unsafe fn URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error( bookmarkData: &NSData, options: NSURLBookmarkResolutionOptions, relativeURL: Option<&NSURL>, isStale: *mut bool, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - URLByResolvingBookmarkData: bookmarkData, - options: options, - relativeToURL: relativeURL, - bookmarkDataIsStale: isStale, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (resourceValuesForKeys : fromBookmarkData :)] pub unsafe fn resourceValuesForKeys_fromBookmarkData( keys: &NSArray, bookmarkData: &NSData, - ) -> Option, Shared>> { - msg_send_id![ - Self::class(), - resourceValuesForKeys: keys, - fromBookmarkData: bookmarkData - ] - } + ) -> Option, Shared>>; + # [method (writeBookmarkData : toURL : options : error :)] pub unsafe fn writeBookmarkData_toURL_options_error( bookmarkData: &NSData, bookmarkFileURL: &NSURL, options: NSURLBookmarkFileCreationOptions, - ) -> Result<(), Id> { - msg_send![ - Self::class(), - writeBookmarkData: bookmarkData, - toURL: bookmarkFileURL, - options: options, - error: _ - ] - } + ) -> Result<(), Id>; + # [method_id (bookmarkDataWithContentsOfURL : error :)] pub unsafe fn bookmarkDataWithContentsOfURL_error( bookmarkFileURL: &NSURL, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - bookmarkDataWithContentsOfURL: bookmarkFileURL, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (URLByResolvingAliasFileAtURL : options : error :)] pub unsafe fn URLByResolvingAliasFileAtURL_options_error( url: &NSURL, options: NSURLBookmarkResolutionOptions, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - URLByResolvingAliasFileAtURL: url, - options: options, - error: _ - ] - } - pub unsafe fn startAccessingSecurityScopedResource(&self) -> bool { - msg_send![self, startAccessingSecurityScopedResource] - } - pub unsafe fn stopAccessingSecurityScopedResource(&self) { - msg_send![self, stopAccessingSecurityScopedResource] - } + ) -> Result, Id>; + #[method(startAccessingSecurityScopedResource)] + pub unsafe fn startAccessingSecurityScopedResource(&self) -> bool; + #[method(stopAccessingSecurityScopedResource)] + pub unsafe fn stopAccessingSecurityScopedResource(&self); } ); extern_methods!( #[doc = "NSPromisedItems"] unsafe impl NSURL { + # [method (getPromisedItemResourceValue : forKey : error :)] pub unsafe fn getPromisedItemResourceValue_forKey_error( &self, value: &mut Option>, key: &NSURLResourceKey, - ) -> Result<(), Id> { - msg_send![ - self, - getPromisedItemResourceValue: value, - forKey: key, - error: _ - ] - } + ) -> Result<(), Id>; + # [method_id (promisedItemResourceValuesForKeys : error :)] pub unsafe fn promisedItemResourceValuesForKeys_error( &self, keys: &NSArray, - ) -> Result, Shared>, Id> - { - msg_send_id![self, promisedItemResourceValuesForKeys: keys, error: _] - } + ) -> Result, Shared>, Id>; + # [method (checkPromisedItemIsReachableAndReturnError :)] pub unsafe fn checkPromisedItemIsReachableAndReturnError( &self, - ) -> Result<(), Id> { - msg_send![self, checkPromisedItemIsReachableAndReturnError: _] - } + ) -> Result<(), Id>; } ); extern_methods!( @@ -446,25 +293,21 @@ extern_class!( ); extern_methods!( unsafe impl NSURLQueryItem { + # [method_id (initWithName : value :)] pub unsafe fn initWithName_value( &self, name: &NSString, value: Option<&NSString>, - ) -> Id { - msg_send_id![self, initWithName: name, value: value] - } + ) -> Id; + # [method_id (queryItemWithName : value :)] pub unsafe fn queryItemWithName_value( name: &NSString, value: Option<&NSString>, - ) -> Id { - msg_send_id![Self::class(), queryItemWithName: name, value: value] - } - pub unsafe fn name(&self) -> Id { - msg_send_id![self, name] - } - pub unsafe fn value(&self) -> Option> { - msg_send_id![self, value] - } + ) -> Id; + #[method_id(name)] + pub unsafe fn name(&self) -> Id; + #[method_id(value)] + pub unsafe fn value(&self) -> Option>; } ); extern_class!( @@ -476,275 +319,193 @@ extern_class!( ); extern_methods!( unsafe impl NSURLComponents { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithURL : resolvingAgainstBaseURL :)] pub unsafe fn initWithURL_resolvingAgainstBaseURL( &self, url: &NSURL, resolve: bool, - ) -> Option> { - msg_send_id![self, initWithURL: url, resolvingAgainstBaseURL: resolve] - } + ) -> Option>; + # [method_id (componentsWithURL : resolvingAgainstBaseURL :)] pub unsafe fn componentsWithURL_resolvingAgainstBaseURL( url: &NSURL, resolve: bool, - ) -> Option> { - msg_send_id![ - Self::class(), - componentsWithURL: url, - resolvingAgainstBaseURL: resolve - ] - } - pub unsafe fn initWithString(&self, URLString: &NSString) -> Option> { - msg_send_id![self, initWithString: URLString] - } - pub unsafe fn componentsWithString(URLString: &NSString) -> Option> { - msg_send_id![Self::class(), componentsWithString: URLString] - } - pub unsafe fn URL(&self) -> Option> { - msg_send_id![self, URL] - } - pub unsafe fn URLRelativeToURL( - &self, - baseURL: Option<&NSURL>, - ) -> Option> { - msg_send_id![self, URLRelativeToURL: baseURL] - } - pub unsafe fn string(&self) -> Option> { - msg_send_id![self, string] - } - pub unsafe fn scheme(&self) -> Option> { - msg_send_id![self, scheme] - } - pub unsafe fn setScheme(&self, scheme: Option<&NSString>) { - msg_send![self, setScheme: scheme] - } - pub unsafe fn user(&self) -> Option> { - msg_send_id![self, user] - } - pub unsafe fn setUser(&self, user: Option<&NSString>) { - msg_send![self, setUser: user] - } - pub unsafe fn password(&self) -> Option> { - msg_send_id![self, password] - } - pub unsafe fn setPassword(&self, password: Option<&NSString>) { - msg_send![self, setPassword: password] - } - pub unsafe fn host(&self) -> Option> { - msg_send_id![self, host] - } - pub unsafe fn setHost(&self, host: Option<&NSString>) { - msg_send![self, setHost: host] - } - pub unsafe fn port(&self) -> Option> { - msg_send_id![self, port] - } - pub unsafe fn setPort(&self, port: Option<&NSNumber>) { - msg_send![self, setPort: port] - } - pub unsafe fn path(&self) -> Option> { - msg_send_id![self, path] - } - pub unsafe fn setPath(&self, path: Option<&NSString>) { - msg_send![self, setPath: path] - } - pub unsafe fn query(&self) -> Option> { - msg_send_id![self, query] - } - pub unsafe fn setQuery(&self, query: Option<&NSString>) { - msg_send![self, setQuery: query] - } - pub unsafe fn fragment(&self) -> Option> { - msg_send_id![self, fragment] - } - pub unsafe fn setFragment(&self, fragment: Option<&NSString>) { - msg_send![self, setFragment: fragment] - } - pub unsafe fn percentEncodedUser(&self) -> Option> { - msg_send_id![self, percentEncodedUser] - } - pub unsafe fn setPercentEncodedUser(&self, percentEncodedUser: Option<&NSString>) { - msg_send![self, setPercentEncodedUser: percentEncodedUser] - } - pub unsafe fn percentEncodedPassword(&self) -> Option> { - msg_send_id![self, percentEncodedPassword] - } - pub unsafe fn setPercentEncodedPassword(&self, percentEncodedPassword: Option<&NSString>) { - msg_send![self, setPercentEncodedPassword: percentEncodedPassword] - } - pub unsafe fn percentEncodedHost(&self) -> Option> { - msg_send_id![self, percentEncodedHost] - } - pub unsafe fn setPercentEncodedHost(&self, percentEncodedHost: Option<&NSString>) { - msg_send![self, setPercentEncodedHost: percentEncodedHost] - } - pub unsafe fn percentEncodedPath(&self) -> Option> { - msg_send_id![self, percentEncodedPath] - } - pub unsafe fn setPercentEncodedPath(&self, percentEncodedPath: Option<&NSString>) { - msg_send![self, setPercentEncodedPath: percentEncodedPath] - } - pub unsafe fn percentEncodedQuery(&self) -> Option> { - msg_send_id![self, percentEncodedQuery] - } - pub unsafe fn setPercentEncodedQuery(&self, percentEncodedQuery: Option<&NSString>) { - msg_send![self, setPercentEncodedQuery: percentEncodedQuery] - } - pub unsafe fn percentEncodedFragment(&self) -> Option> { - msg_send_id![self, percentEncodedFragment] - } - pub unsafe fn setPercentEncodedFragment(&self, percentEncodedFragment: Option<&NSString>) { - msg_send![self, setPercentEncodedFragment: percentEncodedFragment] - } - pub unsafe fn rangeOfScheme(&self) -> NSRange { - msg_send![self, rangeOfScheme] - } - pub unsafe fn rangeOfUser(&self) -> NSRange { - msg_send![self, rangeOfUser] - } - pub unsafe fn rangeOfPassword(&self) -> NSRange { - msg_send![self, rangeOfPassword] - } - pub unsafe fn rangeOfHost(&self) -> NSRange { - msg_send![self, rangeOfHost] - } - pub unsafe fn rangeOfPort(&self) -> NSRange { - msg_send![self, rangeOfPort] - } - pub unsafe fn rangeOfPath(&self) -> NSRange { - msg_send![self, rangeOfPath] - } - pub unsafe fn rangeOfQuery(&self) -> NSRange { - msg_send![self, rangeOfQuery] - } - pub unsafe fn rangeOfFragment(&self) -> NSRange { - msg_send![self, rangeOfFragment] - } - pub unsafe fn queryItems(&self) -> Option, Shared>> { - msg_send_id![self, queryItems] - } - pub unsafe fn setQueryItems(&self, queryItems: Option<&NSArray>) { - msg_send![self, setQueryItems: queryItems] - } + ) -> Option>; + # [method_id (initWithString :)] + pub unsafe fn initWithString(&self, URLString: &NSString) -> Option>; + # [method_id (componentsWithString :)] + pub unsafe fn componentsWithString(URLString: &NSString) -> Option>; + #[method_id(URL)] + pub unsafe fn URL(&self) -> Option>; + # [method_id (URLRelativeToURL :)] + pub unsafe fn URLRelativeToURL(&self, baseURL: Option<&NSURL>) + -> Option>; + #[method_id(string)] + pub unsafe fn string(&self) -> Option>; + #[method_id(scheme)] + pub unsafe fn scheme(&self) -> Option>; + # [method (setScheme :)] + pub unsafe fn setScheme(&self, scheme: Option<&NSString>); + #[method_id(user)] + pub unsafe fn user(&self) -> Option>; + # [method (setUser :)] + pub unsafe fn setUser(&self, user: Option<&NSString>); + #[method_id(password)] + pub unsafe fn password(&self) -> Option>; + # [method (setPassword :)] + pub unsafe fn setPassword(&self, password: Option<&NSString>); + #[method_id(host)] + pub unsafe fn host(&self) -> Option>; + # [method (setHost :)] + pub unsafe fn setHost(&self, host: Option<&NSString>); + #[method_id(port)] + pub unsafe fn port(&self) -> Option>; + # [method (setPort :)] + pub unsafe fn setPort(&self, port: Option<&NSNumber>); + #[method_id(path)] + pub unsafe fn path(&self) -> Option>; + # [method (setPath :)] + pub unsafe fn setPath(&self, path: Option<&NSString>); + #[method_id(query)] + pub unsafe fn query(&self) -> Option>; + # [method (setQuery :)] + pub unsafe fn setQuery(&self, query: Option<&NSString>); + #[method_id(fragment)] + pub unsafe fn fragment(&self) -> Option>; + # [method (setFragment :)] + pub unsafe fn setFragment(&self, fragment: Option<&NSString>); + #[method_id(percentEncodedUser)] + pub unsafe fn percentEncodedUser(&self) -> Option>; + # [method (setPercentEncodedUser :)] + pub unsafe fn setPercentEncodedUser(&self, percentEncodedUser: Option<&NSString>); + #[method_id(percentEncodedPassword)] + pub unsafe fn percentEncodedPassword(&self) -> Option>; + # [method (setPercentEncodedPassword :)] + pub unsafe fn setPercentEncodedPassword(&self, percentEncodedPassword: Option<&NSString>); + #[method_id(percentEncodedHost)] + pub unsafe fn percentEncodedHost(&self) -> Option>; + # [method (setPercentEncodedHost :)] + pub unsafe fn setPercentEncodedHost(&self, percentEncodedHost: Option<&NSString>); + #[method_id(percentEncodedPath)] + pub unsafe fn percentEncodedPath(&self) -> Option>; + # [method (setPercentEncodedPath :)] + pub unsafe fn setPercentEncodedPath(&self, percentEncodedPath: Option<&NSString>); + #[method_id(percentEncodedQuery)] + pub unsafe fn percentEncodedQuery(&self) -> Option>; + # [method (setPercentEncodedQuery :)] + pub unsafe fn setPercentEncodedQuery(&self, percentEncodedQuery: Option<&NSString>); + #[method_id(percentEncodedFragment)] + pub unsafe fn percentEncodedFragment(&self) -> Option>; + # [method (setPercentEncodedFragment :)] + pub unsafe fn setPercentEncodedFragment(&self, percentEncodedFragment: Option<&NSString>); + #[method(rangeOfScheme)] + pub unsafe fn rangeOfScheme(&self) -> NSRange; + #[method(rangeOfUser)] + pub unsafe fn rangeOfUser(&self) -> NSRange; + #[method(rangeOfPassword)] + pub unsafe fn rangeOfPassword(&self) -> NSRange; + #[method(rangeOfHost)] + pub unsafe fn rangeOfHost(&self) -> NSRange; + #[method(rangeOfPort)] + pub unsafe fn rangeOfPort(&self) -> NSRange; + #[method(rangeOfPath)] + pub unsafe fn rangeOfPath(&self) -> NSRange; + #[method(rangeOfQuery)] + pub unsafe fn rangeOfQuery(&self) -> NSRange; + #[method(rangeOfFragment)] + pub unsafe fn rangeOfFragment(&self) -> NSRange; + #[method_id(queryItems)] + pub unsafe fn queryItems(&self) -> Option, Shared>>; + # [method (setQueryItems :)] + pub unsafe fn setQueryItems(&self, queryItems: Option<&NSArray>); + #[method_id(percentEncodedQueryItems)] pub unsafe fn percentEncodedQueryItems( &self, - ) -> Option, Shared>> { - msg_send_id![self, percentEncodedQueryItems] - } + ) -> Option, Shared>>; + # [method (setPercentEncodedQueryItems :)] pub unsafe fn setPercentEncodedQueryItems( &self, percentEncodedQueryItems: Option<&NSArray>, - ) { - msg_send![self, setPercentEncodedQueryItems: percentEncodedQueryItems] - } + ); } ); extern_methods!( #[doc = "NSURLUtilities"] unsafe impl NSCharacterSet { - pub unsafe fn URLUserAllowedCharacterSet() -> Id { - msg_send_id![Self::class(), URLUserAllowedCharacterSet] - } - pub unsafe fn URLPasswordAllowedCharacterSet() -> Id { - msg_send_id![Self::class(), URLPasswordAllowedCharacterSet] - } - pub unsafe fn URLHostAllowedCharacterSet() -> Id { - msg_send_id![Self::class(), URLHostAllowedCharacterSet] - } - pub unsafe fn URLPathAllowedCharacterSet() -> Id { - msg_send_id![Self::class(), URLPathAllowedCharacterSet] - } - pub unsafe fn URLQueryAllowedCharacterSet() -> Id { - msg_send_id![Self::class(), URLQueryAllowedCharacterSet] - } - pub unsafe fn URLFragmentAllowedCharacterSet() -> Id { - msg_send_id![Self::class(), URLFragmentAllowedCharacterSet] - } + #[method_id(URLUserAllowedCharacterSet)] + pub unsafe fn URLUserAllowedCharacterSet() -> Id; + #[method_id(URLPasswordAllowedCharacterSet)] + pub unsafe fn URLPasswordAllowedCharacterSet() -> Id; + #[method_id(URLHostAllowedCharacterSet)] + pub unsafe fn URLHostAllowedCharacterSet() -> Id; + #[method_id(URLPathAllowedCharacterSet)] + pub unsafe fn URLPathAllowedCharacterSet() -> Id; + #[method_id(URLQueryAllowedCharacterSet)] + pub unsafe fn URLQueryAllowedCharacterSet() -> Id; + #[method_id(URLFragmentAllowedCharacterSet)] + pub unsafe fn URLFragmentAllowedCharacterSet() -> Id; } ); extern_methods!( #[doc = "NSURLUtilities"] unsafe impl NSString { + # [method_id (stringByAddingPercentEncodingWithAllowedCharacters :)] pub unsafe fn stringByAddingPercentEncodingWithAllowedCharacters( &self, allowedCharacters: &NSCharacterSet, - ) -> Option> { - msg_send_id![ - self, - stringByAddingPercentEncodingWithAllowedCharacters: allowedCharacters - ] - } - pub unsafe fn stringByRemovingPercentEncoding(&self) -> Option> { - msg_send_id![self, stringByRemovingPercentEncoding] - } + ) -> Option>; + #[method_id(stringByRemovingPercentEncoding)] + pub unsafe fn stringByRemovingPercentEncoding(&self) -> Option>; + # [method_id (stringByAddingPercentEscapesUsingEncoding :)] pub unsafe fn stringByAddingPercentEscapesUsingEncoding( &self, enc: NSStringEncoding, - ) -> Option> { - msg_send_id![self, stringByAddingPercentEscapesUsingEncoding: enc] - } + ) -> Option>; + # [method_id (stringByReplacingPercentEscapesUsingEncoding :)] pub unsafe fn stringByReplacingPercentEscapesUsingEncoding( &self, enc: NSStringEncoding, - ) -> Option> { - msg_send_id![self, stringByReplacingPercentEscapesUsingEncoding: enc] - } + ) -> Option>; } ); extern_methods!( #[doc = "NSURLPathUtilities"] unsafe impl NSURL { + # [method_id (fileURLWithPathComponents :)] pub unsafe fn fileURLWithPathComponents( components: &NSArray, - ) -> Option> { - msg_send_id![Self::class(), fileURLWithPathComponents: components] - } - pub unsafe fn pathComponents(&self) -> Option, Shared>> { - msg_send_id![self, pathComponents] - } - pub unsafe fn lastPathComponent(&self) -> Option> { - msg_send_id![self, lastPathComponent] - } - pub unsafe fn pathExtension(&self) -> Option> { - msg_send_id![self, pathExtension] - } + ) -> Option>; + #[method_id(pathComponents)] + pub unsafe fn pathComponents(&self) -> Option, Shared>>; + #[method_id(lastPathComponent)] + pub unsafe fn lastPathComponent(&self) -> Option>; + #[method_id(pathExtension)] + pub unsafe fn pathExtension(&self) -> Option>; + # [method_id (URLByAppendingPathComponent :)] pub unsafe fn URLByAppendingPathComponent( &self, pathComponent: &NSString, - ) -> Option> { - msg_send_id![self, URLByAppendingPathComponent: pathComponent] - } + ) -> Option>; + # [method_id (URLByAppendingPathComponent : isDirectory :)] pub unsafe fn URLByAppendingPathComponent_isDirectory( &self, pathComponent: &NSString, isDirectory: bool, - ) -> Option> { - msg_send_id![ - self, - URLByAppendingPathComponent: pathComponent, - isDirectory: isDirectory - ] - } - pub unsafe fn URLByDeletingLastPathComponent(&self) -> Option> { - msg_send_id![self, URLByDeletingLastPathComponent] - } + ) -> Option>; + #[method_id(URLByDeletingLastPathComponent)] + pub unsafe fn URLByDeletingLastPathComponent(&self) -> Option>; + # [method_id (URLByAppendingPathExtension :)] pub unsafe fn URLByAppendingPathExtension( &self, pathExtension: &NSString, - ) -> Option> { - msg_send_id![self, URLByAppendingPathExtension: pathExtension] - } - pub unsafe fn URLByDeletingPathExtension(&self) -> Option> { - msg_send_id![self, URLByDeletingPathExtension] - } - pub unsafe fn URLByStandardizingPath(&self) -> Option> { - msg_send_id![self, URLByStandardizingPath] - } - pub unsafe fn URLByResolvingSymlinksInPath(&self) -> Option> { - msg_send_id![self, URLByResolvingSymlinksInPath] - } + ) -> Option>; + #[method_id(URLByDeletingPathExtension)] + pub unsafe fn URLByDeletingPathExtension(&self) -> Option>; + #[method_id(URLByStandardizingPath)] + pub unsafe fn URLByStandardizingPath(&self) -> Option>; + #[method_id(URLByResolvingSymlinksInPath)] + pub unsafe fn URLByResolvingSymlinksInPath(&self) -> Option>; } ); extern_class!( @@ -756,66 +517,51 @@ extern_class!( ); extern_methods!( unsafe impl NSFileSecurity { - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSURLClient"] unsafe impl NSObject { - pub unsafe fn URL_resourceDataDidBecomeAvailable(&self, sender: &NSURL, newBytes: &NSData) { - msg_send![self, URL: sender, resourceDataDidBecomeAvailable: newBytes] - } - pub unsafe fn URLResourceDidFinishLoading(&self, sender: &NSURL) { - msg_send![self, URLResourceDidFinishLoading: sender] - } - pub unsafe fn URLResourceDidCancelLoading(&self, sender: &NSURL) { - msg_send![self, URLResourceDidCancelLoading: sender] - } + # [method (URL : resourceDataDidBecomeAvailable :)] + pub unsafe fn URL_resourceDataDidBecomeAvailable(&self, sender: &NSURL, newBytes: &NSData); + # [method (URLResourceDidFinishLoading :)] + pub unsafe fn URLResourceDidFinishLoading(&self, sender: &NSURL); + # [method (URLResourceDidCancelLoading :)] + pub unsafe fn URLResourceDidCancelLoading(&self, sender: &NSURL); + # [method (URL : resourceDidFailLoadingWithReason :)] pub unsafe fn URL_resourceDidFailLoadingWithReason( &self, sender: &NSURL, reason: &NSString, - ) { - msg_send![self, URL: sender, resourceDidFailLoadingWithReason: reason] - } + ); } ); extern_methods!( #[doc = "NSURLLoading"] unsafe impl NSURL { + # [method_id (resourceDataUsingCache :)] pub unsafe fn resourceDataUsingCache( &self, shouldUseCache: bool, - ) -> Option> { - msg_send_id![self, resourceDataUsingCache: shouldUseCache] - } + ) -> Option>; + # [method (loadResourceDataNotifyingClient : usingCache :)] pub unsafe fn loadResourceDataNotifyingClient_usingCache( &self, client: &Object, shouldUseCache: bool, - ) { - msg_send![ - self, - loadResourceDataNotifyingClient: client, - usingCache: shouldUseCache - ] - } - pub unsafe fn propertyForKey(&self, propertyKey: &NSString) -> Option> { - msg_send_id![self, propertyForKey: propertyKey] - } - pub unsafe fn setResourceData(&self, data: &NSData) -> bool { - msg_send![self, setResourceData: data] - } - pub unsafe fn setProperty_forKey(&self, property: &Object, propertyKey: &NSString) -> bool { - msg_send![self, setProperty: property, forKey: propertyKey] - } + ); + # [method_id (propertyForKey :)] + pub unsafe fn propertyForKey(&self, propertyKey: &NSString) -> Option>; + # [method (setResourceData :)] + pub unsafe fn setResourceData(&self, data: &NSData) -> bool; + # [method (setProperty : forKey :)] + pub unsafe fn setProperty_forKey(&self, property: &Object, propertyKey: &NSString) -> bool; + # [method_id (URLHandleUsingCache :)] pub unsafe fn URLHandleUsingCache( &self, shouldUseCache: bool, - ) -> Option> { - msg_send_id![self, URLHandleUsingCache: shouldUseCache] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSURLAuthenticationChallenge.rs b/icrate/src/Foundation/generated/NSURLAuthenticationChallenge.rs index d43c357e4..7ae011b46 100644 --- a/icrate/src/Foundation/generated/NSURLAuthenticationChallenge.rs +++ b/icrate/src/Foundation/generated/NSURLAuthenticationChallenge.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSURLAuthenticationChallengeSender = NSObject; use super::__exported::NSURLAuthenticationChallengeInternal; extern_class!( @@ -18,6 +18,7 @@ extern_class!( ); extern_methods!( unsafe impl NSURLAuthenticationChallenge { + # [method_id (initWithProtectionSpace : proposedCredential : previousFailureCount : failureResponse : error : sender :)] pub unsafe fn initWithProtectionSpace_proposedCredential_previousFailureCount_failureResponse_error_sender( &self, space: &NSURLProtectionSpace, @@ -26,45 +27,24 @@ extern_methods!( response: Option<&NSURLResponse>, error: Option<&NSError>, sender: &NSURLAuthenticationChallengeSender, - ) -> Id { - msg_send_id![ - self, - initWithProtectionSpace: space, - proposedCredential: credential, - previousFailureCount: previousFailureCount, - failureResponse: response, - error: error, - sender: sender - ] - } + ) -> Id; + # [method_id (initWithAuthenticationChallenge : sender :)] pub unsafe fn initWithAuthenticationChallenge_sender( &self, challenge: &NSURLAuthenticationChallenge, sender: &NSURLAuthenticationChallengeSender, - ) -> Id { - msg_send_id![ - self, - initWithAuthenticationChallenge: challenge, - sender: sender - ] - } - pub unsafe fn protectionSpace(&self) -> Id { - msg_send_id![self, protectionSpace] - } - pub unsafe fn proposedCredential(&self) -> Option> { - msg_send_id![self, proposedCredential] - } - pub unsafe fn previousFailureCount(&self) -> NSInteger { - msg_send![self, previousFailureCount] - } - pub unsafe fn failureResponse(&self) -> Option> { - msg_send_id![self, failureResponse] - } - pub unsafe fn error(&self) -> Option> { - msg_send_id![self, error] - } - pub unsafe fn sender(&self) -> Option> { - msg_send_id![self, sender] - } + ) -> Id; + #[method_id(protectionSpace)] + pub unsafe fn protectionSpace(&self) -> Id; + #[method_id(proposedCredential)] + pub unsafe fn proposedCredential(&self) -> Option>; + #[method(previousFailureCount)] + pub unsafe fn previousFailureCount(&self) -> NSInteger; + #[method_id(failureResponse)] + pub unsafe fn failureResponse(&self) -> Option>; + #[method_id(error)] + pub unsafe fn error(&self) -> Option>; + #[method_id(sender)] + pub unsafe fn sender(&self) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSURLCache.rs b/icrate/src/Foundation/generated/NSURLCache.rs index c7941f12e..f153d432c 100644 --- a/icrate/src/Foundation/generated/NSURLCache.rs +++ b/icrate/src/Foundation/generated/NSURLCache.rs @@ -9,7 +9,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSCachedURLResponse; @@ -19,40 +19,28 @@ extern_class!( ); extern_methods!( unsafe impl NSCachedURLResponse { + # [method_id (initWithResponse : data :)] pub unsafe fn initWithResponse_data( &self, response: &NSURLResponse, data: &NSData, - ) -> Id { - msg_send_id![self, initWithResponse: response, data: data] - } + ) -> Id; + # [method_id (initWithResponse : data : userInfo : storagePolicy :)] pub unsafe fn initWithResponse_data_userInfo_storagePolicy( &self, response: &NSURLResponse, data: &NSData, userInfo: Option<&NSDictionary>, storagePolicy: NSURLCacheStoragePolicy, - ) -> Id { - msg_send_id![ - self, - initWithResponse: response, - data: data, - userInfo: userInfo, - storagePolicy: storagePolicy - ] - } - pub unsafe fn response(&self) -> Id { - msg_send_id![self, response] - } - pub unsafe fn data(&self) -> Id { - msg_send_id![self, data] - } - pub unsafe fn userInfo(&self) -> Option> { - msg_send_id![self, userInfo] - } - pub unsafe fn storagePolicy(&self) -> NSURLCacheStoragePolicy { - msg_send![self, storagePolicy] - } + ) -> Id; + #[method_id(response)] + pub unsafe fn response(&self) -> Id; + #[method_id(data)] + pub unsafe fn data(&self) -> Id; + #[method_id(userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + #[method(storagePolicy)] + pub unsafe fn storagePolicy(&self) -> NSURLCacheStoragePolicy; } ); use super::__exported::NSURLCacheInternal; @@ -66,111 +54,71 @@ extern_class!( ); extern_methods!( unsafe impl NSURLCache { - pub unsafe fn sharedURLCache() -> Id { - msg_send_id![Self::class(), sharedURLCache] - } - pub unsafe fn setSharedURLCache(sharedURLCache: &NSURLCache) { - msg_send![Self::class(), setSharedURLCache: sharedURLCache] - } + #[method_id(sharedURLCache)] + pub unsafe fn sharedURLCache() -> Id; + # [method (setSharedURLCache :)] + pub unsafe fn setSharedURLCache(sharedURLCache: &NSURLCache); + # [method_id (initWithMemoryCapacity : diskCapacity : diskPath :)] pub unsafe fn initWithMemoryCapacity_diskCapacity_diskPath( &self, memoryCapacity: NSUInteger, diskCapacity: NSUInteger, path: Option<&NSString>, - ) -> Id { - msg_send_id![ - self, - initWithMemoryCapacity: memoryCapacity, - diskCapacity: diskCapacity, - diskPath: path - ] - } + ) -> Id; + # [method_id (initWithMemoryCapacity : diskCapacity : directoryURL :)] pub unsafe fn initWithMemoryCapacity_diskCapacity_directoryURL( &self, memoryCapacity: NSUInteger, diskCapacity: NSUInteger, directoryURL: Option<&NSURL>, - ) -> Id { - msg_send_id![ - self, - initWithMemoryCapacity: memoryCapacity, - diskCapacity: diskCapacity, - directoryURL: directoryURL - ] - } + ) -> Id; + # [method_id (cachedResponseForRequest :)] pub unsafe fn cachedResponseForRequest( &self, request: &NSURLRequest, - ) -> Option> { - msg_send_id![self, cachedResponseForRequest: request] - } + ) -> Option>; + # [method (storeCachedResponse : forRequest :)] pub unsafe fn storeCachedResponse_forRequest( &self, cachedResponse: &NSCachedURLResponse, request: &NSURLRequest, - ) { - msg_send![ - self, - storeCachedResponse: cachedResponse, - forRequest: request - ] - } - pub unsafe fn removeCachedResponseForRequest(&self, request: &NSURLRequest) { - msg_send![self, removeCachedResponseForRequest: request] - } - pub unsafe fn removeAllCachedResponses(&self) { - msg_send![self, removeAllCachedResponses] - } - pub unsafe fn removeCachedResponsesSinceDate(&self, date: &NSDate) { - msg_send![self, removeCachedResponsesSinceDate: date] - } - pub unsafe fn memoryCapacity(&self) -> NSUInteger { - msg_send![self, memoryCapacity] - } - pub unsafe fn setMemoryCapacity(&self, memoryCapacity: NSUInteger) { - msg_send![self, setMemoryCapacity: memoryCapacity] - } - pub unsafe fn diskCapacity(&self) -> NSUInteger { - msg_send![self, diskCapacity] - } - pub unsafe fn setDiskCapacity(&self, diskCapacity: NSUInteger) { - msg_send![self, setDiskCapacity: diskCapacity] - } - pub unsafe fn currentMemoryUsage(&self) -> NSUInteger { - msg_send![self, currentMemoryUsage] - } - pub unsafe fn currentDiskUsage(&self) -> NSUInteger { - msg_send![self, currentDiskUsage] - } + ); + # [method (removeCachedResponseForRequest :)] + pub unsafe fn removeCachedResponseForRequest(&self, request: &NSURLRequest); + #[method(removeAllCachedResponses)] + pub unsafe fn removeAllCachedResponses(&self); + # [method (removeCachedResponsesSinceDate :)] + pub unsafe fn removeCachedResponsesSinceDate(&self, date: &NSDate); + #[method(memoryCapacity)] + pub unsafe fn memoryCapacity(&self) -> NSUInteger; + # [method (setMemoryCapacity :)] + pub unsafe fn setMemoryCapacity(&self, memoryCapacity: NSUInteger); + #[method(diskCapacity)] + pub unsafe fn diskCapacity(&self) -> NSUInteger; + # [method (setDiskCapacity :)] + pub unsafe fn setDiskCapacity(&self, diskCapacity: NSUInteger); + #[method(currentMemoryUsage)] + pub unsafe fn currentMemoryUsage(&self) -> NSUInteger; + #[method(currentDiskUsage)] + pub unsafe fn currentDiskUsage(&self) -> NSUInteger; } ); extern_methods!( #[doc = "NSURLSessionTaskAdditions"] unsafe impl NSURLCache { + # [method (storeCachedResponse : forDataTask :)] pub unsafe fn storeCachedResponse_forDataTask( &self, cachedResponse: &NSCachedURLResponse, dataTask: &NSURLSessionDataTask, - ) { - msg_send![ - self, - storeCachedResponse: cachedResponse, - forDataTask: dataTask - ] - } + ); + # [method (getCachedResponseForDataTask : completionHandler :)] pub unsafe fn getCachedResponseForDataTask_completionHandler( &self, dataTask: &NSURLSessionDataTask, completionHandler: TodoBlock, - ) { - msg_send![ - self, - getCachedResponseForDataTask: dataTask, - completionHandler: completionHandler - ] - } - pub unsafe fn removeCachedResponseForDataTask(&self, dataTask: &NSURLSessionDataTask) { - msg_send![self, removeCachedResponseForDataTask: dataTask] - } + ); + # [method (removeCachedResponseForDataTask :)] + pub unsafe fn removeCachedResponseForDataTask(&self, dataTask: &NSURLSessionDataTask); } ); diff --git a/icrate/src/Foundation/generated/NSURLConnection.rs b/icrate/src/Foundation/generated/NSURLConnection.rs index f792eb1e2..c3ca51cbc 100644 --- a/icrate/src/Foundation/generated/NSURLConnection.rs +++ b/icrate/src/Foundation/generated/NSURLConnection.rs @@ -16,7 +16,7 @@ use crate::Foundation::generated::NSRunLoop::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSURLConnection; @@ -26,64 +26,44 @@ extern_class!( ); extern_methods!( unsafe impl NSURLConnection { + # [method_id (initWithRequest : delegate : startImmediately :)] pub unsafe fn initWithRequest_delegate_startImmediately( &self, request: &NSURLRequest, delegate: Option<&Object>, startImmediately: bool, - ) -> Option> { - msg_send_id![ - self, - initWithRequest: request, - delegate: delegate, - startImmediately: startImmediately - ] - } + ) -> Option>; + # [method_id (initWithRequest : delegate :)] pub unsafe fn initWithRequest_delegate( &self, request: &NSURLRequest, delegate: Option<&Object>, - ) -> Option> { - msg_send_id![self, initWithRequest: request, delegate: delegate] - } + ) -> Option>; + # [method_id (connectionWithRequest : delegate :)] pub unsafe fn connectionWithRequest_delegate( request: &NSURLRequest, delegate: Option<&Object>, - ) -> Option> { - msg_send_id![ - Self::class(), - connectionWithRequest: request, - delegate: delegate - ] - } - pub unsafe fn originalRequest(&self) -> Id { - msg_send_id![self, originalRequest] - } - pub unsafe fn currentRequest(&self) -> Id { - msg_send_id![self, currentRequest] - } - pub unsafe fn start(&self) { - msg_send![self, start] - } - pub unsafe fn cancel(&self) { - msg_send![self, cancel] - } - pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode) { - msg_send![self, scheduleInRunLoop: aRunLoop, forMode: mode] - } + ) -> Option>; + #[method_id(originalRequest)] + pub unsafe fn originalRequest(&self) -> Id; + #[method_id(currentRequest)] + pub unsafe fn currentRequest(&self) -> Id; + #[method(start)] + pub unsafe fn start(&self); + #[method(cancel)] + pub unsafe fn cancel(&self); + # [method (scheduleInRunLoop : forMode :)] + pub unsafe fn scheduleInRunLoop_forMode(&self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode); + # [method (unscheduleFromRunLoop : forMode :)] pub unsafe fn unscheduleFromRunLoop_forMode( &self, aRunLoop: &NSRunLoop, mode: &NSRunLoopMode, - ) { - msg_send![self, unscheduleFromRunLoop: aRunLoop, forMode: mode] - } - pub unsafe fn setDelegateQueue(&self, queue: Option<&NSOperationQueue>) { - msg_send![self, setDelegateQueue: queue] - } - pub unsafe fn canHandleRequest(request: &NSURLRequest) -> bool { - msg_send![Self::class(), canHandleRequest: request] - } + ); + # [method (setDelegateQueue :)] + pub unsafe fn setDelegateQueue(&self, queue: Option<&NSOperationQueue>); + # [method (canHandleRequest :)] + pub unsafe fn canHandleRequest(request: &NSURLRequest) -> bool; } ); pub type NSURLConnectionDelegate = NSObject; @@ -92,33 +72,21 @@ pub type NSURLConnectionDownloadDelegate = NSObject; extern_methods!( #[doc = "NSURLConnectionSynchronousLoading"] unsafe impl NSURLConnection { + # [method_id (sendSynchronousRequest : returningResponse : error :)] pub unsafe fn sendSynchronousRequest_returningResponse_error( request: &NSURLRequest, response: Option<&mut Option>>, - ) -> Result, Id> { - msg_send_id![ - Self::class(), - sendSynchronousRequest: request, - returningResponse: response, - error: _ - ] - } + ) -> Result, Id>; } ); extern_methods!( #[doc = "NSURLConnectionQueuedLoading"] unsafe impl NSURLConnection { + # [method (sendAsynchronousRequest : queue : completionHandler :)] pub unsafe fn sendAsynchronousRequest_queue_completionHandler( request: &NSURLRequest, queue: &NSOperationQueue, handler: TodoBlock, - ) { - msg_send![ - Self::class(), - sendAsynchronousRequest: request, - queue: queue, - completionHandler: handler - ] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSURLCredential.rs b/icrate/src/Foundation/generated/NSURLCredential.rs index c5a48ccae..5b0e47810 100644 --- a/icrate/src/Foundation/generated/NSURLCredential.rs +++ b/icrate/src/Foundation/generated/NSURLCredential.rs @@ -6,7 +6,7 @@ use crate::Security::generated::Security::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSURLCredential; @@ -16,94 +16,62 @@ extern_class!( ); extern_methods!( unsafe impl NSURLCredential { - pub unsafe fn persistence(&self) -> NSURLCredentialPersistence { - msg_send![self, persistence] - } + #[method(persistence)] + pub unsafe fn persistence(&self) -> NSURLCredentialPersistence; } ); extern_methods!( #[doc = "NSInternetPassword"] unsafe impl NSURLCredential { + # [method_id (initWithUser : password : persistence :)] pub unsafe fn initWithUser_password_persistence( &self, user: &NSString, password: &NSString, persistence: NSURLCredentialPersistence, - ) -> Id { - msg_send_id![ - self, - initWithUser: user, - password: password, - persistence: persistence - ] - } + ) -> Id; + # [method_id (credentialWithUser : password : persistence :)] pub unsafe fn credentialWithUser_password_persistence( user: &NSString, password: &NSString, persistence: NSURLCredentialPersistence, - ) -> Id { - msg_send_id![ - Self::class(), - credentialWithUser: user, - password: password, - persistence: persistence - ] - } - pub unsafe fn user(&self) -> Option> { - msg_send_id![self, user] - } - pub unsafe fn password(&self) -> Option> { - msg_send_id![self, password] - } - pub unsafe fn hasPassword(&self) -> bool { - msg_send![self, hasPassword] - } + ) -> Id; + #[method_id(user)] + pub unsafe fn user(&self) -> Option>; + #[method_id(password)] + pub unsafe fn password(&self) -> Option>; + #[method(hasPassword)] + pub unsafe fn hasPassword(&self) -> bool; } ); extern_methods!( #[doc = "NSClientCertificate"] unsafe impl NSURLCredential { + # [method_id (initWithIdentity : certificates : persistence :)] pub unsafe fn initWithIdentity_certificates_persistence( &self, identity: SecIdentityRef, certArray: Option<&NSArray>, persistence: NSURLCredentialPersistence, - ) -> Id { - msg_send_id![ - self, - initWithIdentity: identity, - certificates: certArray, - persistence: persistence - ] - } + ) -> Id; + # [method_id (credentialWithIdentity : certificates : persistence :)] pub unsafe fn credentialWithIdentity_certificates_persistence( identity: SecIdentityRef, certArray: Option<&NSArray>, persistence: NSURLCredentialPersistence, - ) -> Id { - msg_send_id![ - Self::class(), - credentialWithIdentity: identity, - certificates: certArray, - persistence: persistence - ] - } - pub unsafe fn identity(&self) -> SecIdentityRef { - msg_send![self, identity] - } - pub unsafe fn certificates(&self) -> Id { - msg_send_id![self, certificates] - } + ) -> Id; + #[method(identity)] + pub unsafe fn identity(&self) -> SecIdentityRef; + #[method_id(certificates)] + pub unsafe fn certificates(&self) -> Id; } ); extern_methods!( #[doc = "NSServerTrust"] unsafe impl NSURLCredential { - pub unsafe fn initWithTrust(&self, trust: SecTrustRef) -> Id { - msg_send_id![self, initWithTrust: trust] - } - pub unsafe fn credentialForTrust(trust: SecTrustRef) -> Id { - msg_send_id![Self::class(), credentialForTrust: trust] - } + # [method_id (initWithTrust :)] + pub unsafe fn initWithTrust(&self, trust: SecTrustRef) -> Id; + # [method_id (credentialForTrust :)] + pub unsafe fn credentialForTrust(trust: SecTrustRef) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSURLCredentialStorage.rs b/icrate/src/Foundation/generated/NSURLCredentialStorage.rs index 165f0a1b3..936fa5242 100644 --- a/icrate/src/Foundation/generated/NSURLCredentialStorage.rs +++ b/icrate/src/Foundation/generated/NSURLCredentialStorage.rs @@ -9,7 +9,7 @@ use crate::Foundation::generated::NSURLProtectionSpace::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSURLCredentialStorage; @@ -19,140 +19,87 @@ extern_class!( ); extern_methods!( unsafe impl NSURLCredentialStorage { - pub unsafe fn sharedCredentialStorage() -> Id { - msg_send_id![Self::class(), sharedCredentialStorage] - } + #[method_id(sharedCredentialStorage)] + pub unsafe fn sharedCredentialStorage() -> Id; + # [method_id (credentialsForProtectionSpace :)] pub unsafe fn credentialsForProtectionSpace( &self, space: &NSURLProtectionSpace, - ) -> Option, Shared>> { - msg_send_id![self, credentialsForProtectionSpace: space] - } + ) -> Option, Shared>>; + #[method_id(allCredentials)] pub unsafe fn allCredentials( &self, - ) -> Id>, Shared> - { - msg_send_id![self, allCredentials] - } + ) -> Id>, Shared>; + # [method (setCredential : forProtectionSpace :)] pub unsafe fn setCredential_forProtectionSpace( &self, credential: &NSURLCredential, space: &NSURLProtectionSpace, - ) { - msg_send![self, setCredential: credential, forProtectionSpace: space] - } + ); + # [method (removeCredential : forProtectionSpace :)] pub unsafe fn removeCredential_forProtectionSpace( &self, credential: &NSURLCredential, space: &NSURLProtectionSpace, - ) { - msg_send![ - self, - removeCredential: credential, - forProtectionSpace: space - ] - } + ); + # [method (removeCredential : forProtectionSpace : options :)] pub unsafe fn removeCredential_forProtectionSpace_options( &self, credential: &NSURLCredential, space: &NSURLProtectionSpace, options: Option<&NSDictionary>, - ) { - msg_send![ - self, - removeCredential: credential, - forProtectionSpace: space, - options: options - ] - } + ); + # [method_id (defaultCredentialForProtectionSpace :)] pub unsafe fn defaultCredentialForProtectionSpace( &self, space: &NSURLProtectionSpace, - ) -> Option> { - msg_send_id![self, defaultCredentialForProtectionSpace: space] - } + ) -> Option>; + # [method (setDefaultCredential : forProtectionSpace :)] pub unsafe fn setDefaultCredential_forProtectionSpace( &self, credential: &NSURLCredential, space: &NSURLProtectionSpace, - ) { - msg_send![ - self, - setDefaultCredential: credential, - forProtectionSpace: space - ] - } + ); } ); extern_methods!( #[doc = "NSURLSessionTaskAdditions"] unsafe impl NSURLCredentialStorage { + # [method (getCredentialsForProtectionSpace : task : completionHandler :)] pub unsafe fn getCredentialsForProtectionSpace_task_completionHandler( &self, protectionSpace: &NSURLProtectionSpace, task: &NSURLSessionTask, completionHandler: TodoBlock, - ) { - msg_send![ - self, - getCredentialsForProtectionSpace: protectionSpace, - task: task, - completionHandler: completionHandler - ] - } + ); + # [method (setCredential : forProtectionSpace : task :)] pub unsafe fn setCredential_forProtectionSpace_task( &self, credential: &NSURLCredential, protectionSpace: &NSURLProtectionSpace, task: &NSURLSessionTask, - ) { - msg_send![ - self, - setCredential: credential, - forProtectionSpace: protectionSpace, - task: task - ] - } + ); + # [method (removeCredential : forProtectionSpace : options : task :)] pub unsafe fn removeCredential_forProtectionSpace_options_task( &self, credential: &NSURLCredential, protectionSpace: &NSURLProtectionSpace, options: Option<&NSDictionary>, task: &NSURLSessionTask, - ) { - msg_send![ - self, - removeCredential: credential, - forProtectionSpace: protectionSpace, - options: options, - task: task - ] - } + ); + # [method (getDefaultCredentialForProtectionSpace : task : completionHandler :)] pub unsafe fn getDefaultCredentialForProtectionSpace_task_completionHandler( &self, space: &NSURLProtectionSpace, task: &NSURLSessionTask, completionHandler: TodoBlock, - ) { - msg_send![ - self, - getDefaultCredentialForProtectionSpace: space, - task: task, - completionHandler: completionHandler - ] - } + ); + # [method (setDefaultCredential : forProtectionSpace : task :)] pub unsafe fn setDefaultCredential_forProtectionSpace_task( &self, credential: &NSURLCredential, protectionSpace: &NSURLProtectionSpace, task: &NSURLSessionTask, - ) { - msg_send![ - self, - setDefaultCredential: credential, - forProtectionSpace: protectionSpace, - task: task - ] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSURLDownload.rs b/icrate/src/Foundation/generated/NSURLDownload.rs index 41a88a0de..7a90682d5 100644 --- a/icrate/src/Foundation/generated/NSURLDownload.rs +++ b/icrate/src/Foundation/generated/NSURLDownload.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSURLDownload; @@ -20,50 +20,33 @@ extern_class!( ); extern_methods!( unsafe impl NSURLDownload { - pub unsafe fn canResumeDownloadDecodedWithEncodingMIMEType(MIMEType: &NSString) -> bool { - msg_send![ - Self::class(), - canResumeDownloadDecodedWithEncodingMIMEType: MIMEType - ] - } + # [method (canResumeDownloadDecodedWithEncodingMIMEType :)] + pub unsafe fn canResumeDownloadDecodedWithEncodingMIMEType(MIMEType: &NSString) -> bool; + # [method_id (initWithRequest : delegate :)] pub unsafe fn initWithRequest_delegate( &self, request: &NSURLRequest, delegate: Option<&NSURLDownloadDelegate>, - ) -> Id { - msg_send_id![self, initWithRequest: request, delegate: delegate] - } + ) -> Id; + # [method_id (initWithResumeData : delegate : path :)] pub unsafe fn initWithResumeData_delegate_path( &self, resumeData: &NSData, delegate: Option<&NSURLDownloadDelegate>, path: &NSString, - ) -> Id { - msg_send_id![ - self, - initWithResumeData: resumeData, - delegate: delegate, - path: path - ] - } - pub unsafe fn cancel(&self) { - msg_send![self, cancel] - } - pub unsafe fn setDestination_allowOverwrite(&self, path: &NSString, allowOverwrite: bool) { - msg_send![self, setDestination: path, allowOverwrite: allowOverwrite] - } - pub unsafe fn request(&self) -> Id { - msg_send_id![self, request] - } - pub unsafe fn resumeData(&self) -> Option> { - msg_send_id![self, resumeData] - } - pub unsafe fn deletesFileUponFailure(&self) -> bool { - msg_send![self, deletesFileUponFailure] - } - pub unsafe fn setDeletesFileUponFailure(&self, deletesFileUponFailure: bool) { - msg_send![self, setDeletesFileUponFailure: deletesFileUponFailure] - } + ) -> Id; + #[method(cancel)] + pub unsafe fn cancel(&self); + # [method (setDestination : allowOverwrite :)] + pub unsafe fn setDestination_allowOverwrite(&self, path: &NSString, allowOverwrite: bool); + #[method_id(request)] + pub unsafe fn request(&self) -> Id; + #[method_id(resumeData)] + pub unsafe fn resumeData(&self) -> Option>; + #[method(deletesFileUponFailure)] + pub unsafe fn deletesFileUponFailure(&self) -> bool; + # [method (setDeletesFileUponFailure :)] + pub unsafe fn setDeletesFileUponFailure(&self, deletesFileUponFailure: bool); } ); pub type NSURLDownloadDelegate = NSObject; diff --git a/icrate/src/Foundation/generated/NSURLError.rs b/icrate/src/Foundation/generated/NSURLError.rs index 0b843ca3f..31d6018ed 100644 --- a/icrate/src/Foundation/generated/NSURLError.rs +++ b/icrate/src/Foundation/generated/NSURLError.rs @@ -5,4 +5,4 @@ use crate::Foundation::generated::NSObjCRuntime::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; diff --git a/icrate/src/Foundation/generated/NSURLHandle.rs b/icrate/src/Foundation/generated/NSURLHandle.rs index fe0042a35..2dfd59950 100644 --- a/icrate/src/Foundation/generated/NSURLHandle.rs +++ b/icrate/src/Foundation/generated/NSURLHandle.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSURLHandleClient = NSObject; extern_class!( #[derive(Debug)] @@ -17,91 +17,67 @@ extern_class!( ); extern_methods!( unsafe impl NSURLHandle { - pub unsafe fn registerURLHandleClass(anURLHandleSubclass: Option<&Class>) { - msg_send![Self::class(), registerURLHandleClass: anURLHandleSubclass] - } - pub unsafe fn URLHandleClassForURL(anURL: Option<&NSURL>) -> Option<&Class> { - msg_send![Self::class(), URLHandleClassForURL: anURL] - } - pub unsafe fn status(&self) -> NSURLHandleStatus { - msg_send![self, status] - } - pub unsafe fn failureReason(&self) -> Option> { - msg_send_id![self, failureReason] - } - pub unsafe fn addClient(&self, client: Option<&NSURLHandleClient>) { - msg_send![self, addClient: client] - } - pub unsafe fn removeClient(&self, client: Option<&NSURLHandleClient>) { - msg_send![self, removeClient: client] - } - pub unsafe fn loadInBackground(&self) { - msg_send![self, loadInBackground] - } - pub unsafe fn cancelLoadInBackground(&self) { - msg_send![self, cancelLoadInBackground] - } - pub unsafe fn resourceData(&self) -> Option> { - msg_send_id![self, resourceData] - } - pub unsafe fn availableResourceData(&self) -> Option> { - msg_send_id![self, availableResourceData] - } - pub unsafe fn expectedResourceDataSize(&self) -> c_longlong { - msg_send![self, expectedResourceDataSize] - } - pub unsafe fn flushCachedData(&self) { - msg_send![self, flushCachedData] - } - pub unsafe fn backgroundLoadDidFailWithReason(&self, reason: Option<&NSString>) { - msg_send![self, backgroundLoadDidFailWithReason: reason] - } - pub unsafe fn didLoadBytes_loadComplete(&self, newBytes: Option<&NSData>, yorn: bool) { - msg_send![self, didLoadBytes: newBytes, loadComplete: yorn] - } - pub unsafe fn canInitWithURL(anURL: Option<&NSURL>) -> bool { - msg_send![Self::class(), canInitWithURL: anURL] - } - pub unsafe fn cachedHandleForURL(anURL: Option<&NSURL>) -> Option> { - msg_send_id![Self::class(), cachedHandleForURL: anURL] - } + # [method (registerURLHandleClass :)] + pub unsafe fn registerURLHandleClass(anURLHandleSubclass: Option<&Class>); + # [method (URLHandleClassForURL :)] + pub unsafe fn URLHandleClassForURL(anURL: Option<&NSURL>) -> Option<&Class>; + #[method(status)] + pub unsafe fn status(&self) -> NSURLHandleStatus; + #[method_id(failureReason)] + pub unsafe fn failureReason(&self) -> Option>; + # [method (addClient :)] + pub unsafe fn addClient(&self, client: Option<&NSURLHandleClient>); + # [method (removeClient :)] + pub unsafe fn removeClient(&self, client: Option<&NSURLHandleClient>); + #[method(loadInBackground)] + pub unsafe fn loadInBackground(&self); + #[method(cancelLoadInBackground)] + pub unsafe fn cancelLoadInBackground(&self); + #[method_id(resourceData)] + pub unsafe fn resourceData(&self) -> Option>; + #[method_id(availableResourceData)] + pub unsafe fn availableResourceData(&self) -> Option>; + #[method(expectedResourceDataSize)] + pub unsafe fn expectedResourceDataSize(&self) -> c_longlong; + #[method(flushCachedData)] + pub unsafe fn flushCachedData(&self); + # [method (backgroundLoadDidFailWithReason :)] + pub unsafe fn backgroundLoadDidFailWithReason(&self, reason: Option<&NSString>); + # [method (didLoadBytes : loadComplete :)] + pub unsafe fn didLoadBytes_loadComplete(&self, newBytes: Option<&NSData>, yorn: bool); + # [method (canInitWithURL :)] + pub unsafe fn canInitWithURL(anURL: Option<&NSURL>) -> bool; + # [method_id (cachedHandleForURL :)] + pub unsafe fn cachedHandleForURL(anURL: Option<&NSURL>) -> Option>; + # [method_id (initWithURL : cached :)] pub unsafe fn initWithURL_cached( &self, anURL: Option<&NSURL>, willCache: bool, - ) -> Option> { - msg_send_id![self, initWithURL: anURL, cached: willCache] - } + ) -> Option>; + # [method_id (propertyForKey :)] pub unsafe fn propertyForKey( &self, propertyKey: Option<&NSString>, - ) -> Option> { - msg_send_id![self, propertyForKey: propertyKey] - } + ) -> Option>; + # [method_id (propertyForKeyIfAvailable :)] pub unsafe fn propertyForKeyIfAvailable( &self, propertyKey: Option<&NSString>, - ) -> Option> { - msg_send_id![self, propertyForKeyIfAvailable: propertyKey] - } + ) -> Option>; + # [method (writeProperty : forKey :)] pub unsafe fn writeProperty_forKey( &self, propertyValue: Option<&Object>, propertyKey: Option<&NSString>, - ) -> bool { - msg_send![self, writeProperty: propertyValue, forKey: propertyKey] - } - pub unsafe fn writeData(&self, data: Option<&NSData>) -> bool { - msg_send![self, writeData: data] - } - pub unsafe fn loadInForeground(&self) -> Option> { - msg_send_id![self, loadInForeground] - } - pub unsafe fn beginLoadInBackground(&self) { - msg_send![self, beginLoadInBackground] - } - pub unsafe fn endLoadInBackground(&self) { - msg_send![self, endLoadInBackground] - } + ) -> bool; + # [method (writeData :)] + pub unsafe fn writeData(&self, data: Option<&NSData>) -> bool; + #[method_id(loadInForeground)] + pub unsafe fn loadInForeground(&self) -> Option>; + #[method(beginLoadInBackground)] + pub unsafe fn beginLoadInBackground(&self); + #[method(endLoadInBackground)] + pub unsafe fn endLoadInBackground(&self); } ); diff --git a/icrate/src/Foundation/generated/NSURLProtectionSpace.rs b/icrate/src/Foundation/generated/NSURLProtectionSpace.rs index 5cc5eb7d6..343c2952a 100644 --- a/icrate/src/Foundation/generated/NSURLProtectionSpace.rs +++ b/icrate/src/Foundation/generated/NSURLProtectionSpace.rs @@ -7,7 +7,7 @@ use crate::Security::generated::Security::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSURLProtectionSpace; @@ -17,6 +17,7 @@ extern_class!( ); extern_methods!( unsafe impl NSURLProtectionSpace { + # [method_id (initWithHost : port : protocol : realm : authenticationMethod :)] pub unsafe fn initWithHost_port_protocol_realm_authenticationMethod( &self, host: &NSString, @@ -24,16 +25,8 @@ extern_methods!( protocol: Option<&NSString>, realm: Option<&NSString>, authenticationMethod: Option<&NSString>, - ) -> Id { - msg_send_id![ - self, - initWithHost: host, - port: port, - protocol: protocol, - realm: realm, - authenticationMethod: authenticationMethod - ] - } + ) -> Id; + # [method_id (initWithProxyHost : port : type : realm : authenticationMethod :)] pub unsafe fn initWithProxyHost_port_type_realm_authenticationMethod( &self, host: &NSString, @@ -41,48 +34,36 @@ extern_methods!( type_: Option<&NSString>, realm: Option<&NSString>, authenticationMethod: Option<&NSString>, - ) -> Id { - msg_send_id ! [self , initWithProxyHost : host , port : port , type : type_ , realm : realm , authenticationMethod : authenticationMethod] - } - pub unsafe fn realm(&self) -> Option> { - msg_send_id![self, realm] - } - pub unsafe fn receivesCredentialSecurely(&self) -> bool { - msg_send![self, receivesCredentialSecurely] - } - pub unsafe fn isProxy(&self) -> bool { - msg_send![self, isProxy] - } - pub unsafe fn host(&self) -> Id { - msg_send_id![self, host] - } - pub unsafe fn port(&self) -> NSInteger { - msg_send![self, port] - } - pub unsafe fn proxyType(&self) -> Option> { - msg_send_id![self, proxyType] - } - pub unsafe fn protocol(&self) -> Option> { - msg_send_id![self, protocol] - } - pub unsafe fn authenticationMethod(&self) -> Id { - msg_send_id![self, authenticationMethod] - } + ) -> Id; + #[method_id(realm)] + pub unsafe fn realm(&self) -> Option>; + #[method(receivesCredentialSecurely)] + pub unsafe fn receivesCredentialSecurely(&self) -> bool; + #[method(isProxy)] + pub unsafe fn isProxy(&self) -> bool; + #[method_id(host)] + pub unsafe fn host(&self) -> Id; + #[method(port)] + pub unsafe fn port(&self) -> NSInteger; + #[method_id(proxyType)] + pub unsafe fn proxyType(&self) -> Option>; + #[method_id(protocol)] + pub unsafe fn protocol(&self) -> Option>; + #[method_id(authenticationMethod)] + pub unsafe fn authenticationMethod(&self) -> Id; } ); extern_methods!( #[doc = "NSClientCertificateSpace"] unsafe impl NSURLProtectionSpace { - pub unsafe fn distinguishedNames(&self) -> Option, Shared>> { - msg_send_id![self, distinguishedNames] - } + #[method_id(distinguishedNames)] + pub unsafe fn distinguishedNames(&self) -> Option, Shared>>; } ); extern_methods!( #[doc = "NSServerTrustValidationSpace"] unsafe impl NSURLProtectionSpace { - pub unsafe fn serverTrust(&self) -> SecTrustRef { - msg_send![self, serverTrust] - } + #[method(serverTrust)] + pub unsafe fn serverTrust(&self) -> SecTrustRef; } ); diff --git a/icrate/src/Foundation/generated/NSURLProtocol.rs b/icrate/src/Foundation/generated/NSURLProtocol.rs index 5fcb3a67f..3d44077b4 100644 --- a/icrate/src/Foundation/generated/NSURLProtocol.rs +++ b/icrate/src/Foundation/generated/NSURLProtocol.rs @@ -12,7 +12,7 @@ use crate::Foundation::generated::NSURLCache::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSURLProtocolClient = NSObject; extern_class!( #[derive(Debug)] @@ -23,101 +23,66 @@ extern_class!( ); extern_methods!( unsafe impl NSURLProtocol { + # [method_id (initWithRequest : cachedResponse : client :)] pub unsafe fn initWithRequest_cachedResponse_client( &self, request: &NSURLRequest, cachedResponse: Option<&NSCachedURLResponse>, client: Option<&NSURLProtocolClient>, - ) -> Id { - msg_send_id![ - self, - initWithRequest: request, - cachedResponse: cachedResponse, - client: client - ] - } - pub unsafe fn client(&self) -> Option> { - msg_send_id![self, client] - } - pub unsafe fn request(&self) -> Id { - msg_send_id![self, request] - } - pub unsafe fn cachedResponse(&self) -> Option> { - msg_send_id![self, cachedResponse] - } - pub unsafe fn canInitWithRequest(request: &NSURLRequest) -> bool { - msg_send![Self::class(), canInitWithRequest: request] - } + ) -> Id; + #[method_id(client)] + pub unsafe fn client(&self) -> Option>; + #[method_id(request)] + pub unsafe fn request(&self) -> Id; + #[method_id(cachedResponse)] + pub unsafe fn cachedResponse(&self) -> Option>; + # [method (canInitWithRequest :)] + pub unsafe fn canInitWithRequest(request: &NSURLRequest) -> bool; + # [method_id (canonicalRequestForRequest :)] pub unsafe fn canonicalRequestForRequest( request: &NSURLRequest, - ) -> Id { - msg_send_id![Self::class(), canonicalRequestForRequest: request] - } + ) -> Id; + # [method (requestIsCacheEquivalent : toRequest :)] pub unsafe fn requestIsCacheEquivalent_toRequest( a: &NSURLRequest, b: &NSURLRequest, - ) -> bool { - msg_send![Self::class(), requestIsCacheEquivalent: a, toRequest: b] - } - pub unsafe fn startLoading(&self) { - msg_send![self, startLoading] - } - pub unsafe fn stopLoading(&self) { - msg_send![self, stopLoading] - } + ) -> bool; + #[method(startLoading)] + pub unsafe fn startLoading(&self); + #[method(stopLoading)] + pub unsafe fn stopLoading(&self); + # [method_id (propertyForKey : inRequest :)] pub unsafe fn propertyForKey_inRequest( key: &NSString, request: &NSURLRequest, - ) -> Option> { - msg_send_id![Self::class(), propertyForKey: key, inRequest: request] - } + ) -> Option>; + # [method (setProperty : forKey : inRequest :)] pub unsafe fn setProperty_forKey_inRequest( value: &Object, key: &NSString, request: &NSMutableURLRequest, - ) { - msg_send![ - Self::class(), - setProperty: value, - forKey: key, - inRequest: request - ] - } - pub unsafe fn removePropertyForKey_inRequest( - key: &NSString, - request: &NSMutableURLRequest, - ) { - msg_send![Self::class(), removePropertyForKey: key, inRequest: request] - } - pub unsafe fn registerClass(protocolClass: &Class) -> bool { - msg_send![Self::class(), registerClass: protocolClass] - } - pub unsafe fn unregisterClass(protocolClass: &Class) { - msg_send![Self::class(), unregisterClass: protocolClass] - } + ); + # [method (removePropertyForKey : inRequest :)] + pub unsafe fn removePropertyForKey_inRequest(key: &NSString, request: &NSMutableURLRequest); + # [method (registerClass :)] + pub unsafe fn registerClass(protocolClass: &Class) -> bool; + # [method (unregisterClass :)] + pub unsafe fn unregisterClass(protocolClass: &Class); } ); extern_methods!( #[doc = "NSURLSessionTaskAdditions"] unsafe impl NSURLProtocol { - pub unsafe fn canInitWithTask(task: &NSURLSessionTask) -> bool { - msg_send![Self::class(), canInitWithTask: task] - } + # [method (canInitWithTask :)] + pub unsafe fn canInitWithTask(task: &NSURLSessionTask) -> bool; + # [method_id (initWithTask : cachedResponse : client :)] pub unsafe fn initWithTask_cachedResponse_client( &self, task: &NSURLSessionTask, cachedResponse: Option<&NSCachedURLResponse>, client: Option<&NSURLProtocolClient>, - ) -> Id { - msg_send_id![ - self, - initWithTask: task, - cachedResponse: cachedResponse, - client: client - ] - } - pub unsafe fn task(&self) -> Option> { - msg_send_id![self, task] - } + ) -> Id; + #[method_id(task)] + pub unsafe fn task(&self) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSURLRequest.rs b/icrate/src/Foundation/generated/NSURLRequest.rs index 1229f8a96..903262de0 100644 --- a/icrate/src/Foundation/generated/NSURLRequest.rs +++ b/icrate/src/Foundation/generated/NSURLRequest.rs @@ -9,7 +9,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSURLRequest; @@ -19,70 +19,45 @@ extern_class!( ); extern_methods!( unsafe impl NSURLRequest { - pub unsafe fn requestWithURL(URL: &NSURL) -> Id { - msg_send_id![Self::class(), requestWithURL: URL] - } - pub unsafe fn supportsSecureCoding() -> bool { - msg_send![Self::class(), supportsSecureCoding] - } + # [method_id (requestWithURL :)] + pub unsafe fn requestWithURL(URL: &NSURL) -> Id; + #[method(supportsSecureCoding)] + pub unsafe fn supportsSecureCoding() -> bool; + # [method_id (requestWithURL : cachePolicy : timeoutInterval :)] pub unsafe fn requestWithURL_cachePolicy_timeoutInterval( URL: &NSURL, cachePolicy: NSURLRequestCachePolicy, timeoutInterval: NSTimeInterval, - ) -> Id { - msg_send_id![ - Self::class(), - requestWithURL: URL, - cachePolicy: cachePolicy, - timeoutInterval: timeoutInterval - ] - } - pub unsafe fn initWithURL(&self, URL: &NSURL) -> Id { - msg_send_id![self, initWithURL: URL] - } + ) -> Id; + # [method_id (initWithURL :)] + pub unsafe fn initWithURL(&self, URL: &NSURL) -> Id; + # [method_id (initWithURL : cachePolicy : timeoutInterval :)] pub unsafe fn initWithURL_cachePolicy_timeoutInterval( &self, URL: &NSURL, cachePolicy: NSURLRequestCachePolicy, timeoutInterval: NSTimeInterval, - ) -> Id { - msg_send_id![ - self, - initWithURL: URL, - cachePolicy: cachePolicy, - timeoutInterval: timeoutInterval - ] - } - pub unsafe fn URL(&self) -> Option> { - msg_send_id![self, URL] - } - pub unsafe fn cachePolicy(&self) -> NSURLRequestCachePolicy { - msg_send![self, cachePolicy] - } - pub unsafe fn timeoutInterval(&self) -> NSTimeInterval { - msg_send![self, timeoutInterval] - } - pub unsafe fn mainDocumentURL(&self) -> Option> { - msg_send_id![self, mainDocumentURL] - } - pub unsafe fn networkServiceType(&self) -> NSURLRequestNetworkServiceType { - msg_send![self, networkServiceType] - } - pub unsafe fn allowsCellularAccess(&self) -> bool { - msg_send![self, allowsCellularAccess] - } - pub unsafe fn allowsExpensiveNetworkAccess(&self) -> bool { - msg_send![self, allowsExpensiveNetworkAccess] - } - pub unsafe fn allowsConstrainedNetworkAccess(&self) -> bool { - msg_send![self, allowsConstrainedNetworkAccess] - } - pub unsafe fn assumesHTTP3Capable(&self) -> bool { - msg_send![self, assumesHTTP3Capable] - } - pub unsafe fn attribution(&self) -> NSURLRequestAttribution { - msg_send![self, attribution] - } + ) -> Id; + #[method_id(URL)] + pub unsafe fn URL(&self) -> Option>; + #[method(cachePolicy)] + pub unsafe fn cachePolicy(&self) -> NSURLRequestCachePolicy; + #[method(timeoutInterval)] + pub unsafe fn timeoutInterval(&self) -> NSTimeInterval; + #[method_id(mainDocumentURL)] + pub unsafe fn mainDocumentURL(&self) -> Option>; + #[method(networkServiceType)] + pub unsafe fn networkServiceType(&self) -> NSURLRequestNetworkServiceType; + #[method(allowsCellularAccess)] + pub unsafe fn allowsCellularAccess(&self) -> bool; + #[method(allowsExpensiveNetworkAccess)] + pub unsafe fn allowsExpensiveNetworkAccess(&self) -> bool; + #[method(allowsConstrainedNetworkAccess)] + pub unsafe fn allowsConstrainedNetworkAccess(&self) -> bool; + #[method(assumesHTTP3Capable)] + pub unsafe fn assumesHTTP3Capable(&self) -> bool; + #[method(attribution)] + pub unsafe fn attribution(&self) -> NSURLRequestAttribution; } ); extern_class!( @@ -94,164 +69,117 @@ extern_class!( ); extern_methods!( unsafe impl NSMutableURLRequest { - pub unsafe fn URL(&self) -> Option> { - msg_send_id![self, URL] - } - pub unsafe fn setURL(&self, URL: Option<&NSURL>) { - msg_send![self, setURL: URL] - } - pub unsafe fn cachePolicy(&self) -> NSURLRequestCachePolicy { - msg_send![self, cachePolicy] - } - pub unsafe fn setCachePolicy(&self, cachePolicy: NSURLRequestCachePolicy) { - msg_send![self, setCachePolicy: cachePolicy] - } - pub unsafe fn timeoutInterval(&self) -> NSTimeInterval { - msg_send![self, timeoutInterval] - } - pub unsafe fn setTimeoutInterval(&self, timeoutInterval: NSTimeInterval) { - msg_send![self, setTimeoutInterval: timeoutInterval] - } - pub unsafe fn mainDocumentURL(&self) -> Option> { - msg_send_id![self, mainDocumentURL] - } - pub unsafe fn setMainDocumentURL(&self, mainDocumentURL: Option<&NSURL>) { - msg_send![self, setMainDocumentURL: mainDocumentURL] - } - pub unsafe fn networkServiceType(&self) -> NSURLRequestNetworkServiceType { - msg_send![self, networkServiceType] - } + #[method_id(URL)] + pub unsafe fn URL(&self) -> Option>; + # [method (setURL :)] + pub unsafe fn setURL(&self, URL: Option<&NSURL>); + #[method(cachePolicy)] + pub unsafe fn cachePolicy(&self) -> NSURLRequestCachePolicy; + # [method (setCachePolicy :)] + pub unsafe fn setCachePolicy(&self, cachePolicy: NSURLRequestCachePolicy); + #[method(timeoutInterval)] + pub unsafe fn timeoutInterval(&self) -> NSTimeInterval; + # [method (setTimeoutInterval :)] + pub unsafe fn setTimeoutInterval(&self, timeoutInterval: NSTimeInterval); + #[method_id(mainDocumentURL)] + pub unsafe fn mainDocumentURL(&self) -> Option>; + # [method (setMainDocumentURL :)] + pub unsafe fn setMainDocumentURL(&self, mainDocumentURL: Option<&NSURL>); + #[method(networkServiceType)] + pub unsafe fn networkServiceType(&self) -> NSURLRequestNetworkServiceType; + # [method (setNetworkServiceType :)] pub unsafe fn setNetworkServiceType( &self, networkServiceType: NSURLRequestNetworkServiceType, - ) { - msg_send![self, setNetworkServiceType: networkServiceType] - } - pub unsafe fn allowsCellularAccess(&self) -> bool { - msg_send![self, allowsCellularAccess] - } - pub unsafe fn setAllowsCellularAccess(&self, allowsCellularAccess: bool) { - msg_send![self, setAllowsCellularAccess: allowsCellularAccess] - } - pub unsafe fn allowsExpensiveNetworkAccess(&self) -> bool { - msg_send![self, allowsExpensiveNetworkAccess] - } - pub unsafe fn setAllowsExpensiveNetworkAccess(&self, allowsExpensiveNetworkAccess: bool) { - msg_send![ - self, - setAllowsExpensiveNetworkAccess: allowsExpensiveNetworkAccess - ] - } - pub unsafe fn allowsConstrainedNetworkAccess(&self) -> bool { - msg_send![self, allowsConstrainedNetworkAccess] - } + ); + #[method(allowsCellularAccess)] + pub unsafe fn allowsCellularAccess(&self) -> bool; + # [method (setAllowsCellularAccess :)] + pub unsafe fn setAllowsCellularAccess(&self, allowsCellularAccess: bool); + #[method(allowsExpensiveNetworkAccess)] + pub unsafe fn allowsExpensiveNetworkAccess(&self) -> bool; + # [method (setAllowsExpensiveNetworkAccess :)] + pub unsafe fn setAllowsExpensiveNetworkAccess(&self, allowsExpensiveNetworkAccess: bool); + #[method(allowsConstrainedNetworkAccess)] + pub unsafe fn allowsConstrainedNetworkAccess(&self) -> bool; + # [method (setAllowsConstrainedNetworkAccess :)] pub unsafe fn setAllowsConstrainedNetworkAccess( &self, allowsConstrainedNetworkAccess: bool, - ) { - msg_send![ - self, - setAllowsConstrainedNetworkAccess: allowsConstrainedNetworkAccess - ] - } - pub unsafe fn assumesHTTP3Capable(&self) -> bool { - msg_send![self, assumesHTTP3Capable] - } - pub unsafe fn setAssumesHTTP3Capable(&self, assumesHTTP3Capable: bool) { - msg_send![self, setAssumesHTTP3Capable: assumesHTTP3Capable] - } - pub unsafe fn attribution(&self) -> NSURLRequestAttribution { - msg_send![self, attribution] - } - pub unsafe fn setAttribution(&self, attribution: NSURLRequestAttribution) { - msg_send![self, setAttribution: attribution] - } + ); + #[method(assumesHTTP3Capable)] + pub unsafe fn assumesHTTP3Capable(&self) -> bool; + # [method (setAssumesHTTP3Capable :)] + pub unsafe fn setAssumesHTTP3Capable(&self, assumesHTTP3Capable: bool); + #[method(attribution)] + pub unsafe fn attribution(&self) -> NSURLRequestAttribution; + # [method (setAttribution :)] + pub unsafe fn setAttribution(&self, attribution: NSURLRequestAttribution); } ); extern_methods!( #[doc = "NSHTTPURLRequest"] unsafe impl NSURLRequest { - pub unsafe fn HTTPMethod(&self) -> Option> { - msg_send_id![self, HTTPMethod] - } + #[method_id(HTTPMethod)] + pub unsafe fn HTTPMethod(&self) -> Option>; + #[method_id(allHTTPHeaderFields)] pub unsafe fn allHTTPHeaderFields( &self, - ) -> Option, Shared>> { - msg_send_id![self, allHTTPHeaderFields] - } + ) -> Option, Shared>>; + # [method_id (valueForHTTPHeaderField :)] pub unsafe fn valueForHTTPHeaderField( &self, field: &NSString, - ) -> Option> { - msg_send_id![self, valueForHTTPHeaderField: field] - } - pub unsafe fn HTTPBody(&self) -> Option> { - msg_send_id![self, HTTPBody] - } - pub unsafe fn HTTPBodyStream(&self) -> Option> { - msg_send_id![self, HTTPBodyStream] - } - pub unsafe fn HTTPShouldHandleCookies(&self) -> bool { - msg_send![self, HTTPShouldHandleCookies] - } - pub unsafe fn HTTPShouldUsePipelining(&self) -> bool { - msg_send![self, HTTPShouldUsePipelining] - } + ) -> Option>; + #[method_id(HTTPBody)] + pub unsafe fn HTTPBody(&self) -> Option>; + #[method_id(HTTPBodyStream)] + pub unsafe fn HTTPBodyStream(&self) -> Option>; + #[method(HTTPShouldHandleCookies)] + pub unsafe fn HTTPShouldHandleCookies(&self) -> bool; + #[method(HTTPShouldUsePipelining)] + pub unsafe fn HTTPShouldUsePipelining(&self) -> bool; } ); extern_methods!( #[doc = "NSMutableHTTPURLRequest"] unsafe impl NSMutableURLRequest { - pub unsafe fn HTTPMethod(&self) -> Id { - msg_send_id![self, HTTPMethod] - } - pub unsafe fn setHTTPMethod(&self, HTTPMethod: &NSString) { - msg_send![self, setHTTPMethod: HTTPMethod] - } + #[method_id(HTTPMethod)] + pub unsafe fn HTTPMethod(&self) -> Id; + # [method (setHTTPMethod :)] + pub unsafe fn setHTTPMethod(&self, HTTPMethod: &NSString); + #[method_id(allHTTPHeaderFields)] pub unsafe fn allHTTPHeaderFields( &self, - ) -> Option, Shared>> { - msg_send_id![self, allHTTPHeaderFields] - } + ) -> Option, Shared>>; + # [method (setAllHTTPHeaderFields :)] pub unsafe fn setAllHTTPHeaderFields( &self, allHTTPHeaderFields: Option<&NSDictionary>, - ) { - msg_send![self, setAllHTTPHeaderFields: allHTTPHeaderFields] - } + ); + # [method (setValue : forHTTPHeaderField :)] pub unsafe fn setValue_forHTTPHeaderField( &self, value: Option<&NSString>, field: &NSString, - ) { - msg_send![self, setValue: value, forHTTPHeaderField: field] - } - pub unsafe fn addValue_forHTTPHeaderField(&self, value: &NSString, field: &NSString) { - msg_send![self, addValue: value, forHTTPHeaderField: field] - } - pub unsafe fn HTTPBody(&self) -> Option> { - msg_send_id![self, HTTPBody] - } - pub unsafe fn setHTTPBody(&self, HTTPBody: Option<&NSData>) { - msg_send![self, setHTTPBody: HTTPBody] - } - pub unsafe fn HTTPBodyStream(&self) -> Option> { - msg_send_id![self, HTTPBodyStream] - } - pub unsafe fn setHTTPBodyStream(&self, HTTPBodyStream: Option<&NSInputStream>) { - msg_send![self, setHTTPBodyStream: HTTPBodyStream] - } - pub unsafe fn HTTPShouldHandleCookies(&self) -> bool { - msg_send![self, HTTPShouldHandleCookies] - } - pub unsafe fn setHTTPShouldHandleCookies(&self, HTTPShouldHandleCookies: bool) { - msg_send![self, setHTTPShouldHandleCookies: HTTPShouldHandleCookies] - } - pub unsafe fn HTTPShouldUsePipelining(&self) -> bool { - msg_send![self, HTTPShouldUsePipelining] - } - pub unsafe fn setHTTPShouldUsePipelining(&self, HTTPShouldUsePipelining: bool) { - msg_send![self, setHTTPShouldUsePipelining: HTTPShouldUsePipelining] - } + ); + # [method (addValue : forHTTPHeaderField :)] + pub unsafe fn addValue_forHTTPHeaderField(&self, value: &NSString, field: &NSString); + #[method_id(HTTPBody)] + pub unsafe fn HTTPBody(&self) -> Option>; + # [method (setHTTPBody :)] + pub unsafe fn setHTTPBody(&self, HTTPBody: Option<&NSData>); + #[method_id(HTTPBodyStream)] + pub unsafe fn HTTPBodyStream(&self) -> Option>; + # [method (setHTTPBodyStream :)] + pub unsafe fn setHTTPBodyStream(&self, HTTPBodyStream: Option<&NSInputStream>); + #[method(HTTPShouldHandleCookies)] + pub unsafe fn HTTPShouldHandleCookies(&self) -> bool; + # [method (setHTTPShouldHandleCookies :)] + pub unsafe fn setHTTPShouldHandleCookies(&self, HTTPShouldHandleCookies: bool); + #[method(HTTPShouldUsePipelining)] + pub unsafe fn HTTPShouldUsePipelining(&self) -> bool; + # [method (setHTTPShouldUsePipelining :)] + pub unsafe fn setHTTPShouldUsePipelining(&self, HTTPShouldUsePipelining: bool); } ); diff --git a/icrate/src/Foundation/generated/NSURLResponse.rs b/icrate/src/Foundation/generated/NSURLResponse.rs index e6e2470a7..e4818a12a 100644 --- a/icrate/src/Foundation/generated/NSURLResponse.rs +++ b/icrate/src/Foundation/generated/NSURLResponse.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSURLResponse; @@ -17,36 +17,24 @@ extern_class!( ); extern_methods!( unsafe impl NSURLResponse { + # [method_id (initWithURL : MIMEType : expectedContentLength : textEncodingName :)] pub unsafe fn initWithURL_MIMEType_expectedContentLength_textEncodingName( &self, URL: &NSURL, MIMEType: Option<&NSString>, length: NSInteger, name: Option<&NSString>, - ) -> Id { - msg_send_id![ - self, - initWithURL: URL, - MIMEType: MIMEType, - expectedContentLength: length, - textEncodingName: name - ] - } - pub unsafe fn URL(&self) -> Option> { - msg_send_id![self, URL] - } - pub unsafe fn MIMEType(&self) -> Option> { - msg_send_id![self, MIMEType] - } - pub unsafe fn expectedContentLength(&self) -> c_longlong { - msg_send![self, expectedContentLength] - } - pub unsafe fn textEncodingName(&self) -> Option> { - msg_send_id![self, textEncodingName] - } - pub unsafe fn suggestedFilename(&self) -> Option> { - msg_send_id![self, suggestedFilename] - } + ) -> Id; + #[method_id(URL)] + pub unsafe fn URL(&self) -> Option>; + #[method_id(MIMEType)] + pub unsafe fn MIMEType(&self) -> Option>; + #[method(expectedContentLength)] + pub unsafe fn expectedContentLength(&self) -> c_longlong; + #[method_id(textEncodingName)] + pub unsafe fn textEncodingName(&self) -> Option>; + #[method_id(suggestedFilename)] + pub unsafe fn suggestedFilename(&self) -> Option>; } ); use super::__exported::NSHTTPURLResponseInternal; @@ -59,35 +47,24 @@ extern_class!( ); extern_methods!( unsafe impl NSHTTPURLResponse { + # [method_id (initWithURL : statusCode : HTTPVersion : headerFields :)] pub unsafe fn initWithURL_statusCode_HTTPVersion_headerFields( &self, url: &NSURL, statusCode: NSInteger, HTTPVersion: Option<&NSString>, headerFields: Option<&NSDictionary>, - ) -> Option> { - msg_send_id![ - self, - initWithURL: url, - statusCode: statusCode, - HTTPVersion: HTTPVersion, - headerFields: headerFields - ] - } - pub unsafe fn statusCode(&self) -> NSInteger { - msg_send![self, statusCode] - } - pub unsafe fn allHeaderFields(&self) -> Id { - msg_send_id![self, allHeaderFields] - } + ) -> Option>; + #[method(statusCode)] + pub unsafe fn statusCode(&self) -> NSInteger; + #[method_id(allHeaderFields)] + pub unsafe fn allHeaderFields(&self) -> Id; + # [method_id (valueForHTTPHeaderField :)] pub unsafe fn valueForHTTPHeaderField( &self, field: &NSString, - ) -> Option> { - msg_send_id![self, valueForHTTPHeaderField: field] - } - pub unsafe fn localizedStringForStatusCode(statusCode: NSInteger) -> Id { - msg_send_id![Self::class(), localizedStringForStatusCode: statusCode] - } + ) -> Option>; + # [method_id (localizedStringForStatusCode :)] + pub unsafe fn localizedStringForStatusCode(statusCode: NSInteger) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSURLSession.rs b/icrate/src/Foundation/generated/NSURLSession.rs index 51bc87802..62fbb8ee0 100644 --- a/icrate/src/Foundation/generated/NSURLSession.rs +++ b/icrate/src/Foundation/generated/NSURLSession.rs @@ -26,7 +26,7 @@ use crate::Security::generated::SecureTransport::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSURLSession; @@ -36,230 +36,159 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSession { - pub unsafe fn sharedSession() -> Id { - msg_send_id![Self::class(), sharedSession] - } + #[method_id(sharedSession)] + pub unsafe fn sharedSession() -> Id; + # [method_id (sessionWithConfiguration :)] pub unsafe fn sessionWithConfiguration( configuration: &NSURLSessionConfiguration, - ) -> Id { - msg_send_id![Self::class(), sessionWithConfiguration: configuration] - } + ) -> Id; + # [method_id (sessionWithConfiguration : delegate : delegateQueue :)] pub unsafe fn sessionWithConfiguration_delegate_delegateQueue( configuration: &NSURLSessionConfiguration, delegate: Option<&NSURLSessionDelegate>, queue: Option<&NSOperationQueue>, - ) -> Id { - msg_send_id![ - Self::class(), - sessionWithConfiguration: configuration, - delegate: delegate, - delegateQueue: queue - ] - } - pub unsafe fn delegateQueue(&self) -> Id { - msg_send_id![self, delegateQueue] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn configuration(&self) -> Id { - msg_send_id![self, configuration] - } - pub unsafe fn sessionDescription(&self) -> Option> { - msg_send_id![self, sessionDescription] - } - pub unsafe fn setSessionDescription(&self, sessionDescription: Option<&NSString>) { - msg_send![self, setSessionDescription: sessionDescription] - } - pub unsafe fn finishTasksAndInvalidate(&self) { - msg_send![self, finishTasksAndInvalidate] - } - pub unsafe fn invalidateAndCancel(&self) { - msg_send![self, invalidateAndCancel] - } - pub unsafe fn resetWithCompletionHandler(&self, completionHandler: TodoBlock) { - msg_send![self, resetWithCompletionHandler: completionHandler] - } - pub unsafe fn flushWithCompletionHandler(&self, completionHandler: TodoBlock) { - msg_send![self, flushWithCompletionHandler: completionHandler] - } - pub unsafe fn getTasksWithCompletionHandler(&self, completionHandler: TodoBlock) { - msg_send![self, getTasksWithCompletionHandler: completionHandler] - } - pub unsafe fn getAllTasksWithCompletionHandler(&self, completionHandler: TodoBlock) { - msg_send![self, getAllTasksWithCompletionHandler: completionHandler] - } + ) -> Id; + #[method_id(delegateQueue)] + pub unsafe fn delegateQueue(&self) -> Id; + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + #[method_id(configuration)] + pub unsafe fn configuration(&self) -> Id; + #[method_id(sessionDescription)] + pub unsafe fn sessionDescription(&self) -> Option>; + # [method (setSessionDescription :)] + pub unsafe fn setSessionDescription(&self, sessionDescription: Option<&NSString>); + #[method(finishTasksAndInvalidate)] + pub unsafe fn finishTasksAndInvalidate(&self); + #[method(invalidateAndCancel)] + pub unsafe fn invalidateAndCancel(&self); + # [method (resetWithCompletionHandler :)] + pub unsafe fn resetWithCompletionHandler(&self, completionHandler: TodoBlock); + # [method (flushWithCompletionHandler :)] + pub unsafe fn flushWithCompletionHandler(&self, completionHandler: TodoBlock); + # [method (getTasksWithCompletionHandler :)] + pub unsafe fn getTasksWithCompletionHandler(&self, completionHandler: TodoBlock); + # [method (getAllTasksWithCompletionHandler :)] + pub unsafe fn getAllTasksWithCompletionHandler(&self, completionHandler: TodoBlock); + # [method_id (dataTaskWithRequest :)] pub unsafe fn dataTaskWithRequest( &self, request: &NSURLRequest, - ) -> Id { - msg_send_id![self, dataTaskWithRequest: request] - } - pub unsafe fn dataTaskWithURL(&self, url: &NSURL) -> Id { - msg_send_id![self, dataTaskWithURL: url] - } + ) -> Id; + # [method_id (dataTaskWithURL :)] + pub unsafe fn dataTaskWithURL(&self, url: &NSURL) -> Id; + # [method_id (uploadTaskWithRequest : fromFile :)] pub unsafe fn uploadTaskWithRequest_fromFile( &self, request: &NSURLRequest, fileURL: &NSURL, - ) -> Id { - msg_send_id![self, uploadTaskWithRequest: request, fromFile: fileURL] - } + ) -> Id; + # [method_id (uploadTaskWithRequest : fromData :)] pub unsafe fn uploadTaskWithRequest_fromData( &self, request: &NSURLRequest, bodyData: &NSData, - ) -> Id { - msg_send_id![self, uploadTaskWithRequest: request, fromData: bodyData] - } + ) -> Id; + # [method_id (uploadTaskWithStreamedRequest :)] pub unsafe fn uploadTaskWithStreamedRequest( &self, request: &NSURLRequest, - ) -> Id { - msg_send_id![self, uploadTaskWithStreamedRequest: request] - } + ) -> Id; + # [method_id (downloadTaskWithRequest :)] pub unsafe fn downloadTaskWithRequest( &self, request: &NSURLRequest, - ) -> Id { - msg_send_id![self, downloadTaskWithRequest: request] - } + ) -> Id; + # [method_id (downloadTaskWithURL :)] pub unsafe fn downloadTaskWithURL( &self, url: &NSURL, - ) -> Id { - msg_send_id![self, downloadTaskWithURL: url] - } + ) -> Id; + # [method_id (downloadTaskWithResumeData :)] pub unsafe fn downloadTaskWithResumeData( &self, resumeData: &NSData, - ) -> Id { - msg_send_id![self, downloadTaskWithResumeData: resumeData] - } + ) -> Id; + # [method_id (streamTaskWithHostName : port :)] pub unsafe fn streamTaskWithHostName_port( &self, hostname: &NSString, port: NSInteger, - ) -> Id { - msg_send_id![self, streamTaskWithHostName: hostname, port: port] - } + ) -> Id; + # [method_id (streamTaskWithNetService :)] pub unsafe fn streamTaskWithNetService( &self, service: &NSNetService, - ) -> Id { - msg_send_id![self, streamTaskWithNetService: service] - } + ) -> Id; + # [method_id (webSocketTaskWithURL :)] pub unsafe fn webSocketTaskWithURL( &self, url: &NSURL, - ) -> Id { - msg_send_id![self, webSocketTaskWithURL: url] - } + ) -> Id; + # [method_id (webSocketTaskWithURL : protocols :)] pub unsafe fn webSocketTaskWithURL_protocols( &self, url: &NSURL, protocols: &NSArray, - ) -> Id { - msg_send_id![self, webSocketTaskWithURL: url, protocols: protocols] - } + ) -> Id; + # [method_id (webSocketTaskWithRequest :)] pub unsafe fn webSocketTaskWithRequest( &self, request: &NSURLRequest, - ) -> Id { - msg_send_id![self, webSocketTaskWithRequest: request] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + ) -> Id; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); extern_methods!( #[doc = "NSURLSessionAsynchronousConvenience"] unsafe impl NSURLSession { + # [method_id (dataTaskWithRequest : completionHandler :)] pub unsafe fn dataTaskWithRequest_completionHandler( &self, request: &NSURLRequest, completionHandler: TodoBlock, - ) -> Id { - msg_send_id![ - self, - dataTaskWithRequest: request, - completionHandler: completionHandler - ] - } + ) -> Id; + # [method_id (dataTaskWithURL : completionHandler :)] pub unsafe fn dataTaskWithURL_completionHandler( &self, url: &NSURL, completionHandler: TodoBlock, - ) -> Id { - msg_send_id![ - self, - dataTaskWithURL: url, - completionHandler: completionHandler - ] - } + ) -> Id; + # [method_id (uploadTaskWithRequest : fromFile : completionHandler :)] pub unsafe fn uploadTaskWithRequest_fromFile_completionHandler( &self, request: &NSURLRequest, fileURL: &NSURL, completionHandler: TodoBlock, - ) -> Id { - msg_send_id![ - self, - uploadTaskWithRequest: request, - fromFile: fileURL, - completionHandler: completionHandler - ] - } + ) -> Id; + # [method_id (uploadTaskWithRequest : fromData : completionHandler :)] pub unsafe fn uploadTaskWithRequest_fromData_completionHandler( &self, request: &NSURLRequest, bodyData: Option<&NSData>, completionHandler: TodoBlock, - ) -> Id { - msg_send_id![ - self, - uploadTaskWithRequest: request, - fromData: bodyData, - completionHandler: completionHandler - ] - } + ) -> Id; + # [method_id (downloadTaskWithRequest : completionHandler :)] pub unsafe fn downloadTaskWithRequest_completionHandler( &self, request: &NSURLRequest, completionHandler: TodoBlock, - ) -> Id { - msg_send_id![ - self, - downloadTaskWithRequest: request, - completionHandler: completionHandler - ] - } + ) -> Id; + # [method_id (downloadTaskWithURL : completionHandler :)] pub unsafe fn downloadTaskWithURL_completionHandler( &self, url: &NSURL, completionHandler: TodoBlock, - ) -> Id { - msg_send_id![ - self, - downloadTaskWithURL: url, - completionHandler: completionHandler - ] - } + ) -> Id; + # [method_id (downloadTaskWithResumeData : completionHandler :)] pub unsafe fn downloadTaskWithResumeData_completionHandler( &self, resumeData: &NSData, completionHandler: TodoBlock, - ) -> Id { - msg_send_id![ - self, - downloadTaskWithResumeData: resumeData, - completionHandler: completionHandler - ] - } + ) -> Id; } ); extern_class!( @@ -271,111 +200,72 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSessionTask { - pub unsafe fn taskIdentifier(&self) -> NSUInteger { - msg_send![self, taskIdentifier] - } - pub unsafe fn originalRequest(&self) -> Option> { - msg_send_id![self, originalRequest] - } - pub unsafe fn currentRequest(&self) -> Option> { - msg_send_id![self, currentRequest] - } - pub unsafe fn response(&self) -> Option> { - msg_send_id![self, response] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSURLSessionTaskDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn progress(&self) -> Id { - msg_send_id![self, progress] - } - pub unsafe fn earliestBeginDate(&self) -> Option> { - msg_send_id![self, earliestBeginDate] - } - pub unsafe fn setEarliestBeginDate(&self, earliestBeginDate: Option<&NSDate>) { - msg_send![self, setEarliestBeginDate: earliestBeginDate] - } - pub unsafe fn countOfBytesClientExpectsToSend(&self) -> int64_t { - msg_send![self, countOfBytesClientExpectsToSend] - } + #[method(taskIdentifier)] + pub unsafe fn taskIdentifier(&self) -> NSUInteger; + #[method_id(originalRequest)] + pub unsafe fn originalRequest(&self) -> Option>; + #[method_id(currentRequest)] + pub unsafe fn currentRequest(&self) -> Option>; + #[method_id(response)] + pub unsafe fn response(&self) -> Option>; + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSURLSessionTaskDelegate>); + #[method_id(progress)] + pub unsafe fn progress(&self) -> Id; + #[method_id(earliestBeginDate)] + pub unsafe fn earliestBeginDate(&self) -> Option>; + # [method (setEarliestBeginDate :)] + pub unsafe fn setEarliestBeginDate(&self, earliestBeginDate: Option<&NSDate>); + #[method(countOfBytesClientExpectsToSend)] + pub unsafe fn countOfBytesClientExpectsToSend(&self) -> int64_t; + # [method (setCountOfBytesClientExpectsToSend :)] pub unsafe fn setCountOfBytesClientExpectsToSend( &self, countOfBytesClientExpectsToSend: int64_t, - ) { - msg_send![ - self, - setCountOfBytesClientExpectsToSend: countOfBytesClientExpectsToSend - ] - } - pub unsafe fn countOfBytesClientExpectsToReceive(&self) -> int64_t { - msg_send![self, countOfBytesClientExpectsToReceive] - } + ); + #[method(countOfBytesClientExpectsToReceive)] + pub unsafe fn countOfBytesClientExpectsToReceive(&self) -> int64_t; + # [method (setCountOfBytesClientExpectsToReceive :)] pub unsafe fn setCountOfBytesClientExpectsToReceive( &self, countOfBytesClientExpectsToReceive: int64_t, - ) { - msg_send![ - self, - setCountOfBytesClientExpectsToReceive: countOfBytesClientExpectsToReceive - ] - } - pub unsafe fn countOfBytesSent(&self) -> int64_t { - msg_send![self, countOfBytesSent] - } - pub unsafe fn countOfBytesReceived(&self) -> int64_t { - msg_send![self, countOfBytesReceived] - } - pub unsafe fn countOfBytesExpectedToSend(&self) -> int64_t { - msg_send![self, countOfBytesExpectedToSend] - } - pub unsafe fn countOfBytesExpectedToReceive(&self) -> int64_t { - msg_send![self, countOfBytesExpectedToReceive] - } - pub unsafe fn taskDescription(&self) -> Option> { - msg_send_id![self, taskDescription] - } - pub unsafe fn setTaskDescription(&self, taskDescription: Option<&NSString>) { - msg_send![self, setTaskDescription: taskDescription] - } - pub unsafe fn cancel(&self) { - msg_send![self, cancel] - } - pub unsafe fn state(&self) -> NSURLSessionTaskState { - msg_send![self, state] - } - pub unsafe fn error(&self) -> Option> { - msg_send_id![self, error] - } - pub unsafe fn suspend(&self) { - msg_send![self, suspend] - } - pub unsafe fn resume(&self) { - msg_send![self, resume] - } - pub unsafe fn priority(&self) -> c_float { - msg_send![self, priority] - } - pub unsafe fn setPriority(&self, priority: c_float) { - msg_send![self, setPriority: priority] - } - pub unsafe fn prefersIncrementalDelivery(&self) -> bool { - msg_send![self, prefersIncrementalDelivery] - } - pub unsafe fn setPrefersIncrementalDelivery(&self, prefersIncrementalDelivery: bool) { - msg_send![ - self, - setPrefersIncrementalDelivery: prefersIncrementalDelivery - ] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + ); + #[method(countOfBytesSent)] + pub unsafe fn countOfBytesSent(&self) -> int64_t; + #[method(countOfBytesReceived)] + pub unsafe fn countOfBytesReceived(&self) -> int64_t; + #[method(countOfBytesExpectedToSend)] + pub unsafe fn countOfBytesExpectedToSend(&self) -> int64_t; + #[method(countOfBytesExpectedToReceive)] + pub unsafe fn countOfBytesExpectedToReceive(&self) -> int64_t; + #[method_id(taskDescription)] + pub unsafe fn taskDescription(&self) -> Option>; + # [method (setTaskDescription :)] + pub unsafe fn setTaskDescription(&self, taskDescription: Option<&NSString>); + #[method(cancel)] + pub unsafe fn cancel(&self); + #[method(state)] + pub unsafe fn state(&self) -> NSURLSessionTaskState; + #[method_id(error)] + pub unsafe fn error(&self) -> Option>; + #[method(suspend)] + pub unsafe fn suspend(&self); + #[method(resume)] + pub unsafe fn resume(&self); + #[method(priority)] + pub unsafe fn priority(&self) -> c_float; + # [method (setPriority :)] + pub unsafe fn setPriority(&self, priority: c_float); + #[method(prefersIncrementalDelivery)] + pub unsafe fn prefersIncrementalDelivery(&self) -> bool; + # [method (setPrefersIncrementalDelivery :)] + pub unsafe fn setPrefersIncrementalDelivery(&self, prefersIncrementalDelivery: bool); + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); extern_class!( @@ -387,12 +277,10 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSessionDataTask { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); extern_class!( @@ -404,12 +292,10 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSessionUploadTask { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); extern_class!( @@ -421,15 +307,12 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSessionDownloadTask { - pub unsafe fn cancelByProducingResumeData(&self, completionHandler: TodoBlock) { - msg_send![self, cancelByProducingResumeData: completionHandler] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + # [method (cancelByProducingResumeData :)] + pub unsafe fn cancelByProducingResumeData(&self, completionHandler: TodoBlock); + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); extern_class!( @@ -441,55 +324,35 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSessionStreamTask { + # [method (readDataOfMinLength : maxLength : timeout : completionHandler :)] pub unsafe fn readDataOfMinLength_maxLength_timeout_completionHandler( &self, minBytes: NSUInteger, maxBytes: NSUInteger, timeout: NSTimeInterval, completionHandler: TodoBlock, - ) { - msg_send![ - self, - readDataOfMinLength: minBytes, - maxLength: maxBytes, - timeout: timeout, - completionHandler: completionHandler - ] - } + ); + # [method (writeData : timeout : completionHandler :)] pub unsafe fn writeData_timeout_completionHandler( &self, data: &NSData, timeout: NSTimeInterval, completionHandler: TodoBlock, - ) { - msg_send![ - self, - writeData: data, - timeout: timeout, - completionHandler: completionHandler - ] - } - pub unsafe fn captureStreams(&self) { - msg_send![self, captureStreams] - } - pub unsafe fn closeWrite(&self) { - msg_send![self, closeWrite] - } - pub unsafe fn closeRead(&self) { - msg_send![self, closeRead] - } - pub unsafe fn startSecureConnection(&self) { - msg_send![self, startSecureConnection] - } - pub unsafe fn stopSecureConnection(&self) { - msg_send![self, stopSecureConnection] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + ); + #[method(captureStreams)] + pub unsafe fn captureStreams(&self); + #[method(closeWrite)] + pub unsafe fn closeWrite(&self); + #[method(closeRead)] + pub unsafe fn closeRead(&self); + #[method(startSecureConnection)] + pub unsafe fn startSecureConnection(&self); + #[method(stopSecureConnection)] + pub unsafe fn stopSecureConnection(&self); + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); extern_class!( @@ -501,27 +364,20 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSessionWebSocketMessage { - pub unsafe fn initWithData(&self, data: &NSData) -> Id { - msg_send_id![self, initWithData: data] - } - pub unsafe fn initWithString(&self, string: &NSString) -> Id { - msg_send_id![self, initWithString: string] - } - pub unsafe fn type_(&self) -> NSURLSessionWebSocketMessageType { - msg_send![self, type] - } - pub unsafe fn data(&self) -> Option> { - msg_send_id![self, data] - } - pub unsafe fn string(&self) -> Option> { - msg_send_id![self, string] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + # [method_id (initWithData :)] + pub unsafe fn initWithData(&self, data: &NSData) -> Id; + # [method_id (initWithString :)] + pub unsafe fn initWithString(&self, string: &NSString) -> Id; + #[method(type)] + pub unsafe fn type_(&self) -> NSURLSessionWebSocketMessageType; + #[method_id(data)] + pub unsafe fn data(&self) -> Option>; + #[method_id(string)] + pub unsafe fn string(&self) -> Option>; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); extern_class!( @@ -533,48 +389,34 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSessionWebSocketTask { + # [method (sendMessage : completionHandler :)] pub unsafe fn sendMessage_completionHandler( &self, message: &NSURLSessionWebSocketMessage, completionHandler: TodoBlock, - ) { - msg_send![ - self, - sendMessage: message, - completionHandler: completionHandler - ] - } - pub unsafe fn receiveMessageWithCompletionHandler(&self, completionHandler: TodoBlock) { - msg_send![self, receiveMessageWithCompletionHandler: completionHandler] - } - pub unsafe fn sendPingWithPongReceiveHandler(&self, pongReceiveHandler: TodoBlock) { - msg_send![self, sendPingWithPongReceiveHandler: pongReceiveHandler] - } + ); + # [method (receiveMessageWithCompletionHandler :)] + pub unsafe fn receiveMessageWithCompletionHandler(&self, completionHandler: TodoBlock); + # [method (sendPingWithPongReceiveHandler :)] + pub unsafe fn sendPingWithPongReceiveHandler(&self, pongReceiveHandler: TodoBlock); + # [method (cancelWithCloseCode : reason :)] pub unsafe fn cancelWithCloseCode_reason( &self, closeCode: NSURLSessionWebSocketCloseCode, reason: Option<&NSData>, - ) { - msg_send![self, cancelWithCloseCode: closeCode, reason: reason] - } - pub unsafe fn maximumMessageSize(&self) -> NSInteger { - msg_send![self, maximumMessageSize] - } - pub unsafe fn setMaximumMessageSize(&self, maximumMessageSize: NSInteger) { - msg_send![self, setMaximumMessageSize: maximumMessageSize] - } - pub unsafe fn closeCode(&self) -> NSURLSessionWebSocketCloseCode { - msg_send![self, closeCode] - } - pub unsafe fn closeReason(&self) -> Option> { - msg_send_id![self, closeReason] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + ); + #[method(maximumMessageSize)] + pub unsafe fn maximumMessageSize(&self) -> NSInteger; + # [method (setMaximumMessageSize :)] + pub unsafe fn setMaximumMessageSize(&self, maximumMessageSize: NSInteger); + #[method(closeCode)] + pub unsafe fn closeCode(&self) -> NSURLSessionWebSocketCloseCode; + #[method_id(closeReason)] + pub unsafe fn closeReason(&self) -> Option>; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); extern_class!( @@ -586,275 +428,173 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSessionConfiguration { - pub unsafe fn defaultSessionConfiguration() -> Id { - msg_send_id![Self::class(), defaultSessionConfiguration] - } - pub unsafe fn ephemeralSessionConfiguration() -> Id { - msg_send_id![Self::class(), ephemeralSessionConfiguration] - } + #[method_id(defaultSessionConfiguration)] + pub unsafe fn defaultSessionConfiguration() -> Id; + #[method_id(ephemeralSessionConfiguration)] + pub unsafe fn ephemeralSessionConfiguration() -> Id; + # [method_id (backgroundSessionConfigurationWithIdentifier :)] pub unsafe fn backgroundSessionConfigurationWithIdentifier( identifier: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - backgroundSessionConfigurationWithIdentifier: identifier - ] - } - pub unsafe fn identifier(&self) -> Option> { - msg_send_id![self, identifier] - } - pub unsafe fn requestCachePolicy(&self) -> NSURLRequestCachePolicy { - msg_send![self, requestCachePolicy] - } - pub unsafe fn setRequestCachePolicy(&self, requestCachePolicy: NSURLRequestCachePolicy) { - msg_send![self, setRequestCachePolicy: requestCachePolicy] - } - pub unsafe fn timeoutIntervalForRequest(&self) -> NSTimeInterval { - msg_send![self, timeoutIntervalForRequest] - } + ) -> Id; + #[method_id(identifier)] + pub unsafe fn identifier(&self) -> Option>; + #[method(requestCachePolicy)] + pub unsafe fn requestCachePolicy(&self) -> NSURLRequestCachePolicy; + # [method (setRequestCachePolicy :)] + pub unsafe fn setRequestCachePolicy(&self, requestCachePolicy: NSURLRequestCachePolicy); + #[method(timeoutIntervalForRequest)] + pub unsafe fn timeoutIntervalForRequest(&self) -> NSTimeInterval; + # [method (setTimeoutIntervalForRequest :)] pub unsafe fn setTimeoutIntervalForRequest( &self, timeoutIntervalForRequest: NSTimeInterval, - ) { - msg_send![ - self, - setTimeoutIntervalForRequest: timeoutIntervalForRequest - ] - } - pub unsafe fn timeoutIntervalForResource(&self) -> NSTimeInterval { - msg_send![self, timeoutIntervalForResource] - } + ); + #[method(timeoutIntervalForResource)] + pub unsafe fn timeoutIntervalForResource(&self) -> NSTimeInterval; + # [method (setTimeoutIntervalForResource :)] pub unsafe fn setTimeoutIntervalForResource( &self, timeoutIntervalForResource: NSTimeInterval, - ) { - msg_send![ - self, - setTimeoutIntervalForResource: timeoutIntervalForResource - ] - } - pub unsafe fn networkServiceType(&self) -> NSURLRequestNetworkServiceType { - msg_send![self, networkServiceType] - } + ); + #[method(networkServiceType)] + pub unsafe fn networkServiceType(&self) -> NSURLRequestNetworkServiceType; + # [method (setNetworkServiceType :)] pub unsafe fn setNetworkServiceType( &self, networkServiceType: NSURLRequestNetworkServiceType, - ) { - msg_send![self, setNetworkServiceType: networkServiceType] - } - pub unsafe fn allowsCellularAccess(&self) -> bool { - msg_send![self, allowsCellularAccess] - } - pub unsafe fn setAllowsCellularAccess(&self, allowsCellularAccess: bool) { - msg_send![self, setAllowsCellularAccess: allowsCellularAccess] - } - pub unsafe fn allowsExpensiveNetworkAccess(&self) -> bool { - msg_send![self, allowsExpensiveNetworkAccess] - } - pub unsafe fn setAllowsExpensiveNetworkAccess(&self, allowsExpensiveNetworkAccess: bool) { - msg_send![ - self, - setAllowsExpensiveNetworkAccess: allowsExpensiveNetworkAccess - ] - } - pub unsafe fn allowsConstrainedNetworkAccess(&self) -> bool { - msg_send![self, allowsConstrainedNetworkAccess] - } + ); + #[method(allowsCellularAccess)] + pub unsafe fn allowsCellularAccess(&self) -> bool; + # [method (setAllowsCellularAccess :)] + pub unsafe fn setAllowsCellularAccess(&self, allowsCellularAccess: bool); + #[method(allowsExpensiveNetworkAccess)] + pub unsafe fn allowsExpensiveNetworkAccess(&self) -> bool; + # [method (setAllowsExpensiveNetworkAccess :)] + pub unsafe fn setAllowsExpensiveNetworkAccess(&self, allowsExpensiveNetworkAccess: bool); + #[method(allowsConstrainedNetworkAccess)] + pub unsafe fn allowsConstrainedNetworkAccess(&self) -> bool; + # [method (setAllowsConstrainedNetworkAccess :)] pub unsafe fn setAllowsConstrainedNetworkAccess( &self, allowsConstrainedNetworkAccess: bool, - ) { - msg_send![ - self, - setAllowsConstrainedNetworkAccess: allowsConstrainedNetworkAccess - ] - } - pub unsafe fn waitsForConnectivity(&self) -> bool { - msg_send![self, waitsForConnectivity] - } - pub unsafe fn setWaitsForConnectivity(&self, waitsForConnectivity: bool) { - msg_send![self, setWaitsForConnectivity: waitsForConnectivity] - } - pub unsafe fn isDiscretionary(&self) -> bool { - msg_send![self, isDiscretionary] - } - pub unsafe fn setDiscretionary(&self, discretionary: bool) { - msg_send![self, setDiscretionary: discretionary] - } - pub unsafe fn sharedContainerIdentifier(&self) -> Option> { - msg_send_id![self, sharedContainerIdentifier] - } + ); + #[method(waitsForConnectivity)] + pub unsafe fn waitsForConnectivity(&self) -> bool; + # [method (setWaitsForConnectivity :)] + pub unsafe fn setWaitsForConnectivity(&self, waitsForConnectivity: bool); + #[method(isDiscretionary)] + pub unsafe fn isDiscretionary(&self) -> bool; + # [method (setDiscretionary :)] + pub unsafe fn setDiscretionary(&self, discretionary: bool); + #[method_id(sharedContainerIdentifier)] + pub unsafe fn sharedContainerIdentifier(&self) -> Option>; + # [method (setSharedContainerIdentifier :)] pub unsafe fn setSharedContainerIdentifier( &self, sharedContainerIdentifier: Option<&NSString>, - ) { - msg_send![ - self, - setSharedContainerIdentifier: sharedContainerIdentifier - ] - } - pub unsafe fn sessionSendsLaunchEvents(&self) -> bool { - msg_send![self, sessionSendsLaunchEvents] - } - pub unsafe fn setSessionSendsLaunchEvents(&self, sessionSendsLaunchEvents: bool) { - msg_send![self, setSessionSendsLaunchEvents: sessionSendsLaunchEvents] - } - pub unsafe fn connectionProxyDictionary(&self) -> Option> { - msg_send_id![self, connectionProxyDictionary] - } + ); + #[method(sessionSendsLaunchEvents)] + pub unsafe fn sessionSendsLaunchEvents(&self) -> bool; + # [method (setSessionSendsLaunchEvents :)] + pub unsafe fn setSessionSendsLaunchEvents(&self, sessionSendsLaunchEvents: bool); + #[method_id(connectionProxyDictionary)] + pub unsafe fn connectionProxyDictionary(&self) -> Option>; + # [method (setConnectionProxyDictionary :)] pub unsafe fn setConnectionProxyDictionary( &self, connectionProxyDictionary: Option<&NSDictionary>, - ) { - msg_send![ - self, - setConnectionProxyDictionary: connectionProxyDictionary - ] - } - pub unsafe fn TLSMinimumSupportedProtocol(&self) -> SSLProtocol { - msg_send![self, TLSMinimumSupportedProtocol] - } + ); + #[method(TLSMinimumSupportedProtocol)] + pub unsafe fn TLSMinimumSupportedProtocol(&self) -> SSLProtocol; + # [method (setTLSMinimumSupportedProtocol :)] pub unsafe fn setTLSMinimumSupportedProtocol( &self, TLSMinimumSupportedProtocol: SSLProtocol, - ) { - msg_send![ - self, - setTLSMinimumSupportedProtocol: TLSMinimumSupportedProtocol - ] - } - pub unsafe fn TLSMaximumSupportedProtocol(&self) -> SSLProtocol { - msg_send![self, TLSMaximumSupportedProtocol] - } + ); + #[method(TLSMaximumSupportedProtocol)] + pub unsafe fn TLSMaximumSupportedProtocol(&self) -> SSLProtocol; + # [method (setTLSMaximumSupportedProtocol :)] pub unsafe fn setTLSMaximumSupportedProtocol( &self, TLSMaximumSupportedProtocol: SSLProtocol, - ) { - msg_send![ - self, - setTLSMaximumSupportedProtocol: TLSMaximumSupportedProtocol - ] - } - pub unsafe fn TLSMinimumSupportedProtocolVersion(&self) -> tls_protocol_version_t { - msg_send![self, TLSMinimumSupportedProtocolVersion] - } + ); + #[method(TLSMinimumSupportedProtocolVersion)] + pub unsafe fn TLSMinimumSupportedProtocolVersion(&self) -> tls_protocol_version_t; + # [method (setTLSMinimumSupportedProtocolVersion :)] pub unsafe fn setTLSMinimumSupportedProtocolVersion( &self, TLSMinimumSupportedProtocolVersion: tls_protocol_version_t, - ) { - msg_send![ - self, - setTLSMinimumSupportedProtocolVersion: TLSMinimumSupportedProtocolVersion - ] - } - pub unsafe fn TLSMaximumSupportedProtocolVersion(&self) -> tls_protocol_version_t { - msg_send![self, TLSMaximumSupportedProtocolVersion] - } + ); + #[method(TLSMaximumSupportedProtocolVersion)] + pub unsafe fn TLSMaximumSupportedProtocolVersion(&self) -> tls_protocol_version_t; + # [method (setTLSMaximumSupportedProtocolVersion :)] pub unsafe fn setTLSMaximumSupportedProtocolVersion( &self, TLSMaximumSupportedProtocolVersion: tls_protocol_version_t, - ) { - msg_send![ - self, - setTLSMaximumSupportedProtocolVersion: TLSMaximumSupportedProtocolVersion - ] - } - pub unsafe fn HTTPShouldUsePipelining(&self) -> bool { - msg_send![self, HTTPShouldUsePipelining] - } - pub unsafe fn setHTTPShouldUsePipelining(&self, HTTPShouldUsePipelining: bool) { - msg_send![self, setHTTPShouldUsePipelining: HTTPShouldUsePipelining] - } - pub unsafe fn HTTPShouldSetCookies(&self) -> bool { - msg_send![self, HTTPShouldSetCookies] - } - pub unsafe fn setHTTPShouldSetCookies(&self, HTTPShouldSetCookies: bool) { - msg_send![self, setHTTPShouldSetCookies: HTTPShouldSetCookies] - } - pub unsafe fn HTTPCookieAcceptPolicy(&self) -> NSHTTPCookieAcceptPolicy { - msg_send![self, HTTPCookieAcceptPolicy] - } + ); + #[method(HTTPShouldUsePipelining)] + pub unsafe fn HTTPShouldUsePipelining(&self) -> bool; + # [method (setHTTPShouldUsePipelining :)] + pub unsafe fn setHTTPShouldUsePipelining(&self, HTTPShouldUsePipelining: bool); + #[method(HTTPShouldSetCookies)] + pub unsafe fn HTTPShouldSetCookies(&self) -> bool; + # [method (setHTTPShouldSetCookies :)] + pub unsafe fn setHTTPShouldSetCookies(&self, HTTPShouldSetCookies: bool); + #[method(HTTPCookieAcceptPolicy)] + pub unsafe fn HTTPCookieAcceptPolicy(&self) -> NSHTTPCookieAcceptPolicy; + # [method (setHTTPCookieAcceptPolicy :)] pub unsafe fn setHTTPCookieAcceptPolicy( &self, HTTPCookieAcceptPolicy: NSHTTPCookieAcceptPolicy, - ) { - msg_send![self, setHTTPCookieAcceptPolicy: HTTPCookieAcceptPolicy] - } - pub unsafe fn HTTPAdditionalHeaders(&self) -> Option> { - msg_send_id![self, HTTPAdditionalHeaders] - } - pub unsafe fn setHTTPAdditionalHeaders( - &self, - HTTPAdditionalHeaders: Option<&NSDictionary>, - ) { - msg_send![self, setHTTPAdditionalHeaders: HTTPAdditionalHeaders] - } - pub unsafe fn HTTPMaximumConnectionsPerHost(&self) -> NSInteger { - msg_send![self, HTTPMaximumConnectionsPerHost] - } + ); + #[method_id(HTTPAdditionalHeaders)] + pub unsafe fn HTTPAdditionalHeaders(&self) -> Option>; + # [method (setHTTPAdditionalHeaders :)] + pub unsafe fn setHTTPAdditionalHeaders(&self, HTTPAdditionalHeaders: Option<&NSDictionary>); + #[method(HTTPMaximumConnectionsPerHost)] + pub unsafe fn HTTPMaximumConnectionsPerHost(&self) -> NSInteger; + # [method (setHTTPMaximumConnectionsPerHost :)] pub unsafe fn setHTTPMaximumConnectionsPerHost( &self, HTTPMaximumConnectionsPerHost: NSInteger, - ) { - msg_send![ - self, - setHTTPMaximumConnectionsPerHost: HTTPMaximumConnectionsPerHost - ] - } - pub unsafe fn HTTPCookieStorage(&self) -> Option> { - msg_send_id![self, HTTPCookieStorage] - } - pub unsafe fn setHTTPCookieStorage(&self, HTTPCookieStorage: Option<&NSHTTPCookieStorage>) { - msg_send![self, setHTTPCookieStorage: HTTPCookieStorage] - } - pub unsafe fn URLCredentialStorage(&self) -> Option> { - msg_send_id![self, URLCredentialStorage] - } + ); + #[method_id(HTTPCookieStorage)] + pub unsafe fn HTTPCookieStorage(&self) -> Option>; + # [method (setHTTPCookieStorage :)] + pub unsafe fn setHTTPCookieStorage(&self, HTTPCookieStorage: Option<&NSHTTPCookieStorage>); + #[method_id(URLCredentialStorage)] + pub unsafe fn URLCredentialStorage(&self) -> Option>; + # [method (setURLCredentialStorage :)] pub unsafe fn setURLCredentialStorage( &self, URLCredentialStorage: Option<&NSURLCredentialStorage>, - ) { - msg_send![self, setURLCredentialStorage: URLCredentialStorage] - } - pub unsafe fn URLCache(&self) -> Option> { - msg_send_id![self, URLCache] - } - pub unsafe fn setURLCache(&self, URLCache: Option<&NSURLCache>) { - msg_send![self, setURLCache: URLCache] - } - pub unsafe fn shouldUseExtendedBackgroundIdleMode(&self) -> bool { - msg_send![self, shouldUseExtendedBackgroundIdleMode] - } + ); + #[method_id(URLCache)] + pub unsafe fn URLCache(&self) -> Option>; + # [method (setURLCache :)] + pub unsafe fn setURLCache(&self, URLCache: Option<&NSURLCache>); + #[method(shouldUseExtendedBackgroundIdleMode)] + pub unsafe fn shouldUseExtendedBackgroundIdleMode(&self) -> bool; + # [method (setShouldUseExtendedBackgroundIdleMode :)] pub unsafe fn setShouldUseExtendedBackgroundIdleMode( &self, shouldUseExtendedBackgroundIdleMode: bool, - ) { - msg_send![ - self, - setShouldUseExtendedBackgroundIdleMode: shouldUseExtendedBackgroundIdleMode - ] - } - pub unsafe fn protocolClasses(&self) -> Option, Shared>> { - msg_send_id![self, protocolClasses] - } - pub unsafe fn setProtocolClasses(&self, protocolClasses: Option<&NSArray>) { - msg_send![self, setProtocolClasses: protocolClasses] - } - pub unsafe fn multipathServiceType(&self) -> NSURLSessionMultipathServiceType { - msg_send![self, multipathServiceType] - } + ); + #[method_id(protocolClasses)] + pub unsafe fn protocolClasses(&self) -> Option, Shared>>; + # [method (setProtocolClasses :)] + pub unsafe fn setProtocolClasses(&self, protocolClasses: Option<&NSArray>); + #[method(multipathServiceType)] + pub unsafe fn multipathServiceType(&self) -> NSURLSessionMultipathServiceType; + # [method (setMultipathServiceType :)] pub unsafe fn setMultipathServiceType( &self, multipathServiceType: NSURLSessionMultipathServiceType, - ) { - msg_send![self, setMultipathServiceType: multipathServiceType] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + ); + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); pub type NSURLSessionDelegate = NSObject; @@ -866,11 +606,10 @@ pub type NSURLSessionWebSocketDelegate = NSObject; extern_methods!( #[doc = "NSURLSessionDeprecated"] unsafe impl NSURLSessionConfiguration { + # [method_id (backgroundSessionConfiguration :)] pub unsafe fn backgroundSessionConfiguration( identifier: &NSString, - ) -> Id { - msg_send_id![Self::class(), backgroundSessionConfiguration: identifier] - } + ) -> Id; } ); extern_class!( @@ -882,116 +621,80 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSessionTaskTransactionMetrics { - pub unsafe fn request(&self) -> Id { - msg_send_id![self, request] - } - pub unsafe fn response(&self) -> Option> { - msg_send_id![self, response] - } - pub unsafe fn fetchStartDate(&self) -> Option> { - msg_send_id![self, fetchStartDate] - } - pub unsafe fn domainLookupStartDate(&self) -> Option> { - msg_send_id![self, domainLookupStartDate] - } - pub unsafe fn domainLookupEndDate(&self) -> Option> { - msg_send_id![self, domainLookupEndDate] - } - pub unsafe fn connectStartDate(&self) -> Option> { - msg_send_id![self, connectStartDate] - } - pub unsafe fn secureConnectionStartDate(&self) -> Option> { - msg_send_id![self, secureConnectionStartDate] - } - pub unsafe fn secureConnectionEndDate(&self) -> Option> { - msg_send_id![self, secureConnectionEndDate] - } - pub unsafe fn connectEndDate(&self) -> Option> { - msg_send_id![self, connectEndDate] - } - pub unsafe fn requestStartDate(&self) -> Option> { - msg_send_id![self, requestStartDate] - } - pub unsafe fn requestEndDate(&self) -> Option> { - msg_send_id![self, requestEndDate] - } - pub unsafe fn responseStartDate(&self) -> Option> { - msg_send_id![self, responseStartDate] - } - pub unsafe fn responseEndDate(&self) -> Option> { - msg_send_id![self, responseEndDate] - } - pub unsafe fn networkProtocolName(&self) -> Option> { - msg_send_id![self, networkProtocolName] - } - pub unsafe fn isProxyConnection(&self) -> bool { - msg_send![self, isProxyConnection] - } - pub unsafe fn isReusedConnection(&self) -> bool { - msg_send![self, isReusedConnection] - } - pub unsafe fn resourceFetchType(&self) -> NSURLSessionTaskMetricsResourceFetchType { - msg_send![self, resourceFetchType] - } - pub unsafe fn countOfRequestHeaderBytesSent(&self) -> int64_t { - msg_send![self, countOfRequestHeaderBytesSent] - } - pub unsafe fn countOfRequestBodyBytesSent(&self) -> int64_t { - msg_send![self, countOfRequestBodyBytesSent] - } - pub unsafe fn countOfRequestBodyBytesBeforeEncoding(&self) -> int64_t { - msg_send![self, countOfRequestBodyBytesBeforeEncoding] - } - pub unsafe fn countOfResponseHeaderBytesReceived(&self) -> int64_t { - msg_send![self, countOfResponseHeaderBytesReceived] - } - pub unsafe fn countOfResponseBodyBytesReceived(&self) -> int64_t { - msg_send![self, countOfResponseBodyBytesReceived] - } - pub unsafe fn countOfResponseBodyBytesAfterDecoding(&self) -> int64_t { - msg_send![self, countOfResponseBodyBytesAfterDecoding] - } - pub unsafe fn localAddress(&self) -> Option> { - msg_send_id![self, localAddress] - } - pub unsafe fn localPort(&self) -> Option> { - msg_send_id![self, localPort] - } - pub unsafe fn remoteAddress(&self) -> Option> { - msg_send_id![self, remoteAddress] - } - pub unsafe fn remotePort(&self) -> Option> { - msg_send_id![self, remotePort] - } - pub unsafe fn negotiatedTLSProtocolVersion(&self) -> Option> { - msg_send_id![self, negotiatedTLSProtocolVersion] - } - pub unsafe fn negotiatedTLSCipherSuite(&self) -> Option> { - msg_send_id![self, negotiatedTLSCipherSuite] - } - pub unsafe fn isCellular(&self) -> bool { - msg_send![self, isCellular] - } - pub unsafe fn isExpensive(&self) -> bool { - msg_send![self, isExpensive] - } - pub unsafe fn isConstrained(&self) -> bool { - msg_send![self, isConstrained] - } - pub unsafe fn isMultipath(&self) -> bool { - msg_send![self, isMultipath] - } + #[method_id(request)] + pub unsafe fn request(&self) -> Id; + #[method_id(response)] + pub unsafe fn response(&self) -> Option>; + #[method_id(fetchStartDate)] + pub unsafe fn fetchStartDate(&self) -> Option>; + #[method_id(domainLookupStartDate)] + pub unsafe fn domainLookupStartDate(&self) -> Option>; + #[method_id(domainLookupEndDate)] + pub unsafe fn domainLookupEndDate(&self) -> Option>; + #[method_id(connectStartDate)] + pub unsafe fn connectStartDate(&self) -> Option>; + #[method_id(secureConnectionStartDate)] + pub unsafe fn secureConnectionStartDate(&self) -> Option>; + #[method_id(secureConnectionEndDate)] + pub unsafe fn secureConnectionEndDate(&self) -> Option>; + #[method_id(connectEndDate)] + pub unsafe fn connectEndDate(&self) -> Option>; + #[method_id(requestStartDate)] + pub unsafe fn requestStartDate(&self) -> Option>; + #[method_id(requestEndDate)] + pub unsafe fn requestEndDate(&self) -> Option>; + #[method_id(responseStartDate)] + pub unsafe fn responseStartDate(&self) -> Option>; + #[method_id(responseEndDate)] + pub unsafe fn responseEndDate(&self) -> Option>; + #[method_id(networkProtocolName)] + pub unsafe fn networkProtocolName(&self) -> Option>; + #[method(isProxyConnection)] + pub unsafe fn isProxyConnection(&self) -> bool; + #[method(isReusedConnection)] + pub unsafe fn isReusedConnection(&self) -> bool; + #[method(resourceFetchType)] + pub unsafe fn resourceFetchType(&self) -> NSURLSessionTaskMetricsResourceFetchType; + #[method(countOfRequestHeaderBytesSent)] + pub unsafe fn countOfRequestHeaderBytesSent(&self) -> int64_t; + #[method(countOfRequestBodyBytesSent)] + pub unsafe fn countOfRequestBodyBytesSent(&self) -> int64_t; + #[method(countOfRequestBodyBytesBeforeEncoding)] + pub unsafe fn countOfRequestBodyBytesBeforeEncoding(&self) -> int64_t; + #[method(countOfResponseHeaderBytesReceived)] + pub unsafe fn countOfResponseHeaderBytesReceived(&self) -> int64_t; + #[method(countOfResponseBodyBytesReceived)] + pub unsafe fn countOfResponseBodyBytesReceived(&self) -> int64_t; + #[method(countOfResponseBodyBytesAfterDecoding)] + pub unsafe fn countOfResponseBodyBytesAfterDecoding(&self) -> int64_t; + #[method_id(localAddress)] + pub unsafe fn localAddress(&self) -> Option>; + #[method_id(localPort)] + pub unsafe fn localPort(&self) -> Option>; + #[method_id(remoteAddress)] + pub unsafe fn remoteAddress(&self) -> Option>; + #[method_id(remotePort)] + pub unsafe fn remotePort(&self) -> Option>; + #[method_id(negotiatedTLSProtocolVersion)] + pub unsafe fn negotiatedTLSProtocolVersion(&self) -> Option>; + #[method_id(negotiatedTLSCipherSuite)] + pub unsafe fn negotiatedTLSCipherSuite(&self) -> Option>; + #[method(isCellular)] + pub unsafe fn isCellular(&self) -> bool; + #[method(isExpensive)] + pub unsafe fn isExpensive(&self) -> bool; + #[method(isConstrained)] + pub unsafe fn isConstrained(&self) -> bool; + #[method(isMultipath)] + pub unsafe fn isMultipath(&self) -> bool; + #[method(domainResolutionProtocol)] pub unsafe fn domainResolutionProtocol( &self, - ) -> NSURLSessionTaskMetricsDomainResolutionProtocol { - msg_send![self, domainResolutionProtocol] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + ) -> NSURLSessionTaskMetricsDomainResolutionProtocol; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); extern_class!( @@ -1003,22 +706,17 @@ extern_class!( ); extern_methods!( unsafe impl NSURLSessionTaskMetrics { + #[method_id(transactionMetrics)] pub unsafe fn transactionMetrics( &self, - ) -> Id, Shared> { - msg_send_id![self, transactionMetrics] - } - pub unsafe fn taskInterval(&self) -> Id { - msg_send_id![self, taskInterval] - } - pub unsafe fn redirectCount(&self) -> NSUInteger { - msg_send![self, redirectCount] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } + ) -> Id, Shared>; + #[method_id(taskInterval)] + pub unsafe fn taskInterval(&self) -> Id; + #[method(redirectCount)] + pub unsafe fn redirectCount(&self) -> NSUInteger; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSUUID.rs b/icrate/src/Foundation/generated/NSUUID.rs index 1100ec073..ca0d348fe 100644 --- a/icrate/src/Foundation/generated/NSUUID.rs +++ b/icrate/src/Foundation/generated/NSUUID.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSUUID; @@ -14,26 +14,19 @@ extern_class!( ); extern_methods!( unsafe impl NSUUID { - pub unsafe fn UUID() -> Id { - msg_send_id![Self::class(), UUID] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithUUIDString(&self, string: &NSString) -> Option> { - msg_send_id![self, initWithUUIDString: string] - } - pub unsafe fn initWithUUIDBytes(&self, bytes: uuid_t) -> Id { - msg_send_id![self, initWithUUIDBytes: bytes] - } - pub unsafe fn getUUIDBytes(&self, uuid: uuid_t) { - msg_send![self, getUUIDBytes: uuid] - } - pub unsafe fn compare(&self, otherUUID: &NSUUID) -> NSComparisonResult { - msg_send![self, compare: otherUUID] - } - pub unsafe fn UUIDString(&self) -> Id { - msg_send_id![self, UUIDString] - } + #[method_id(UUID)] + pub unsafe fn UUID() -> Id; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithUUIDString :)] + pub unsafe fn initWithUUIDString(&self, string: &NSString) -> Option>; + # [method_id (initWithUUIDBytes :)] + pub unsafe fn initWithUUIDBytes(&self, bytes: uuid_t) -> Id; + # [method (getUUIDBytes :)] + pub unsafe fn getUUIDBytes(&self, uuid: uuid_t); + # [method (compare :)] + pub unsafe fn compare(&self, otherUUID: &NSUUID) -> NSComparisonResult; + #[method_id(UUIDString)] + pub unsafe fn UUIDString(&self) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSUbiquitousKeyValueStore.rs b/icrate/src/Foundation/generated/NSUbiquitousKeyValueStore.rs index 035e1e37e..f778fa477 100644 --- a/icrate/src/Foundation/generated/NSUbiquitousKeyValueStore.rs +++ b/icrate/src/Foundation/generated/NSUbiquitousKeyValueStore.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSUbiquitousKeyValueStore; @@ -17,74 +17,53 @@ extern_class!( ); extern_methods!( unsafe impl NSUbiquitousKeyValueStore { - pub unsafe fn defaultStore() -> Id { - msg_send_id![Self::class(), defaultStore] - } - pub unsafe fn objectForKey(&self, aKey: &NSString) -> Option> { - msg_send_id![self, objectForKey: aKey] - } - pub unsafe fn setObject_forKey(&self, anObject: Option<&Object>, aKey: &NSString) { - msg_send![self, setObject: anObject, forKey: aKey] - } - pub unsafe fn removeObjectForKey(&self, aKey: &NSString) { - msg_send![self, removeObjectForKey: aKey] - } - pub unsafe fn stringForKey(&self, aKey: &NSString) -> Option> { - msg_send_id![self, stringForKey: aKey] - } - pub unsafe fn arrayForKey(&self, aKey: &NSString) -> Option> { - msg_send_id![self, arrayForKey: aKey] - } + #[method_id(defaultStore)] + pub unsafe fn defaultStore() -> Id; + # [method_id (objectForKey :)] + pub unsafe fn objectForKey(&self, aKey: &NSString) -> Option>; + # [method (setObject : forKey :)] + pub unsafe fn setObject_forKey(&self, anObject: Option<&Object>, aKey: &NSString); + # [method (removeObjectForKey :)] + pub unsafe fn removeObjectForKey(&self, aKey: &NSString); + # [method_id (stringForKey :)] + pub unsafe fn stringForKey(&self, aKey: &NSString) -> Option>; + # [method_id (arrayForKey :)] + pub unsafe fn arrayForKey(&self, aKey: &NSString) -> Option>; + # [method_id (dictionaryForKey :)] pub unsafe fn dictionaryForKey( &self, aKey: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, dictionaryForKey: aKey] - } - pub unsafe fn dataForKey(&self, aKey: &NSString) -> Option> { - msg_send_id![self, dataForKey: aKey] - } - pub unsafe fn longLongForKey(&self, aKey: &NSString) -> c_longlong { - msg_send![self, longLongForKey: aKey] - } - pub unsafe fn doubleForKey(&self, aKey: &NSString) -> c_double { - msg_send![self, doubleForKey: aKey] - } - pub unsafe fn boolForKey(&self, aKey: &NSString) -> bool { - msg_send![self, boolForKey: aKey] - } - pub unsafe fn setString_forKey(&self, aString: Option<&NSString>, aKey: &NSString) { - msg_send![self, setString: aString, forKey: aKey] - } - pub unsafe fn setData_forKey(&self, aData: Option<&NSData>, aKey: &NSString) { - msg_send![self, setData: aData, forKey: aKey] - } - pub unsafe fn setArray_forKey(&self, anArray: Option<&NSArray>, aKey: &NSString) { - msg_send![self, setArray: anArray, forKey: aKey] - } + ) -> Option, Shared>>; + # [method_id (dataForKey :)] + pub unsafe fn dataForKey(&self, aKey: &NSString) -> Option>; + # [method (longLongForKey :)] + pub unsafe fn longLongForKey(&self, aKey: &NSString) -> c_longlong; + # [method (doubleForKey :)] + pub unsafe fn doubleForKey(&self, aKey: &NSString) -> c_double; + # [method (boolForKey :)] + pub unsafe fn boolForKey(&self, aKey: &NSString) -> bool; + # [method (setString : forKey :)] + pub unsafe fn setString_forKey(&self, aString: Option<&NSString>, aKey: &NSString); + # [method (setData : forKey :)] + pub unsafe fn setData_forKey(&self, aData: Option<&NSData>, aKey: &NSString); + # [method (setArray : forKey :)] + pub unsafe fn setArray_forKey(&self, anArray: Option<&NSArray>, aKey: &NSString); + # [method (setDictionary : forKey :)] pub unsafe fn setDictionary_forKey( &self, aDictionary: Option<&NSDictionary>, aKey: &NSString, - ) { - msg_send![self, setDictionary: aDictionary, forKey: aKey] - } - pub unsafe fn setLongLong_forKey(&self, value: c_longlong, aKey: &NSString) { - msg_send![self, setLongLong: value, forKey: aKey] - } - pub unsafe fn setDouble_forKey(&self, value: c_double, aKey: &NSString) { - msg_send![self, setDouble: value, forKey: aKey] - } - pub unsafe fn setBool_forKey(&self, value: bool, aKey: &NSString) { - msg_send![self, setBool: value, forKey: aKey] - } - pub unsafe fn dictionaryRepresentation( - &self, - ) -> Id, Shared> { - msg_send_id![self, dictionaryRepresentation] - } - pub unsafe fn synchronize(&self) -> bool { - msg_send![self, synchronize] - } + ); + # [method (setLongLong : forKey :)] + pub unsafe fn setLongLong_forKey(&self, value: c_longlong, aKey: &NSString); + # [method (setDouble : forKey :)] + pub unsafe fn setDouble_forKey(&self, value: c_double, aKey: &NSString); + # [method (setBool : forKey :)] + pub unsafe fn setBool_forKey(&self, value: bool, aKey: &NSString); + #[method_id(dictionaryRepresentation)] + pub unsafe fn dictionaryRepresentation(&self) + -> Id, Shared>; + #[method(synchronize)] + pub unsafe fn synchronize(&self) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSUndoManager.rs b/icrate/src/Foundation/generated/NSUndoManager.rs index a13a26b59..a7cca9eaf 100644 --- a/icrate/src/Foundation/generated/NSUndoManager.rs +++ b/icrate/src/Foundation/generated/NSUndoManager.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSRunLoop::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSUndoManager; @@ -16,127 +16,88 @@ extern_class!( ); extern_methods!( unsafe impl NSUndoManager { - pub unsafe fn beginUndoGrouping(&self) { - msg_send![self, beginUndoGrouping] - } - pub unsafe fn endUndoGrouping(&self) { - msg_send![self, endUndoGrouping] - } - pub unsafe fn groupingLevel(&self) -> NSInteger { - msg_send![self, groupingLevel] - } - pub unsafe fn disableUndoRegistration(&self) { - msg_send![self, disableUndoRegistration] - } - pub unsafe fn enableUndoRegistration(&self) { - msg_send![self, enableUndoRegistration] - } - pub unsafe fn isUndoRegistrationEnabled(&self) -> bool { - msg_send![self, isUndoRegistrationEnabled] - } - pub unsafe fn groupsByEvent(&self) -> bool { - msg_send![self, groupsByEvent] - } - pub unsafe fn setGroupsByEvent(&self, groupsByEvent: bool) { - msg_send![self, setGroupsByEvent: groupsByEvent] - } - pub unsafe fn levelsOfUndo(&self) -> NSUInteger { - msg_send![self, levelsOfUndo] - } - pub unsafe fn setLevelsOfUndo(&self, levelsOfUndo: NSUInteger) { - msg_send![self, setLevelsOfUndo: levelsOfUndo] - } - pub unsafe fn runLoopModes(&self) -> Id, Shared> { - msg_send_id![self, runLoopModes] - } - pub unsafe fn setRunLoopModes(&self, runLoopModes: &NSArray) { - msg_send![self, setRunLoopModes: runLoopModes] - } - pub unsafe fn undo(&self) { - msg_send![self, undo] - } - pub unsafe fn redo(&self) { - msg_send![self, redo] - } - pub unsafe fn undoNestedGroup(&self) { - msg_send![self, undoNestedGroup] - } - pub unsafe fn canUndo(&self) -> bool { - msg_send![self, canUndo] - } - pub unsafe fn canRedo(&self) -> bool { - msg_send![self, canRedo] - } - pub unsafe fn isUndoing(&self) -> bool { - msg_send![self, isUndoing] - } - pub unsafe fn isRedoing(&self) -> bool { - msg_send![self, isRedoing] - } - pub unsafe fn removeAllActions(&self) { - msg_send![self, removeAllActions] - } - pub unsafe fn removeAllActionsWithTarget(&self, target: &Object) { - msg_send![self, removeAllActionsWithTarget: target] - } + #[method(beginUndoGrouping)] + pub unsafe fn beginUndoGrouping(&self); + #[method(endUndoGrouping)] + pub unsafe fn endUndoGrouping(&self); + #[method(groupingLevel)] + pub unsafe fn groupingLevel(&self) -> NSInteger; + #[method(disableUndoRegistration)] + pub unsafe fn disableUndoRegistration(&self); + #[method(enableUndoRegistration)] + pub unsafe fn enableUndoRegistration(&self); + #[method(isUndoRegistrationEnabled)] + pub unsafe fn isUndoRegistrationEnabled(&self) -> bool; + #[method(groupsByEvent)] + pub unsafe fn groupsByEvent(&self) -> bool; + # [method (setGroupsByEvent :)] + pub unsafe fn setGroupsByEvent(&self, groupsByEvent: bool); + #[method(levelsOfUndo)] + pub unsafe fn levelsOfUndo(&self) -> NSUInteger; + # [method (setLevelsOfUndo :)] + pub unsafe fn setLevelsOfUndo(&self, levelsOfUndo: NSUInteger); + #[method_id(runLoopModes)] + pub unsafe fn runLoopModes(&self) -> Id, Shared>; + # [method (setRunLoopModes :)] + pub unsafe fn setRunLoopModes(&self, runLoopModes: &NSArray); + #[method(undo)] + pub unsafe fn undo(&self); + #[method(redo)] + pub unsafe fn redo(&self); + #[method(undoNestedGroup)] + pub unsafe fn undoNestedGroup(&self); + #[method(canUndo)] + pub unsafe fn canUndo(&self) -> bool; + #[method(canRedo)] + pub unsafe fn canRedo(&self) -> bool; + #[method(isUndoing)] + pub unsafe fn isUndoing(&self) -> bool; + #[method(isRedoing)] + pub unsafe fn isRedoing(&self) -> bool; + #[method(removeAllActions)] + pub unsafe fn removeAllActions(&self); + # [method (removeAllActionsWithTarget :)] + pub unsafe fn removeAllActionsWithTarget(&self, target: &Object); + # [method (registerUndoWithTarget : selector : object :)] pub unsafe fn registerUndoWithTarget_selector_object( &self, target: &Object, selector: Sel, anObject: Option<&Object>, - ) { - msg_send![ - self, - registerUndoWithTarget: target, - selector: selector, - object: anObject - ] - } - pub unsafe fn prepareWithInvocationTarget(&self, target: &Object) -> Id { - msg_send_id![self, prepareWithInvocationTarget: target] - } + ); + # [method_id (prepareWithInvocationTarget :)] + pub unsafe fn prepareWithInvocationTarget(&self, target: &Object) -> Id; + # [method (registerUndoWithTarget : handler :)] pub unsafe fn registerUndoWithTarget_handler( &self, target: &Object, undoHandler: TodoBlock, - ) { - msg_send![self, registerUndoWithTarget: target, handler: undoHandler] - } - pub unsafe fn setActionIsDiscardable(&self, discardable: bool) { - msg_send![self, setActionIsDiscardable: discardable] - } - pub unsafe fn undoActionIsDiscardable(&self) -> bool { - msg_send![self, undoActionIsDiscardable] - } - pub unsafe fn redoActionIsDiscardable(&self) -> bool { - msg_send![self, redoActionIsDiscardable] - } - pub unsafe fn undoActionName(&self) -> Id { - msg_send_id![self, undoActionName] - } - pub unsafe fn redoActionName(&self) -> Id { - msg_send_id![self, redoActionName] - } - pub unsafe fn setActionName(&self, actionName: &NSString) { - msg_send![self, setActionName: actionName] - } - pub unsafe fn undoMenuItemTitle(&self) -> Id { - msg_send_id![self, undoMenuItemTitle] - } - pub unsafe fn redoMenuItemTitle(&self) -> Id { - msg_send_id![self, redoMenuItemTitle] - } + ); + # [method (setActionIsDiscardable :)] + pub unsafe fn setActionIsDiscardable(&self, discardable: bool); + #[method(undoActionIsDiscardable)] + pub unsafe fn undoActionIsDiscardable(&self) -> bool; + #[method(redoActionIsDiscardable)] + pub unsafe fn redoActionIsDiscardable(&self) -> bool; + #[method_id(undoActionName)] + pub unsafe fn undoActionName(&self) -> Id; + #[method_id(redoActionName)] + pub unsafe fn redoActionName(&self) -> Id; + # [method (setActionName :)] + pub unsafe fn setActionName(&self, actionName: &NSString); + #[method_id(undoMenuItemTitle)] + pub unsafe fn undoMenuItemTitle(&self) -> Id; + #[method_id(redoMenuItemTitle)] + pub unsafe fn redoMenuItemTitle(&self) -> Id; + # [method_id (undoMenuTitleForUndoActionName :)] pub unsafe fn undoMenuTitleForUndoActionName( &self, actionName: &NSString, - ) -> Id { - msg_send_id![self, undoMenuTitleForUndoActionName: actionName] - } + ) -> Id; + # [method_id (redoMenuTitleForUndoActionName :)] pub unsafe fn redoMenuTitleForUndoActionName( &self, actionName: &NSString, - ) -> Id { - msg_send_id![self, redoMenuTitleForUndoActionName: actionName] - } + ) -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSUnit.rs b/icrate/src/Foundation/generated/NSUnit.rs index c5c00d57f..9309dccff 100644 --- a/icrate/src/Foundation/generated/NSUnit.rs +++ b/icrate/src/Foundation/generated/NSUnit.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSUnitConverter; @@ -12,12 +12,10 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitConverter { - pub unsafe fn baseUnitValueFromValue(&self, value: c_double) -> c_double { - msg_send![self, baseUnitValueFromValue: value] - } - pub unsafe fn valueFromBaseUnitValue(&self, baseUnitValue: c_double) -> c_double { - msg_send![self, valueFromBaseUnitValue: baseUnitValue] - } + # [method (baseUnitValueFromValue :)] + pub unsafe fn baseUnitValueFromValue(&self, value: c_double) -> c_double; + # [method (valueFromBaseUnitValue :)] + pub unsafe fn valueFromBaseUnitValue(&self, baseUnitValue: c_double) -> c_double; } ); extern_class!( @@ -29,22 +27,18 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitConverterLinear { - pub unsafe fn coefficient(&self) -> c_double { - msg_send![self, coefficient] - } - pub unsafe fn constant(&self) -> c_double { - msg_send![self, constant] - } - pub unsafe fn initWithCoefficient(&self, coefficient: c_double) -> Id { - msg_send_id![self, initWithCoefficient: coefficient] - } + #[method(coefficient)] + pub unsafe fn coefficient(&self) -> c_double; + #[method(constant)] + pub unsafe fn constant(&self) -> c_double; + # [method_id (initWithCoefficient :)] + pub unsafe fn initWithCoefficient(&self, coefficient: c_double) -> Id; + # [method_id (initWithCoefficient : constant :)] pub unsafe fn initWithCoefficient_constant( &self, coefficient: c_double, constant: c_double, - ) -> Id { - msg_send_id![self, initWithCoefficient: coefficient, constant: constant] - } + ) -> Id; } ); extern_class!( @@ -56,18 +50,14 @@ extern_class!( ); extern_methods!( unsafe impl NSUnit { - pub unsafe fn symbol(&self) -> Id { - msg_send_id![self, symbol] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn new() -> Id { - msg_send_id![Self::class(), new] - } - pub unsafe fn initWithSymbol(&self, symbol: &NSString) -> Id { - msg_send_id![self, initWithSymbol: symbol] - } + #[method_id(symbol)] + pub unsafe fn symbol(&self) -> Id; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(new)] + pub unsafe fn new() -> Id; + # [method_id (initWithSymbol :)] + pub unsafe fn initWithSymbol(&self, symbol: &NSString) -> Id; } ); extern_class!( @@ -79,19 +69,16 @@ extern_class!( ); extern_methods!( unsafe impl NSDimension { - pub unsafe fn converter(&self) -> Id { - msg_send_id![self, converter] - } + #[method_id(converter)] + pub unsafe fn converter(&self) -> Id; + # [method_id (initWithSymbol : converter :)] pub unsafe fn initWithSymbol_converter( &self, symbol: &NSString, converter: &NSUnitConverter, - ) -> Id { - msg_send_id![self, initWithSymbol: symbol, converter: converter] - } - pub unsafe fn baseUnit() -> Id { - msg_send_id![Self::class(), baseUnit] - } + ) -> Id; + #[method_id(baseUnit)] + pub unsafe fn baseUnit() -> Id; } ); extern_class!( @@ -103,12 +90,10 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitAcceleration { - pub unsafe fn metersPerSecondSquared() -> Id { - msg_send_id![Self::class(), metersPerSecondSquared] - } - pub unsafe fn gravity() -> Id { - msg_send_id![Self::class(), gravity] - } + #[method_id(metersPerSecondSquared)] + pub unsafe fn metersPerSecondSquared() -> Id; + #[method_id(gravity)] + pub unsafe fn gravity() -> Id; } ); extern_class!( @@ -120,24 +105,18 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitAngle { - pub unsafe fn degrees() -> Id { - msg_send_id![Self::class(), degrees] - } - pub unsafe fn arcMinutes() -> Id { - msg_send_id![Self::class(), arcMinutes] - } - pub unsafe fn arcSeconds() -> Id { - msg_send_id![Self::class(), arcSeconds] - } - pub unsafe fn radians() -> Id { - msg_send_id![Self::class(), radians] - } - pub unsafe fn gradians() -> Id { - msg_send_id![Self::class(), gradians] - } - pub unsafe fn revolutions() -> Id { - msg_send_id![Self::class(), revolutions] - } + #[method_id(degrees)] + pub unsafe fn degrees() -> Id; + #[method_id(arcMinutes)] + pub unsafe fn arcMinutes() -> Id; + #[method_id(arcSeconds)] + pub unsafe fn arcSeconds() -> Id; + #[method_id(radians)] + pub unsafe fn radians() -> Id; + #[method_id(gradians)] + pub unsafe fn gradians() -> Id; + #[method_id(revolutions)] + pub unsafe fn revolutions() -> Id; } ); extern_class!( @@ -149,48 +128,34 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitArea { - pub unsafe fn squareMegameters() -> Id { - msg_send_id![Self::class(), squareMegameters] - } - pub unsafe fn squareKilometers() -> Id { - msg_send_id![Self::class(), squareKilometers] - } - pub unsafe fn squareMeters() -> Id { - msg_send_id![Self::class(), squareMeters] - } - pub unsafe fn squareCentimeters() -> Id { - msg_send_id![Self::class(), squareCentimeters] - } - pub unsafe fn squareMillimeters() -> Id { - msg_send_id![Self::class(), squareMillimeters] - } - pub unsafe fn squareMicrometers() -> Id { - msg_send_id![Self::class(), squareMicrometers] - } - pub unsafe fn squareNanometers() -> Id { - msg_send_id![Self::class(), squareNanometers] - } - pub unsafe fn squareInches() -> Id { - msg_send_id![Self::class(), squareInches] - } - pub unsafe fn squareFeet() -> Id { - msg_send_id![Self::class(), squareFeet] - } - pub unsafe fn squareYards() -> Id { - msg_send_id![Self::class(), squareYards] - } - pub unsafe fn squareMiles() -> Id { - msg_send_id![Self::class(), squareMiles] - } - pub unsafe fn acres() -> Id { - msg_send_id![Self::class(), acres] - } - pub unsafe fn ares() -> Id { - msg_send_id![Self::class(), ares] - } - pub unsafe fn hectares() -> Id { - msg_send_id![Self::class(), hectares] - } + #[method_id(squareMegameters)] + pub unsafe fn squareMegameters() -> Id; + #[method_id(squareKilometers)] + pub unsafe fn squareKilometers() -> Id; + #[method_id(squareMeters)] + pub unsafe fn squareMeters() -> Id; + #[method_id(squareCentimeters)] + pub unsafe fn squareCentimeters() -> Id; + #[method_id(squareMillimeters)] + pub unsafe fn squareMillimeters() -> Id; + #[method_id(squareMicrometers)] + pub unsafe fn squareMicrometers() -> Id; + #[method_id(squareNanometers)] + pub unsafe fn squareNanometers() -> Id; + #[method_id(squareInches)] + pub unsafe fn squareInches() -> Id; + #[method_id(squareFeet)] + pub unsafe fn squareFeet() -> Id; + #[method_id(squareYards)] + pub unsafe fn squareYards() -> Id; + #[method_id(squareMiles)] + pub unsafe fn squareMiles() -> Id; + #[method_id(acres)] + pub unsafe fn acres() -> Id; + #[method_id(ares)] + pub unsafe fn ares() -> Id; + #[method_id(hectares)] + pub unsafe fn hectares() -> Id; } ); extern_class!( @@ -202,20 +167,14 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitConcentrationMass { - pub unsafe fn gramsPerLiter() -> Id { - msg_send_id![Self::class(), gramsPerLiter] - } - pub unsafe fn milligramsPerDeciliter() -> Id { - msg_send_id![Self::class(), milligramsPerDeciliter] - } + #[method_id(gramsPerLiter)] + pub unsafe fn gramsPerLiter() -> Id; + #[method_id(milligramsPerDeciliter)] + pub unsafe fn milligramsPerDeciliter() -> Id; + # [method_id (millimolesPerLiterWithGramsPerMole :)] pub unsafe fn millimolesPerLiterWithGramsPerMole( gramsPerMole: c_double, - ) -> Id { - msg_send_id![ - Self::class(), - millimolesPerLiterWithGramsPerMole: gramsPerMole - ] - } + ) -> Id; } ); extern_class!( @@ -227,9 +186,8 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitDispersion { - pub unsafe fn partsPerMillion() -> Id { - msg_send_id![Self::class(), partsPerMillion] - } + #[method_id(partsPerMillion)] + pub unsafe fn partsPerMillion() -> Id; } ); extern_class!( @@ -241,27 +199,20 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitDuration { - pub unsafe fn hours() -> Id { - msg_send_id![Self::class(), hours] - } - pub unsafe fn minutes() -> Id { - msg_send_id![Self::class(), minutes] - } - pub unsafe fn seconds() -> Id { - msg_send_id![Self::class(), seconds] - } - pub unsafe fn milliseconds() -> Id { - msg_send_id![Self::class(), milliseconds] - } - pub unsafe fn microseconds() -> Id { - msg_send_id![Self::class(), microseconds] - } - pub unsafe fn nanoseconds() -> Id { - msg_send_id![Self::class(), nanoseconds] - } - pub unsafe fn picoseconds() -> Id { - msg_send_id![Self::class(), picoseconds] - } + #[method_id(hours)] + pub unsafe fn hours() -> Id; + #[method_id(minutes)] + pub unsafe fn minutes() -> Id; + #[method_id(seconds)] + pub unsafe fn seconds() -> Id; + #[method_id(milliseconds)] + pub unsafe fn milliseconds() -> Id; + #[method_id(microseconds)] + pub unsafe fn microseconds() -> Id; + #[method_id(nanoseconds)] + pub unsafe fn nanoseconds() -> Id; + #[method_id(picoseconds)] + pub unsafe fn picoseconds() -> Id; } ); extern_class!( @@ -273,24 +224,18 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitElectricCharge { - pub unsafe fn coulombs() -> Id { - msg_send_id![Self::class(), coulombs] - } - pub unsafe fn megaampereHours() -> Id { - msg_send_id![Self::class(), megaampereHours] - } - pub unsafe fn kiloampereHours() -> Id { - msg_send_id![Self::class(), kiloampereHours] - } - pub unsafe fn ampereHours() -> Id { - msg_send_id![Self::class(), ampereHours] - } - pub unsafe fn milliampereHours() -> Id { - msg_send_id![Self::class(), milliampereHours] - } - pub unsafe fn microampereHours() -> Id { - msg_send_id![Self::class(), microampereHours] - } + #[method_id(coulombs)] + pub unsafe fn coulombs() -> Id; + #[method_id(megaampereHours)] + pub unsafe fn megaampereHours() -> Id; + #[method_id(kiloampereHours)] + pub unsafe fn kiloampereHours() -> Id; + #[method_id(ampereHours)] + pub unsafe fn ampereHours() -> Id; + #[method_id(milliampereHours)] + pub unsafe fn milliampereHours() -> Id; + #[method_id(microampereHours)] + pub unsafe fn microampereHours() -> Id; } ); extern_class!( @@ -302,21 +247,16 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitElectricCurrent { - pub unsafe fn megaamperes() -> Id { - msg_send_id![Self::class(), megaamperes] - } - pub unsafe fn kiloamperes() -> Id { - msg_send_id![Self::class(), kiloamperes] - } - pub unsafe fn amperes() -> Id { - msg_send_id![Self::class(), amperes] - } - pub unsafe fn milliamperes() -> Id { - msg_send_id![Self::class(), milliamperes] - } - pub unsafe fn microamperes() -> Id { - msg_send_id![Self::class(), microamperes] - } + #[method_id(megaamperes)] + pub unsafe fn megaamperes() -> Id; + #[method_id(kiloamperes)] + pub unsafe fn kiloamperes() -> Id; + #[method_id(amperes)] + pub unsafe fn amperes() -> Id; + #[method_id(milliamperes)] + pub unsafe fn milliamperes() -> Id; + #[method_id(microamperes)] + pub unsafe fn microamperes() -> Id; } ); extern_class!( @@ -328,21 +268,16 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitElectricPotentialDifference { - pub unsafe fn megavolts() -> Id { - msg_send_id![Self::class(), megavolts] - } - pub unsafe fn kilovolts() -> Id { - msg_send_id![Self::class(), kilovolts] - } - pub unsafe fn volts() -> Id { - msg_send_id![Self::class(), volts] - } - pub unsafe fn millivolts() -> Id { - msg_send_id![Self::class(), millivolts] - } - pub unsafe fn microvolts() -> Id { - msg_send_id![Self::class(), microvolts] - } + #[method_id(megavolts)] + pub unsafe fn megavolts() -> Id; + #[method_id(kilovolts)] + pub unsafe fn kilovolts() -> Id; + #[method_id(volts)] + pub unsafe fn volts() -> Id; + #[method_id(millivolts)] + pub unsafe fn millivolts() -> Id; + #[method_id(microvolts)] + pub unsafe fn microvolts() -> Id; } ); extern_class!( @@ -354,21 +289,16 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitElectricResistance { - pub unsafe fn megaohms() -> Id { - msg_send_id![Self::class(), megaohms] - } - pub unsafe fn kiloohms() -> Id { - msg_send_id![Self::class(), kiloohms] - } - pub unsafe fn ohms() -> Id { - msg_send_id![Self::class(), ohms] - } - pub unsafe fn milliohms() -> Id { - msg_send_id![Self::class(), milliohms] - } - pub unsafe fn microohms() -> Id { - msg_send_id![Self::class(), microohms] - } + #[method_id(megaohms)] + pub unsafe fn megaohms() -> Id; + #[method_id(kiloohms)] + pub unsafe fn kiloohms() -> Id; + #[method_id(ohms)] + pub unsafe fn ohms() -> Id; + #[method_id(milliohms)] + pub unsafe fn milliohms() -> Id; + #[method_id(microohms)] + pub unsafe fn microohms() -> Id; } ); extern_class!( @@ -380,21 +310,16 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitEnergy { - pub unsafe fn kilojoules() -> Id { - msg_send_id![Self::class(), kilojoules] - } - pub unsafe fn joules() -> Id { - msg_send_id![Self::class(), joules] - } - pub unsafe fn kilocalories() -> Id { - msg_send_id![Self::class(), kilocalories] - } - pub unsafe fn calories() -> Id { - msg_send_id![Self::class(), calories] - } - pub unsafe fn kilowattHours() -> Id { - msg_send_id![Self::class(), kilowattHours] - } + #[method_id(kilojoules)] + pub unsafe fn kilojoules() -> Id; + #[method_id(joules)] + pub unsafe fn joules() -> Id; + #[method_id(kilocalories)] + pub unsafe fn kilocalories() -> Id; + #[method_id(calories)] + pub unsafe fn calories() -> Id; + #[method_id(kilowattHours)] + pub unsafe fn kilowattHours() -> Id; } ); extern_class!( @@ -406,33 +331,24 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitFrequency { - pub unsafe fn terahertz() -> Id { - msg_send_id![Self::class(), terahertz] - } - pub unsafe fn gigahertz() -> Id { - msg_send_id![Self::class(), gigahertz] - } - pub unsafe fn megahertz() -> Id { - msg_send_id![Self::class(), megahertz] - } - pub unsafe fn kilohertz() -> Id { - msg_send_id![Self::class(), kilohertz] - } - pub unsafe fn hertz() -> Id { - msg_send_id![Self::class(), hertz] - } - pub unsafe fn millihertz() -> Id { - msg_send_id![Self::class(), millihertz] - } - pub unsafe fn microhertz() -> Id { - msg_send_id![Self::class(), microhertz] - } - pub unsafe fn nanohertz() -> Id { - msg_send_id![Self::class(), nanohertz] - } - pub unsafe fn framesPerSecond() -> Id { - msg_send_id![Self::class(), framesPerSecond] - } + #[method_id(terahertz)] + pub unsafe fn terahertz() -> Id; + #[method_id(gigahertz)] + pub unsafe fn gigahertz() -> Id; + #[method_id(megahertz)] + pub unsafe fn megahertz() -> Id; + #[method_id(kilohertz)] + pub unsafe fn kilohertz() -> Id; + #[method_id(hertz)] + pub unsafe fn hertz() -> Id; + #[method_id(millihertz)] + pub unsafe fn millihertz() -> Id; + #[method_id(microhertz)] + pub unsafe fn microhertz() -> Id; + #[method_id(nanohertz)] + pub unsafe fn nanohertz() -> Id; + #[method_id(framesPerSecond)] + pub unsafe fn framesPerSecond() -> Id; } ); extern_class!( @@ -444,15 +360,12 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitFuelEfficiency { - pub unsafe fn litersPer100Kilometers() -> Id { - msg_send_id![Self::class(), litersPer100Kilometers] - } - pub unsafe fn milesPerImperialGallon() -> Id { - msg_send_id![Self::class(), milesPerImperialGallon] - } - pub unsafe fn milesPerGallon() -> Id { - msg_send_id![Self::class(), milesPerGallon] - } + #[method_id(litersPer100Kilometers)] + pub unsafe fn litersPer100Kilometers() -> Id; + #[method_id(milesPerImperialGallon)] + pub unsafe fn milesPerImperialGallon() -> Id; + #[method_id(milesPerGallon)] + pub unsafe fn milesPerGallon() -> Id; } ); extern_class!( @@ -464,111 +377,76 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitInformationStorage { - pub unsafe fn bytes() -> Id { - msg_send_id![Self::class(), bytes] - } - pub unsafe fn bits() -> Id { - msg_send_id![Self::class(), bits] - } - pub unsafe fn nibbles() -> Id { - msg_send_id![Self::class(), nibbles] - } - pub unsafe fn yottabytes() -> Id { - msg_send_id![Self::class(), yottabytes] - } - pub unsafe fn zettabytes() -> Id { - msg_send_id![Self::class(), zettabytes] - } - pub unsafe fn exabytes() -> Id { - msg_send_id![Self::class(), exabytes] - } - pub unsafe fn petabytes() -> Id { - msg_send_id![Self::class(), petabytes] - } - pub unsafe fn terabytes() -> Id { - msg_send_id![Self::class(), terabytes] - } - pub unsafe fn gigabytes() -> Id { - msg_send_id![Self::class(), gigabytes] - } - pub unsafe fn megabytes() -> Id { - msg_send_id![Self::class(), megabytes] - } - pub unsafe fn kilobytes() -> Id { - msg_send_id![Self::class(), kilobytes] - } - pub unsafe fn yottabits() -> Id { - msg_send_id![Self::class(), yottabits] - } - pub unsafe fn zettabits() -> Id { - msg_send_id![Self::class(), zettabits] - } - pub unsafe fn exabits() -> Id { - msg_send_id![Self::class(), exabits] - } - pub unsafe fn petabits() -> Id { - msg_send_id![Self::class(), petabits] - } - pub unsafe fn terabits() -> Id { - msg_send_id![Self::class(), terabits] - } - pub unsafe fn gigabits() -> Id { - msg_send_id![Self::class(), gigabits] - } - pub unsafe fn megabits() -> Id { - msg_send_id![Self::class(), megabits] - } - pub unsafe fn kilobits() -> Id { - msg_send_id![Self::class(), kilobits] - } - pub unsafe fn yobibytes() -> Id { - msg_send_id![Self::class(), yobibytes] - } - pub unsafe fn zebibytes() -> Id { - msg_send_id![Self::class(), zebibytes] - } - pub unsafe fn exbibytes() -> Id { - msg_send_id![Self::class(), exbibytes] - } - pub unsafe fn pebibytes() -> Id { - msg_send_id![Self::class(), pebibytes] - } - pub unsafe fn tebibytes() -> Id { - msg_send_id![Self::class(), tebibytes] - } - pub unsafe fn gibibytes() -> Id { - msg_send_id![Self::class(), gibibytes] - } - pub unsafe fn mebibytes() -> Id { - msg_send_id![Self::class(), mebibytes] - } - pub unsafe fn kibibytes() -> Id { - msg_send_id![Self::class(), kibibytes] - } - pub unsafe fn yobibits() -> Id { - msg_send_id![Self::class(), yobibits] - } - pub unsafe fn zebibits() -> Id { - msg_send_id![Self::class(), zebibits] - } - pub unsafe fn exbibits() -> Id { - msg_send_id![Self::class(), exbibits] - } - pub unsafe fn pebibits() -> Id { - msg_send_id![Self::class(), pebibits] - } - pub unsafe fn tebibits() -> Id { - msg_send_id![Self::class(), tebibits] - } - pub unsafe fn gibibits() -> Id { - msg_send_id![Self::class(), gibibits] - } - pub unsafe fn mebibits() -> Id { - msg_send_id![Self::class(), mebibits] - } - pub unsafe fn kibibits() -> Id { - msg_send_id![Self::class(), kibibits] - } + #[method_id(bytes)] + pub unsafe fn bytes() -> Id; + #[method_id(bits)] + pub unsafe fn bits() -> Id; + #[method_id(nibbles)] + pub unsafe fn nibbles() -> Id; + #[method_id(yottabytes)] + pub unsafe fn yottabytes() -> Id; + #[method_id(zettabytes)] + pub unsafe fn zettabytes() -> Id; + #[method_id(exabytes)] + pub unsafe fn exabytes() -> Id; + #[method_id(petabytes)] + pub unsafe fn petabytes() -> Id; + #[method_id(terabytes)] + pub unsafe fn terabytes() -> Id; + #[method_id(gigabytes)] + pub unsafe fn gigabytes() -> Id; + #[method_id(megabytes)] + pub unsafe fn megabytes() -> Id; + #[method_id(kilobytes)] + pub unsafe fn kilobytes() -> Id; + #[method_id(yottabits)] + pub unsafe fn yottabits() -> Id; + #[method_id(zettabits)] + pub unsafe fn zettabits() -> Id; + #[method_id(exabits)] + pub unsafe fn exabits() -> Id; + #[method_id(petabits)] + pub unsafe fn petabits() -> Id; + #[method_id(terabits)] + pub unsafe fn terabits() -> Id; + #[method_id(gigabits)] + pub unsafe fn gigabits() -> Id; + #[method_id(megabits)] + pub unsafe fn megabits() -> Id; + #[method_id(kilobits)] + pub unsafe fn kilobits() -> Id; + #[method_id(yobibytes)] + pub unsafe fn yobibytes() -> Id; + #[method_id(zebibytes)] + pub unsafe fn zebibytes() -> Id; + #[method_id(exbibytes)] + pub unsafe fn exbibytes() -> Id; + #[method_id(pebibytes)] + pub unsafe fn pebibytes() -> Id; + #[method_id(tebibytes)] + pub unsafe fn tebibytes() -> Id; + #[method_id(gibibytes)] + pub unsafe fn gibibytes() -> Id; + #[method_id(mebibytes)] + pub unsafe fn mebibytes() -> Id; + #[method_id(kibibytes)] + pub unsafe fn kibibytes() -> Id; + #[method_id(yobibits)] + pub unsafe fn yobibits() -> Id; + #[method_id(zebibits)] + pub unsafe fn zebibits() -> Id; + #[method_id(exbibits)] + pub unsafe fn exbibits() -> Id; + #[method_id(pebibits)] + pub unsafe fn pebibits() -> Id; + #[method_id(tebibits)] + pub unsafe fn tebibits() -> Id; + #[method_id(gibibits)] + pub unsafe fn gibibits() -> Id; + #[method_id(mebibits)] + pub unsafe fn mebibits() -> Id; + #[method_id(kibibits)] + pub unsafe fn kibibits() -> Id; } ); extern_class!( @@ -580,72 +458,50 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitLength { - pub unsafe fn megameters() -> Id { - msg_send_id![Self::class(), megameters] - } - pub unsafe fn kilometers() -> Id { - msg_send_id![Self::class(), kilometers] - } - pub unsafe fn hectometers() -> Id { - msg_send_id![Self::class(), hectometers] - } - pub unsafe fn decameters() -> Id { - msg_send_id![Self::class(), decameters] - } - pub unsafe fn meters() -> Id { - msg_send_id![Self::class(), meters] - } - pub unsafe fn decimeters() -> Id { - msg_send_id![Self::class(), decimeters] - } - pub unsafe fn centimeters() -> Id { - msg_send_id![Self::class(), centimeters] - } - pub unsafe fn millimeters() -> Id { - msg_send_id![Self::class(), millimeters] - } - pub unsafe fn micrometers() -> Id { - msg_send_id![Self::class(), micrometers] - } - pub unsafe fn nanometers() -> Id { - msg_send_id![Self::class(), nanometers] - } - pub unsafe fn picometers() -> Id { - msg_send_id![Self::class(), picometers] - } - pub unsafe fn inches() -> Id { - msg_send_id![Self::class(), inches] - } - pub unsafe fn feet() -> Id { - msg_send_id![Self::class(), feet] - } - pub unsafe fn yards() -> Id { - msg_send_id![Self::class(), yards] - } - pub unsafe fn miles() -> Id { - msg_send_id![Self::class(), miles] - } - pub unsafe fn scandinavianMiles() -> Id { - msg_send_id![Self::class(), scandinavianMiles] - } - pub unsafe fn lightyears() -> Id { - msg_send_id![Self::class(), lightyears] - } - pub unsafe fn nauticalMiles() -> Id { - msg_send_id![Self::class(), nauticalMiles] - } - pub unsafe fn fathoms() -> Id { - msg_send_id![Self::class(), fathoms] - } - pub unsafe fn furlongs() -> Id { - msg_send_id![Self::class(), furlongs] - } - pub unsafe fn astronomicalUnits() -> Id { - msg_send_id![Self::class(), astronomicalUnits] - } - pub unsafe fn parsecs() -> Id { - msg_send_id![Self::class(), parsecs] - } + #[method_id(megameters)] + pub unsafe fn megameters() -> Id; + #[method_id(kilometers)] + pub unsafe fn kilometers() -> Id; + #[method_id(hectometers)] + pub unsafe fn hectometers() -> Id; + #[method_id(decameters)] + pub unsafe fn decameters() -> Id; + #[method_id(meters)] + pub unsafe fn meters() -> Id; + #[method_id(decimeters)] + pub unsafe fn decimeters() -> Id; + #[method_id(centimeters)] + pub unsafe fn centimeters() -> Id; + #[method_id(millimeters)] + pub unsafe fn millimeters() -> Id; + #[method_id(micrometers)] + pub unsafe fn micrometers() -> Id; + #[method_id(nanometers)] + pub unsafe fn nanometers() -> Id; + #[method_id(picometers)] + pub unsafe fn picometers() -> Id; + #[method_id(inches)] + pub unsafe fn inches() -> Id; + #[method_id(feet)] + pub unsafe fn feet() -> Id; + #[method_id(yards)] + pub unsafe fn yards() -> Id; + #[method_id(miles)] + pub unsafe fn miles() -> Id; + #[method_id(scandinavianMiles)] + pub unsafe fn scandinavianMiles() -> Id; + #[method_id(lightyears)] + pub unsafe fn lightyears() -> Id; + #[method_id(nauticalMiles)] + pub unsafe fn nauticalMiles() -> Id; + #[method_id(fathoms)] + pub unsafe fn fathoms() -> Id; + #[method_id(furlongs)] + pub unsafe fn furlongs() -> Id; + #[method_id(astronomicalUnits)] + pub unsafe fn astronomicalUnits() -> Id; + #[method_id(parsecs)] + pub unsafe fn parsecs() -> Id; } ); extern_class!( @@ -657,9 +513,8 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitIlluminance { - pub unsafe fn lux() -> Id { - msg_send_id![Self::class(), lux] - } + #[method_id(lux)] + pub unsafe fn lux() -> Id; } ); extern_class!( @@ -671,54 +526,38 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitMass { - pub unsafe fn kilograms() -> Id { - msg_send_id![Self::class(), kilograms] - } - pub unsafe fn grams() -> Id { - msg_send_id![Self::class(), grams] - } - pub unsafe fn decigrams() -> Id { - msg_send_id![Self::class(), decigrams] - } - pub unsafe fn centigrams() -> Id { - msg_send_id![Self::class(), centigrams] - } - pub unsafe fn milligrams() -> Id { - msg_send_id![Self::class(), milligrams] - } - pub unsafe fn micrograms() -> Id { - msg_send_id![Self::class(), micrograms] - } - pub unsafe fn nanograms() -> Id { - msg_send_id![Self::class(), nanograms] - } - pub unsafe fn picograms() -> Id { - msg_send_id![Self::class(), picograms] - } - pub unsafe fn ounces() -> Id { - msg_send_id![Self::class(), ounces] - } - pub unsafe fn poundsMass() -> Id { - msg_send_id![Self::class(), poundsMass] - } - pub unsafe fn stones() -> Id { - msg_send_id![Self::class(), stones] - } - pub unsafe fn metricTons() -> Id { - msg_send_id![Self::class(), metricTons] - } - pub unsafe fn shortTons() -> Id { - msg_send_id![Self::class(), shortTons] - } - pub unsafe fn carats() -> Id { - msg_send_id![Self::class(), carats] - } - pub unsafe fn ouncesTroy() -> Id { - msg_send_id![Self::class(), ouncesTroy] - } - pub unsafe fn slugs() -> Id { - msg_send_id![Self::class(), slugs] - } + #[method_id(kilograms)] + pub unsafe fn kilograms() -> Id; + #[method_id(grams)] + pub unsafe fn grams() -> Id; + #[method_id(decigrams)] + pub unsafe fn decigrams() -> Id; + #[method_id(centigrams)] + pub unsafe fn centigrams() -> Id; + #[method_id(milligrams)] + pub unsafe fn milligrams() -> Id; + #[method_id(micrograms)] + pub unsafe fn micrograms() -> Id; + #[method_id(nanograms)] + pub unsafe fn nanograms() -> Id; + #[method_id(picograms)] + pub unsafe fn picograms() -> Id; + #[method_id(ounces)] + pub unsafe fn ounces() -> Id; + #[method_id(poundsMass)] + pub unsafe fn poundsMass() -> Id; + #[method_id(stones)] + pub unsafe fn stones() -> Id; + #[method_id(metricTons)] + pub unsafe fn metricTons() -> Id; + #[method_id(shortTons)] + pub unsafe fn shortTons() -> Id; + #[method_id(carats)] + pub unsafe fn carats() -> Id; + #[method_id(ouncesTroy)] + pub unsafe fn ouncesTroy() -> Id; + #[method_id(slugs)] + pub unsafe fn slugs() -> Id; } ); extern_class!( @@ -730,39 +569,28 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitPower { - pub unsafe fn terawatts() -> Id { - msg_send_id![Self::class(), terawatts] - } - pub unsafe fn gigawatts() -> Id { - msg_send_id![Self::class(), gigawatts] - } - pub unsafe fn megawatts() -> Id { - msg_send_id![Self::class(), megawatts] - } - pub unsafe fn kilowatts() -> Id { - msg_send_id![Self::class(), kilowatts] - } - pub unsafe fn watts() -> Id { - msg_send_id![Self::class(), watts] - } - pub unsafe fn milliwatts() -> Id { - msg_send_id![Self::class(), milliwatts] - } - pub unsafe fn microwatts() -> Id { - msg_send_id![Self::class(), microwatts] - } - pub unsafe fn nanowatts() -> Id { - msg_send_id![Self::class(), nanowatts] - } - pub unsafe fn picowatts() -> Id { - msg_send_id![Self::class(), picowatts] - } - pub unsafe fn femtowatts() -> Id { - msg_send_id![Self::class(), femtowatts] - } - pub unsafe fn horsepower() -> Id { - msg_send_id![Self::class(), horsepower] - } + #[method_id(terawatts)] + pub unsafe fn terawatts() -> Id; + #[method_id(gigawatts)] + pub unsafe fn gigawatts() -> Id; + #[method_id(megawatts)] + pub unsafe fn megawatts() -> Id; + #[method_id(kilowatts)] + pub unsafe fn kilowatts() -> Id; + #[method_id(watts)] + pub unsafe fn watts() -> Id; + #[method_id(milliwatts)] + pub unsafe fn milliwatts() -> Id; + #[method_id(microwatts)] + pub unsafe fn microwatts() -> Id; + #[method_id(nanowatts)] + pub unsafe fn nanowatts() -> Id; + #[method_id(picowatts)] + pub unsafe fn picowatts() -> Id; + #[method_id(femtowatts)] + pub unsafe fn femtowatts() -> Id; + #[method_id(horsepower)] + pub unsafe fn horsepower() -> Id; } ); extern_class!( @@ -774,36 +602,26 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitPressure { - pub unsafe fn newtonsPerMetersSquared() -> Id { - msg_send_id![Self::class(), newtonsPerMetersSquared] - } - pub unsafe fn gigapascals() -> Id { - msg_send_id![Self::class(), gigapascals] - } - pub unsafe fn megapascals() -> Id { - msg_send_id![Self::class(), megapascals] - } - pub unsafe fn kilopascals() -> Id { - msg_send_id![Self::class(), kilopascals] - } - pub unsafe fn hectopascals() -> Id { - msg_send_id![Self::class(), hectopascals] - } - pub unsafe fn inchesOfMercury() -> Id { - msg_send_id![Self::class(), inchesOfMercury] - } - pub unsafe fn bars() -> Id { - msg_send_id![Self::class(), bars] - } - pub unsafe fn millibars() -> Id { - msg_send_id![Self::class(), millibars] - } - pub unsafe fn millimetersOfMercury() -> Id { - msg_send_id![Self::class(), millimetersOfMercury] - } - pub unsafe fn poundsForcePerSquareInch() -> Id { - msg_send_id![Self::class(), poundsForcePerSquareInch] - } + #[method_id(newtonsPerMetersSquared)] + pub unsafe fn newtonsPerMetersSquared() -> Id; + #[method_id(gigapascals)] + pub unsafe fn gigapascals() -> Id; + #[method_id(megapascals)] + pub unsafe fn megapascals() -> Id; + #[method_id(kilopascals)] + pub unsafe fn kilopascals() -> Id; + #[method_id(hectopascals)] + pub unsafe fn hectopascals() -> Id; + #[method_id(inchesOfMercury)] + pub unsafe fn inchesOfMercury() -> Id; + #[method_id(bars)] + pub unsafe fn bars() -> Id; + #[method_id(millibars)] + pub unsafe fn millibars() -> Id; + #[method_id(millimetersOfMercury)] + pub unsafe fn millimetersOfMercury() -> Id; + #[method_id(poundsForcePerSquareInch)] + pub unsafe fn poundsForcePerSquareInch() -> Id; } ); extern_class!( @@ -815,18 +633,14 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitSpeed { - pub unsafe fn metersPerSecond() -> Id { - msg_send_id![Self::class(), metersPerSecond] - } - pub unsafe fn kilometersPerHour() -> Id { - msg_send_id![Self::class(), kilometersPerHour] - } - pub unsafe fn milesPerHour() -> Id { - msg_send_id![Self::class(), milesPerHour] - } - pub unsafe fn knots() -> Id { - msg_send_id![Self::class(), knots] - } + #[method_id(metersPerSecond)] + pub unsafe fn metersPerSecond() -> Id; + #[method_id(kilometersPerHour)] + pub unsafe fn kilometersPerHour() -> Id; + #[method_id(milesPerHour)] + pub unsafe fn milesPerHour() -> Id; + #[method_id(knots)] + pub unsafe fn knots() -> Id; } ); extern_class!( @@ -838,15 +652,12 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitTemperature { - pub unsafe fn kelvin() -> Id { - msg_send_id![Self::class(), kelvin] - } - pub unsafe fn celsius() -> Id { - msg_send_id![Self::class(), celsius] - } - pub unsafe fn fahrenheit() -> Id { - msg_send_id![Self::class(), fahrenheit] - } + #[method_id(kelvin)] + pub unsafe fn kelvin() -> Id; + #[method_id(celsius)] + pub unsafe fn celsius() -> Id; + #[method_id(fahrenheit)] + pub unsafe fn fahrenheit() -> Id; } ); extern_class!( @@ -858,98 +669,67 @@ extern_class!( ); extern_methods!( unsafe impl NSUnitVolume { - pub unsafe fn megaliters() -> Id { - msg_send_id![Self::class(), megaliters] - } - pub unsafe fn kiloliters() -> Id { - msg_send_id![Self::class(), kiloliters] - } - pub unsafe fn liters() -> Id { - msg_send_id![Self::class(), liters] - } - pub unsafe fn deciliters() -> Id { - msg_send_id![Self::class(), deciliters] - } - pub unsafe fn centiliters() -> Id { - msg_send_id![Self::class(), centiliters] - } - pub unsafe fn milliliters() -> Id { - msg_send_id![Self::class(), milliliters] - } - pub unsafe fn cubicKilometers() -> Id { - msg_send_id![Self::class(), cubicKilometers] - } - pub unsafe fn cubicMeters() -> Id { - msg_send_id![Self::class(), cubicMeters] - } - pub unsafe fn cubicDecimeters() -> Id { - msg_send_id![Self::class(), cubicDecimeters] - } - pub unsafe fn cubicCentimeters() -> Id { - msg_send_id![Self::class(), cubicCentimeters] - } - pub unsafe fn cubicMillimeters() -> Id { - msg_send_id![Self::class(), cubicMillimeters] - } - pub unsafe fn cubicInches() -> Id { - msg_send_id![Self::class(), cubicInches] - } - pub unsafe fn cubicFeet() -> Id { - msg_send_id![Self::class(), cubicFeet] - } - pub unsafe fn cubicYards() -> Id { - msg_send_id![Self::class(), cubicYards] - } - pub unsafe fn cubicMiles() -> Id { - msg_send_id![Self::class(), cubicMiles] - } - pub unsafe fn acreFeet() -> Id { - msg_send_id![Self::class(), acreFeet] - } - pub unsafe fn bushels() -> Id { - msg_send_id![Self::class(), bushels] - } - pub unsafe fn teaspoons() -> Id { - msg_send_id![Self::class(), teaspoons] - } - pub unsafe fn tablespoons() -> Id { - msg_send_id![Self::class(), tablespoons] - } - pub unsafe fn fluidOunces() -> Id { - msg_send_id![Self::class(), fluidOunces] - } - pub unsafe fn cups() -> Id { - msg_send_id![Self::class(), cups] - } - pub unsafe fn pints() -> Id { - msg_send_id![Self::class(), pints] - } - pub unsafe fn quarts() -> Id { - msg_send_id![Self::class(), quarts] - } - pub unsafe fn gallons() -> Id { - msg_send_id![Self::class(), gallons] - } - pub unsafe fn imperialTeaspoons() -> Id { - msg_send_id![Self::class(), imperialTeaspoons] - } - pub unsafe fn imperialTablespoons() -> Id { - msg_send_id![Self::class(), imperialTablespoons] - } - pub unsafe fn imperialFluidOunces() -> Id { - msg_send_id![Self::class(), imperialFluidOunces] - } - pub unsafe fn imperialPints() -> Id { - msg_send_id![Self::class(), imperialPints] - } - pub unsafe fn imperialQuarts() -> Id { - msg_send_id![Self::class(), imperialQuarts] - } - pub unsafe fn imperialGallons() -> Id { - msg_send_id![Self::class(), imperialGallons] - } - pub unsafe fn metricCups() -> Id { - msg_send_id![Self::class(), metricCups] - } + #[method_id(megaliters)] + pub unsafe fn megaliters() -> Id; + #[method_id(kiloliters)] + pub unsafe fn kiloliters() -> Id; + #[method_id(liters)] + pub unsafe fn liters() -> Id; + #[method_id(deciliters)] + pub unsafe fn deciliters() -> Id; + #[method_id(centiliters)] + pub unsafe fn centiliters() -> Id; + #[method_id(milliliters)] + pub unsafe fn milliliters() -> Id; + #[method_id(cubicKilometers)] + pub unsafe fn cubicKilometers() -> Id; + #[method_id(cubicMeters)] + pub unsafe fn cubicMeters() -> Id; + #[method_id(cubicDecimeters)] + pub unsafe fn cubicDecimeters() -> Id; + #[method_id(cubicCentimeters)] + pub unsafe fn cubicCentimeters() -> Id; + #[method_id(cubicMillimeters)] + pub unsafe fn cubicMillimeters() -> Id; + #[method_id(cubicInches)] + pub unsafe fn cubicInches() -> Id; + #[method_id(cubicFeet)] + pub unsafe fn cubicFeet() -> Id; + #[method_id(cubicYards)] + pub unsafe fn cubicYards() -> Id; + #[method_id(cubicMiles)] + pub unsafe fn cubicMiles() -> Id; + #[method_id(acreFeet)] + pub unsafe fn acreFeet() -> Id; + #[method_id(bushels)] + pub unsafe fn bushels() -> Id; + #[method_id(teaspoons)] + pub unsafe fn teaspoons() -> Id; + #[method_id(tablespoons)] + pub unsafe fn tablespoons() -> Id; + #[method_id(fluidOunces)] + pub unsafe fn fluidOunces() -> Id; + #[method_id(cups)] + pub unsafe fn cups() -> Id; + #[method_id(pints)] + pub unsafe fn pints() -> Id; + #[method_id(quarts)] + pub unsafe fn quarts() -> Id; + #[method_id(gallons)] + pub unsafe fn gallons() -> Id; + #[method_id(imperialTeaspoons)] + pub unsafe fn imperialTeaspoons() -> Id; + #[method_id(imperialTablespoons)] + pub unsafe fn imperialTablespoons() -> Id; + #[method_id(imperialFluidOunces)] + pub unsafe fn imperialFluidOunces() -> Id; + #[method_id(imperialPints)] + pub unsafe fn imperialPints() -> Id; + #[method_id(imperialQuarts)] + pub unsafe fn imperialQuarts() -> Id; + #[method_id(imperialGallons)] + pub unsafe fn imperialGallons() -> Id; + #[method_id(metricCups)] + pub unsafe fn metricCups() -> Id; } ); diff --git a/icrate/src/Foundation/generated/NSUserActivity.rs b/icrate/src/Foundation/generated/NSUserActivity.rs index 6261b7268..1f37eb8c2 100644 --- a/icrate/src/Foundation/generated/NSUserActivity.rs +++ b/icrate/src/Foundation/generated/NSUserActivity.rs @@ -12,7 +12,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSUserActivityPersistentIdentifier = NSString; extern_class!( #[derive(Debug)] @@ -23,165 +23,104 @@ extern_class!( ); extern_methods!( unsafe impl NSUserActivity { - pub unsafe fn initWithActivityType(&self, activityType: &NSString) -> Id { - msg_send_id![self, initWithActivityType: activityType] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn activityType(&self) -> Id { - msg_send_id![self, activityType] - } - pub unsafe fn title(&self) -> Option> { - msg_send_id![self, title] - } - pub unsafe fn setTitle(&self, title: Option<&NSString>) { - msg_send![self, setTitle: title] - } - pub unsafe fn userInfo(&self) -> Option> { - msg_send_id![self, userInfo] - } - pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>) { - msg_send![self, setUserInfo: userInfo] - } - pub unsafe fn addUserInfoEntriesFromDictionary(&self, otherDictionary: &NSDictionary) { - msg_send![self, addUserInfoEntriesFromDictionary: otherDictionary] - } - pub unsafe fn requiredUserInfoKeys(&self) -> Option, Shared>> { - msg_send_id![self, requiredUserInfoKeys] - } + # [method_id (initWithActivityType :)] + pub unsafe fn initWithActivityType(&self, activityType: &NSString) -> Id; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(activityType)] + pub unsafe fn activityType(&self) -> Id; + #[method_id(title)] + pub unsafe fn title(&self) -> Option>; + # [method (setTitle :)] + pub unsafe fn setTitle(&self, title: Option<&NSString>); + #[method_id(userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + # [method (setUserInfo :)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); + # [method (addUserInfoEntriesFromDictionary :)] + pub unsafe fn addUserInfoEntriesFromDictionary(&self, otherDictionary: &NSDictionary); + #[method_id(requiredUserInfoKeys)] + pub unsafe fn requiredUserInfoKeys(&self) -> Option, Shared>>; + # [method (setRequiredUserInfoKeys :)] pub unsafe fn setRequiredUserInfoKeys( &self, requiredUserInfoKeys: Option<&NSSet>, - ) { - msg_send![self, setRequiredUserInfoKeys: requiredUserInfoKeys] - } - pub unsafe fn needsSave(&self) -> bool { - msg_send![self, needsSave] - } - pub unsafe fn setNeedsSave(&self, needsSave: bool) { - msg_send![self, setNeedsSave: needsSave] - } - pub unsafe fn webpageURL(&self) -> Option> { - msg_send_id![self, webpageURL] - } - pub unsafe fn setWebpageURL(&self, webpageURL: Option<&NSURL>) { - msg_send![self, setWebpageURL: webpageURL] - } - pub unsafe fn referrerURL(&self) -> Option> { - msg_send_id![self, referrerURL] - } - pub unsafe fn setReferrerURL(&self, referrerURL: Option<&NSURL>) { - msg_send![self, setReferrerURL: referrerURL] - } - pub unsafe fn expirationDate(&self) -> Option> { - msg_send_id![self, expirationDate] - } - pub unsafe fn setExpirationDate(&self, expirationDate: Option<&NSDate>) { - msg_send![self, setExpirationDate: expirationDate] - } - pub unsafe fn keywords(&self) -> Id, Shared> { - msg_send_id![self, keywords] - } - pub unsafe fn setKeywords(&self, keywords: &NSSet) { - msg_send![self, setKeywords: keywords] - } - pub unsafe fn supportsContinuationStreams(&self) -> bool { - msg_send![self, supportsContinuationStreams] - } - pub unsafe fn setSupportsContinuationStreams(&self, supportsContinuationStreams: bool) { - msg_send![ - self, - setSupportsContinuationStreams: supportsContinuationStreams - ] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSUserActivityDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn targetContentIdentifier(&self) -> Option> { - msg_send_id![self, targetContentIdentifier] - } - pub unsafe fn setTargetContentIdentifier( - &self, - targetContentIdentifier: Option<&NSString>, - ) { - msg_send![self, setTargetContentIdentifier: targetContentIdentifier] - } - pub unsafe fn becomeCurrent(&self) { - msg_send![self, becomeCurrent] - } - pub unsafe fn resignCurrent(&self) { - msg_send![self, resignCurrent] - } - pub unsafe fn invalidate(&self) { - msg_send![self, invalidate] - } + ); + #[method(needsSave)] + pub unsafe fn needsSave(&self) -> bool; + # [method (setNeedsSave :)] + pub unsafe fn setNeedsSave(&self, needsSave: bool); + #[method_id(webpageURL)] + pub unsafe fn webpageURL(&self) -> Option>; + # [method (setWebpageURL :)] + pub unsafe fn setWebpageURL(&self, webpageURL: Option<&NSURL>); + #[method_id(referrerURL)] + pub unsafe fn referrerURL(&self) -> Option>; + # [method (setReferrerURL :)] + pub unsafe fn setReferrerURL(&self, referrerURL: Option<&NSURL>); + #[method_id(expirationDate)] + pub unsafe fn expirationDate(&self) -> Option>; + # [method (setExpirationDate :)] + pub unsafe fn setExpirationDate(&self, expirationDate: Option<&NSDate>); + #[method_id(keywords)] + pub unsafe fn keywords(&self) -> Id, Shared>; + # [method (setKeywords :)] + pub unsafe fn setKeywords(&self, keywords: &NSSet); + #[method(supportsContinuationStreams)] + pub unsafe fn supportsContinuationStreams(&self) -> bool; + # [method (setSupportsContinuationStreams :)] + pub unsafe fn setSupportsContinuationStreams(&self, supportsContinuationStreams: bool); + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSUserActivityDelegate>); + #[method_id(targetContentIdentifier)] + pub unsafe fn targetContentIdentifier(&self) -> Option>; + # [method (setTargetContentIdentifier :)] + pub unsafe fn setTargetContentIdentifier(&self, targetContentIdentifier: Option<&NSString>); + #[method(becomeCurrent)] + pub unsafe fn becomeCurrent(&self); + #[method(resignCurrent)] + pub unsafe fn resignCurrent(&self); + #[method(invalidate)] + pub unsafe fn invalidate(&self); + # [method (getContinuationStreamsWithCompletionHandler :)] pub unsafe fn getContinuationStreamsWithCompletionHandler( &self, completionHandler: TodoBlock, - ) { - msg_send![ - self, - getContinuationStreamsWithCompletionHandler: completionHandler - ] - } - pub unsafe fn isEligibleForHandoff(&self) -> bool { - msg_send![self, isEligibleForHandoff] - } - pub unsafe fn setEligibleForHandoff(&self, eligibleForHandoff: bool) { - msg_send![self, setEligibleForHandoff: eligibleForHandoff] - } - pub unsafe fn isEligibleForSearch(&self) -> bool { - msg_send![self, isEligibleForSearch] - } - pub unsafe fn setEligibleForSearch(&self, eligibleForSearch: bool) { - msg_send![self, setEligibleForSearch: eligibleForSearch] - } - pub unsafe fn isEligibleForPublicIndexing(&self) -> bool { - msg_send![self, isEligibleForPublicIndexing] - } - pub unsafe fn setEligibleForPublicIndexing(&self, eligibleForPublicIndexing: bool) { - msg_send![ - self, - setEligibleForPublicIndexing: eligibleForPublicIndexing - ] - } - pub unsafe fn isEligibleForPrediction(&self) -> bool { - msg_send![self, isEligibleForPrediction] - } - pub unsafe fn setEligibleForPrediction(&self, eligibleForPrediction: bool) { - msg_send![self, setEligibleForPrediction: eligibleForPrediction] - } + ); + #[method(isEligibleForHandoff)] + pub unsafe fn isEligibleForHandoff(&self) -> bool; + # [method (setEligibleForHandoff :)] + pub unsafe fn setEligibleForHandoff(&self, eligibleForHandoff: bool); + #[method(isEligibleForSearch)] + pub unsafe fn isEligibleForSearch(&self) -> bool; + # [method (setEligibleForSearch :)] + pub unsafe fn setEligibleForSearch(&self, eligibleForSearch: bool); + #[method(isEligibleForPublicIndexing)] + pub unsafe fn isEligibleForPublicIndexing(&self) -> bool; + # [method (setEligibleForPublicIndexing :)] + pub unsafe fn setEligibleForPublicIndexing(&self, eligibleForPublicIndexing: bool); + #[method(isEligibleForPrediction)] + pub unsafe fn isEligibleForPrediction(&self) -> bool; + # [method (setEligibleForPrediction :)] + pub unsafe fn setEligibleForPrediction(&self, eligibleForPrediction: bool); + #[method_id(persistentIdentifier)] pub unsafe fn persistentIdentifier( &self, - ) -> Option> { - msg_send_id![self, persistentIdentifier] - } + ) -> Option>; + # [method (setPersistentIdentifier :)] pub unsafe fn setPersistentIdentifier( &self, persistentIdentifier: Option<&NSUserActivityPersistentIdentifier>, - ) { - msg_send![self, setPersistentIdentifier: persistentIdentifier] - } + ); + # [method (deleteSavedUserActivitiesWithPersistentIdentifiers : completionHandler :)] pub unsafe fn deleteSavedUserActivitiesWithPersistentIdentifiers_completionHandler( persistentIdentifiers: &NSArray, handler: TodoBlock, - ) { - msg_send![ - Self::class(), - deleteSavedUserActivitiesWithPersistentIdentifiers: persistentIdentifiers, - completionHandler: handler - ] - } - pub unsafe fn deleteAllSavedUserActivitiesWithCompletionHandler(handler: TodoBlock) { - msg_send![ - Self::class(), - deleteAllSavedUserActivitiesWithCompletionHandler: handler - ] - } + ); + # [method (deleteAllSavedUserActivitiesWithCompletionHandler :)] + pub unsafe fn deleteAllSavedUserActivitiesWithCompletionHandler(handler: TodoBlock); } ); pub type NSUserActivityDelegate = NSObject; diff --git a/icrate/src/Foundation/generated/NSUserDefaults.rs b/icrate/src/Foundation/generated/NSUserDefaults.rs index edd08a5fa..c9617ed89 100644 --- a/icrate/src/Foundation/generated/NSUserDefaults.rs +++ b/icrate/src/Foundation/generated/NSUserDefaults.rs @@ -9,7 +9,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSUserDefaults; @@ -19,151 +19,112 @@ extern_class!( ); extern_methods!( unsafe impl NSUserDefaults { - pub unsafe fn standardUserDefaults() -> Id { - msg_send_id![Self::class(), standardUserDefaults] - } - pub unsafe fn resetStandardUserDefaults() { - msg_send![Self::class(), resetStandardUserDefaults] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method_id(standardUserDefaults)] + pub unsafe fn standardUserDefaults() -> Id; + #[method(resetStandardUserDefaults)] + pub unsafe fn resetStandardUserDefaults(); + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithSuiteName :)] pub unsafe fn initWithSuiteName( &self, suitename: Option<&NSString>, - ) -> Option> { - msg_send_id![self, initWithSuiteName: suitename] - } - pub unsafe fn initWithUser(&self, username: &NSString) -> Option> { - msg_send_id![self, initWithUser: username] - } - pub unsafe fn objectForKey(&self, defaultName: &NSString) -> Option> { - msg_send_id![self, objectForKey: defaultName] - } - pub unsafe fn setObject_forKey(&self, value: Option<&Object>, defaultName: &NSString) { - msg_send![self, setObject: value, forKey: defaultName] - } - pub unsafe fn removeObjectForKey(&self, defaultName: &NSString) { - msg_send![self, removeObjectForKey: defaultName] - } - pub unsafe fn stringForKey(&self, defaultName: &NSString) -> Option> { - msg_send_id![self, stringForKey: defaultName] - } - pub unsafe fn arrayForKey(&self, defaultName: &NSString) -> Option> { - msg_send_id![self, arrayForKey: defaultName] - } + ) -> Option>; + # [method_id (initWithUser :)] + pub unsafe fn initWithUser(&self, username: &NSString) -> Option>; + # [method_id (objectForKey :)] + pub unsafe fn objectForKey(&self, defaultName: &NSString) -> Option>; + # [method (setObject : forKey :)] + pub unsafe fn setObject_forKey(&self, value: Option<&Object>, defaultName: &NSString); + # [method (removeObjectForKey :)] + pub unsafe fn removeObjectForKey(&self, defaultName: &NSString); + # [method_id (stringForKey :)] + pub unsafe fn stringForKey(&self, defaultName: &NSString) -> Option>; + # [method_id (arrayForKey :)] + pub unsafe fn arrayForKey(&self, defaultName: &NSString) -> Option>; + # [method_id (dictionaryForKey :)] pub unsafe fn dictionaryForKey( &self, defaultName: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, dictionaryForKey: defaultName] - } - pub unsafe fn dataForKey(&self, defaultName: &NSString) -> Option> { - msg_send_id![self, dataForKey: defaultName] - } + ) -> Option, Shared>>; + # [method_id (dataForKey :)] + pub unsafe fn dataForKey(&self, defaultName: &NSString) -> Option>; + # [method_id (stringArrayForKey :)] pub unsafe fn stringArrayForKey( &self, defaultName: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, stringArrayForKey: defaultName] - } - pub unsafe fn integerForKey(&self, defaultName: &NSString) -> NSInteger { - msg_send![self, integerForKey: defaultName] - } - pub unsafe fn floatForKey(&self, defaultName: &NSString) -> c_float { - msg_send![self, floatForKey: defaultName] - } - pub unsafe fn doubleForKey(&self, defaultName: &NSString) -> c_double { - msg_send![self, doubleForKey: defaultName] - } - pub unsafe fn boolForKey(&self, defaultName: &NSString) -> bool { - msg_send![self, boolForKey: defaultName] - } - pub unsafe fn URLForKey(&self, defaultName: &NSString) -> Option> { - msg_send_id![self, URLForKey: defaultName] - } - pub unsafe fn setInteger_forKey(&self, value: NSInteger, defaultName: &NSString) { - msg_send![self, setInteger: value, forKey: defaultName] - } - pub unsafe fn setFloat_forKey(&self, value: c_float, defaultName: &NSString) { - msg_send![self, setFloat: value, forKey: defaultName] - } - pub unsafe fn setDouble_forKey(&self, value: c_double, defaultName: &NSString) { - msg_send![self, setDouble: value, forKey: defaultName] - } - pub unsafe fn setBool_forKey(&self, value: bool, defaultName: &NSString) { - msg_send![self, setBool: value, forKey: defaultName] - } - pub unsafe fn setURL_forKey(&self, url: Option<&NSURL>, defaultName: &NSString) { - msg_send![self, setURL: url, forKey: defaultName] - } + ) -> Option, Shared>>; + # [method (integerForKey :)] + pub unsafe fn integerForKey(&self, defaultName: &NSString) -> NSInteger; + # [method (floatForKey :)] + pub unsafe fn floatForKey(&self, defaultName: &NSString) -> c_float; + # [method (doubleForKey :)] + pub unsafe fn doubleForKey(&self, defaultName: &NSString) -> c_double; + # [method (boolForKey :)] + pub unsafe fn boolForKey(&self, defaultName: &NSString) -> bool; + # [method_id (URLForKey :)] + pub unsafe fn URLForKey(&self, defaultName: &NSString) -> Option>; + # [method (setInteger : forKey :)] + pub unsafe fn setInteger_forKey(&self, value: NSInteger, defaultName: &NSString); + # [method (setFloat : forKey :)] + pub unsafe fn setFloat_forKey(&self, value: c_float, defaultName: &NSString); + # [method (setDouble : forKey :)] + pub unsafe fn setDouble_forKey(&self, value: c_double, defaultName: &NSString); + # [method (setBool : forKey :)] + pub unsafe fn setBool_forKey(&self, value: bool, defaultName: &NSString); + # [method (setURL : forKey :)] + pub unsafe fn setURL_forKey(&self, url: Option<&NSURL>, defaultName: &NSString); + # [method (registerDefaults :)] pub unsafe fn registerDefaults( &self, registrationDictionary: &NSDictionary, - ) { - msg_send![self, registerDefaults: registrationDictionary] - } - pub unsafe fn addSuiteNamed(&self, suiteName: &NSString) { - msg_send![self, addSuiteNamed: suiteName] - } - pub unsafe fn removeSuiteNamed(&self, suiteName: &NSString) { - msg_send![self, removeSuiteNamed: suiteName] - } - pub unsafe fn dictionaryRepresentation( - &self, - ) -> Id, Shared> { - msg_send_id![self, dictionaryRepresentation] - } - pub unsafe fn volatileDomainNames(&self) -> Id, Shared> { - msg_send_id![self, volatileDomainNames] - } + ); + # [method (addSuiteNamed :)] + pub unsafe fn addSuiteNamed(&self, suiteName: &NSString); + # [method (removeSuiteNamed :)] + pub unsafe fn removeSuiteNamed(&self, suiteName: &NSString); + #[method_id(dictionaryRepresentation)] + pub unsafe fn dictionaryRepresentation(&self) + -> Id, Shared>; + #[method_id(volatileDomainNames)] + pub unsafe fn volatileDomainNames(&self) -> Id, Shared>; + # [method_id (volatileDomainForName :)] pub unsafe fn volatileDomainForName( &self, domainName: &NSString, - ) -> Id, Shared> { - msg_send_id![self, volatileDomainForName: domainName] - } + ) -> Id, Shared>; + # [method (setVolatileDomain : forName :)] pub unsafe fn setVolatileDomain_forName( &self, domain: &NSDictionary, domainName: &NSString, - ) { - msg_send![self, setVolatileDomain: domain, forName: domainName] - } - pub unsafe fn removeVolatileDomainForName(&self, domainName: &NSString) { - msg_send![self, removeVolatileDomainForName: domainName] - } - pub unsafe fn persistentDomainNames(&self) -> Id { - msg_send_id![self, persistentDomainNames] - } + ); + # [method (removeVolatileDomainForName :)] + pub unsafe fn removeVolatileDomainForName(&self, domainName: &NSString); + #[method_id(persistentDomainNames)] + pub unsafe fn persistentDomainNames(&self) -> Id; + # [method_id (persistentDomainForName :)] pub unsafe fn persistentDomainForName( &self, domainName: &NSString, - ) -> Option, Shared>> { - msg_send_id![self, persistentDomainForName: domainName] - } + ) -> Option, Shared>>; + # [method (setPersistentDomain : forName :)] pub unsafe fn setPersistentDomain_forName( &self, domain: &NSDictionary, domainName: &NSString, - ) { - msg_send![self, setPersistentDomain: domain, forName: domainName] - } - pub unsafe fn removePersistentDomainForName(&self, domainName: &NSString) { - msg_send![self, removePersistentDomainForName: domainName] - } - pub unsafe fn synchronize(&self) -> bool { - msg_send![self, synchronize] - } - pub unsafe fn objectIsForcedForKey(&self, key: &NSString) -> bool { - msg_send![self, objectIsForcedForKey: key] - } + ); + # [method (removePersistentDomainForName :)] + pub unsafe fn removePersistentDomainForName(&self, domainName: &NSString); + #[method(synchronize)] + pub unsafe fn synchronize(&self) -> bool; + # [method (objectIsForcedForKey :)] + pub unsafe fn objectIsForcedForKey(&self, key: &NSString) -> bool; + # [method (objectIsForcedForKey : inDomain :)] pub unsafe fn objectIsForcedForKey_inDomain( &self, key: &NSString, domain: &NSString, - ) -> bool { - msg_send![self, objectIsForcedForKey: key, inDomain: domain] - } + ) -> bool; } ); diff --git a/icrate/src/Foundation/generated/NSUserNotification.rs b/icrate/src/Foundation/generated/NSUserNotification.rs index 5f729fcbb..d7df4d337 100644 --- a/icrate/src/Foundation/generated/NSUserNotification.rs +++ b/icrate/src/Foundation/generated/NSUserNotification.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSUserNotification; @@ -20,133 +20,94 @@ extern_class!( ); extern_methods!( unsafe impl NSUserNotification { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn title(&self) -> Option> { - msg_send_id![self, title] - } - pub unsafe fn setTitle(&self, title: Option<&NSString>) { - msg_send![self, setTitle: title] - } - pub unsafe fn subtitle(&self) -> Option> { - msg_send_id![self, subtitle] - } - pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>) { - msg_send![self, setSubtitle: subtitle] - } - pub unsafe fn informativeText(&self) -> Option> { - msg_send_id![self, informativeText] - } - pub unsafe fn setInformativeText(&self, informativeText: Option<&NSString>) { - msg_send![self, setInformativeText: informativeText] - } - pub unsafe fn actionButtonTitle(&self) -> Id { - msg_send_id![self, actionButtonTitle] - } - pub unsafe fn setActionButtonTitle(&self, actionButtonTitle: &NSString) { - msg_send![self, setActionButtonTitle: actionButtonTitle] - } - pub unsafe fn userInfo(&self) -> Option, Shared>> { - msg_send_id![self, userInfo] - } - pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>) { - msg_send![self, setUserInfo: userInfo] - } - pub unsafe fn deliveryDate(&self) -> Option> { - msg_send_id![self, deliveryDate] - } - pub unsafe fn setDeliveryDate(&self, deliveryDate: Option<&NSDate>) { - msg_send![self, setDeliveryDate: deliveryDate] - } - pub unsafe fn deliveryTimeZone(&self) -> Option> { - msg_send_id![self, deliveryTimeZone] - } - pub unsafe fn setDeliveryTimeZone(&self, deliveryTimeZone: Option<&NSTimeZone>) { - msg_send![self, setDeliveryTimeZone: deliveryTimeZone] - } - pub unsafe fn deliveryRepeatInterval(&self) -> Option> { - msg_send_id![self, deliveryRepeatInterval] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method_id(title)] + pub unsafe fn title(&self) -> Option>; + # [method (setTitle :)] + pub unsafe fn setTitle(&self, title: Option<&NSString>); + #[method_id(subtitle)] + pub unsafe fn subtitle(&self) -> Option>; + # [method (setSubtitle :)] + pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>); + #[method_id(informativeText)] + pub unsafe fn informativeText(&self) -> Option>; + # [method (setInformativeText :)] + pub unsafe fn setInformativeText(&self, informativeText: Option<&NSString>); + #[method_id(actionButtonTitle)] + pub unsafe fn actionButtonTitle(&self) -> Id; + # [method (setActionButtonTitle :)] + pub unsafe fn setActionButtonTitle(&self, actionButtonTitle: &NSString); + #[method_id(userInfo)] + pub unsafe fn userInfo(&self) -> Option, Shared>>; + # [method (setUserInfo :)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSDictionary>); + #[method_id(deliveryDate)] + pub unsafe fn deliveryDate(&self) -> Option>; + # [method (setDeliveryDate :)] + pub unsafe fn setDeliveryDate(&self, deliveryDate: Option<&NSDate>); + #[method_id(deliveryTimeZone)] + pub unsafe fn deliveryTimeZone(&self) -> Option>; + # [method (setDeliveryTimeZone :)] + pub unsafe fn setDeliveryTimeZone(&self, deliveryTimeZone: Option<&NSTimeZone>); + #[method_id(deliveryRepeatInterval)] + pub unsafe fn deliveryRepeatInterval(&self) -> Option>; + # [method (setDeliveryRepeatInterval :)] pub unsafe fn setDeliveryRepeatInterval( &self, deliveryRepeatInterval: Option<&NSDateComponents>, - ) { - msg_send![self, setDeliveryRepeatInterval: deliveryRepeatInterval] - } - pub unsafe fn actualDeliveryDate(&self) -> Option> { - msg_send_id![self, actualDeliveryDate] - } - pub unsafe fn isPresented(&self) -> bool { - msg_send![self, isPresented] - } - pub unsafe fn isRemote(&self) -> bool { - msg_send![self, isRemote] - } - pub unsafe fn soundName(&self) -> Option> { - msg_send_id![self, soundName] - } - pub unsafe fn setSoundName(&self, soundName: Option<&NSString>) { - msg_send![self, setSoundName: soundName] - } - pub unsafe fn hasActionButton(&self) -> bool { - msg_send![self, hasActionButton] - } - pub unsafe fn setHasActionButton(&self, hasActionButton: bool) { - msg_send![self, setHasActionButton: hasActionButton] - } - pub unsafe fn activationType(&self) -> NSUserNotificationActivationType { - msg_send![self, activationType] - } - pub unsafe fn otherButtonTitle(&self) -> Id { - msg_send_id![self, otherButtonTitle] - } - pub unsafe fn setOtherButtonTitle(&self, otherButtonTitle: &NSString) { - msg_send![self, setOtherButtonTitle: otherButtonTitle] - } - pub unsafe fn identifier(&self) -> Option> { - msg_send_id![self, identifier] - } - pub unsafe fn setIdentifier(&self, identifier: Option<&NSString>) { - msg_send![self, setIdentifier: identifier] - } - pub unsafe fn contentImage(&self) -> Option> { - msg_send_id![self, contentImage] - } - pub unsafe fn setContentImage(&self, contentImage: Option<&NSImage>) { - msg_send![self, setContentImage: contentImage] - } - pub unsafe fn hasReplyButton(&self) -> bool { - msg_send![self, hasReplyButton] - } - pub unsafe fn setHasReplyButton(&self, hasReplyButton: bool) { - msg_send![self, setHasReplyButton: hasReplyButton] - } - pub unsafe fn responsePlaceholder(&self) -> Option> { - msg_send_id![self, responsePlaceholder] - } - pub unsafe fn setResponsePlaceholder(&self, responsePlaceholder: Option<&NSString>) { - msg_send![self, setResponsePlaceholder: responsePlaceholder] - } - pub unsafe fn response(&self) -> Option> { - msg_send_id![self, response] - } + ); + #[method_id(actualDeliveryDate)] + pub unsafe fn actualDeliveryDate(&self) -> Option>; + #[method(isPresented)] + pub unsafe fn isPresented(&self) -> bool; + #[method(isRemote)] + pub unsafe fn isRemote(&self) -> bool; + #[method_id(soundName)] + pub unsafe fn soundName(&self) -> Option>; + # [method (setSoundName :)] + pub unsafe fn setSoundName(&self, soundName: Option<&NSString>); + #[method(hasActionButton)] + pub unsafe fn hasActionButton(&self) -> bool; + # [method (setHasActionButton :)] + pub unsafe fn setHasActionButton(&self, hasActionButton: bool); + #[method(activationType)] + pub unsafe fn activationType(&self) -> NSUserNotificationActivationType; + #[method_id(otherButtonTitle)] + pub unsafe fn otherButtonTitle(&self) -> Id; + # [method (setOtherButtonTitle :)] + pub unsafe fn setOtherButtonTitle(&self, otherButtonTitle: &NSString); + #[method_id(identifier)] + pub unsafe fn identifier(&self) -> Option>; + # [method (setIdentifier :)] + pub unsafe fn setIdentifier(&self, identifier: Option<&NSString>); + #[method_id(contentImage)] + pub unsafe fn contentImage(&self) -> Option>; + # [method (setContentImage :)] + pub unsafe fn setContentImage(&self, contentImage: Option<&NSImage>); + #[method(hasReplyButton)] + pub unsafe fn hasReplyButton(&self) -> bool; + # [method (setHasReplyButton :)] + pub unsafe fn setHasReplyButton(&self, hasReplyButton: bool); + #[method_id(responsePlaceholder)] + pub unsafe fn responsePlaceholder(&self) -> Option>; + # [method (setResponsePlaceholder :)] + pub unsafe fn setResponsePlaceholder(&self, responsePlaceholder: Option<&NSString>); + #[method_id(response)] + pub unsafe fn response(&self) -> Option>; + #[method_id(additionalActions)] pub unsafe fn additionalActions( &self, - ) -> Option, Shared>> { - msg_send_id![self, additionalActions] - } + ) -> Option, Shared>>; + # [method (setAdditionalActions :)] pub unsafe fn setAdditionalActions( &self, additionalActions: Option<&NSArray>, - ) { - msg_send![self, setAdditionalActions: additionalActions] - } + ); + #[method_id(additionalActivationAction)] pub unsafe fn additionalActivationAction( &self, - ) -> Option> { - msg_send_id![self, additionalActivationAction] - } + ) -> Option>; } ); extern_class!( @@ -158,22 +119,15 @@ extern_class!( ); extern_methods!( unsafe impl NSUserNotificationAction { + # [method_id (actionWithIdentifier : title :)] pub unsafe fn actionWithIdentifier_title( identifier: Option<&NSString>, title: Option<&NSString>, - ) -> Id { - msg_send_id![ - Self::class(), - actionWithIdentifier: identifier, - title: title - ] - } - pub unsafe fn identifier(&self) -> Option> { - msg_send_id![self, identifier] - } - pub unsafe fn title(&self) -> Option> { - msg_send_id![self, title] - } + ) -> Id; + #[method_id(identifier)] + pub unsafe fn identifier(&self) -> Option>; + #[method_id(title)] + pub unsafe fn title(&self) -> Option>; } ); extern_class!( @@ -185,42 +139,31 @@ extern_class!( ); extern_methods!( unsafe impl NSUserNotificationCenter { - pub unsafe fn defaultUserNotificationCenter() -> Id { - msg_send_id![Self::class(), defaultUserNotificationCenter] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSUserNotificationCenterDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn scheduledNotifications(&self) -> Id, Shared> { - msg_send_id![self, scheduledNotifications] - } + #[method_id(defaultUserNotificationCenter)] + pub unsafe fn defaultUserNotificationCenter() -> Id; + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSUserNotificationCenterDelegate>); + #[method_id(scheduledNotifications)] + pub unsafe fn scheduledNotifications(&self) -> Id, Shared>; + # [method (setScheduledNotifications :)] pub unsafe fn setScheduledNotifications( &self, scheduledNotifications: &NSArray, - ) { - msg_send![self, setScheduledNotifications: scheduledNotifications] - } - pub unsafe fn scheduleNotification(&self, notification: &NSUserNotification) { - msg_send![self, scheduleNotification: notification] - } - pub unsafe fn removeScheduledNotification(&self, notification: &NSUserNotification) { - msg_send![self, removeScheduledNotification: notification] - } - pub unsafe fn deliveredNotifications(&self) -> Id, Shared> { - msg_send_id![self, deliveredNotifications] - } - pub unsafe fn deliverNotification(&self, notification: &NSUserNotification) { - msg_send![self, deliverNotification: notification] - } - pub unsafe fn removeDeliveredNotification(&self, notification: &NSUserNotification) { - msg_send![self, removeDeliveredNotification: notification] - } - pub unsafe fn removeAllDeliveredNotifications(&self) { - msg_send![self, removeAllDeliveredNotifications] - } + ); + # [method (scheduleNotification :)] + pub unsafe fn scheduleNotification(&self, notification: &NSUserNotification); + # [method (removeScheduledNotification :)] + pub unsafe fn removeScheduledNotification(&self, notification: &NSUserNotification); + #[method_id(deliveredNotifications)] + pub unsafe fn deliveredNotifications(&self) -> Id, Shared>; + # [method (deliverNotification :)] + pub unsafe fn deliverNotification(&self, notification: &NSUserNotification); + # [method (removeDeliveredNotification :)] + pub unsafe fn removeDeliveredNotification(&self, notification: &NSUserNotification); + #[method(removeAllDeliveredNotifications)] + pub unsafe fn removeAllDeliveredNotifications(&self); } ); pub type NSUserNotificationCenterDelegate = NSObject; diff --git a/icrate/src/Foundation/generated/NSUserScriptTask.rs b/icrate/src/Foundation/generated/NSUserScriptTask.rs index 1e6d56d35..ff249e46b 100644 --- a/icrate/src/Foundation/generated/NSUserScriptTask.rs +++ b/icrate/src/Foundation/generated/NSUserScriptTask.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSUserScriptTask; @@ -20,21 +20,18 @@ extern_class!( ); extern_methods!( unsafe impl NSUserScriptTask { + # [method_id (initWithURL : error :)] pub unsafe fn initWithURL_error( &self, url: &NSURL, - ) -> Result, Id> { - msg_send_id![self, initWithURL: url, error: _] - } - pub unsafe fn scriptURL(&self) -> Id { - msg_send_id![self, scriptURL] - } + ) -> Result, Id>; + #[method_id(scriptURL)] + pub unsafe fn scriptURL(&self) -> Id; + # [method (executeWithCompletionHandler :)] pub unsafe fn executeWithCompletionHandler( &self, handler: NSUserScriptTaskCompletionHandler, - ) { - msg_send![self, executeWithCompletionHandler: handler] - } + ); } ); extern_class!( @@ -46,35 +43,24 @@ extern_class!( ); extern_methods!( unsafe impl NSUserUnixTask { - pub unsafe fn standardInput(&self) -> Option> { - msg_send_id![self, standardInput] - } - pub unsafe fn setStandardInput(&self, standardInput: Option<&NSFileHandle>) { - msg_send![self, setStandardInput: standardInput] - } - pub unsafe fn standardOutput(&self) -> Option> { - msg_send_id![self, standardOutput] - } - pub unsafe fn setStandardOutput(&self, standardOutput: Option<&NSFileHandle>) { - msg_send![self, setStandardOutput: standardOutput] - } - pub unsafe fn standardError(&self) -> Option> { - msg_send_id![self, standardError] - } - pub unsafe fn setStandardError(&self, standardError: Option<&NSFileHandle>) { - msg_send![self, setStandardError: standardError] - } + #[method_id(standardInput)] + pub unsafe fn standardInput(&self) -> Option>; + # [method (setStandardInput :)] + pub unsafe fn setStandardInput(&self, standardInput: Option<&NSFileHandle>); + #[method_id(standardOutput)] + pub unsafe fn standardOutput(&self) -> Option>; + # [method (setStandardOutput :)] + pub unsafe fn setStandardOutput(&self, standardOutput: Option<&NSFileHandle>); + #[method_id(standardError)] + pub unsafe fn standardError(&self) -> Option>; + # [method (setStandardError :)] + pub unsafe fn setStandardError(&self, standardError: Option<&NSFileHandle>); + # [method (executeWithArguments : completionHandler :)] pub unsafe fn executeWithArguments_completionHandler( &self, arguments: Option<&NSArray>, handler: NSUserUnixTaskCompletionHandler, - ) { - msg_send![ - self, - executeWithArguments: arguments, - completionHandler: handler - ] - } + ); } ); extern_class!( @@ -86,17 +72,12 @@ extern_class!( ); extern_methods!( unsafe impl NSUserAppleScriptTask { + # [method (executeWithAppleEvent : completionHandler :)] pub unsafe fn executeWithAppleEvent_completionHandler( &self, event: Option<&NSAppleEventDescriptor>, handler: NSUserAppleScriptTaskCompletionHandler, - ) { - msg_send![ - self, - executeWithAppleEvent: event, - completionHandler: handler - ] - } + ); } ); extern_class!( @@ -108,18 +89,15 @@ extern_class!( ); extern_methods!( unsafe impl NSUserAutomatorTask { - pub unsafe fn variables(&self) -> Option, Shared>> { - msg_send_id![self, variables] - } - pub unsafe fn setVariables(&self, variables: Option<&NSDictionary>) { - msg_send![self, setVariables: variables] - } + #[method_id(variables)] + pub unsafe fn variables(&self) -> Option, Shared>>; + # [method (setVariables :)] + pub unsafe fn setVariables(&self, variables: Option<&NSDictionary>); + # [method (executeWithInput : completionHandler :)] pub unsafe fn executeWithInput_completionHandler( &self, input: Option<&NSSecureCoding>, handler: NSUserAutomatorTaskCompletionHandler, - ) { - msg_send![self, executeWithInput: input, completionHandler: handler] - } + ); } ); diff --git a/icrate/src/Foundation/generated/NSValue.rs b/icrate/src/Foundation/generated/NSValue.rs index 6a72fd4f6..fa26790d9 100644 --- a/icrate/src/Foundation/generated/NSValue.rs +++ b/icrate/src/Foundation/generated/NSValue.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSValue; @@ -14,59 +14,48 @@ extern_class!( ); extern_methods!( unsafe impl NSValue { - pub unsafe fn getValue_size(&self, value: NonNull, size: NSUInteger) { - msg_send![self, getValue: value, size: size] - } - pub unsafe fn objCType(&self) -> NonNull { - msg_send![self, objCType] - } + # [method (getValue : size :)] + pub unsafe fn getValue_size(&self, value: NonNull, size: NSUInteger); + #[method(objCType)] + pub unsafe fn objCType(&self) -> NonNull; + # [method_id (initWithBytes : objCType :)] pub unsafe fn initWithBytes_objCType( &self, value: NonNull, type_: NonNull, - ) -> Id { - msg_send_id![self, initWithBytes: value, objCType: type_] - } - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } + ) -> Id; + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; } ); extern_methods!( #[doc = "NSValueCreation"] unsafe impl NSValue { + # [method_id (valueWithBytes : objCType :)] pub unsafe fn valueWithBytes_objCType( value: NonNull, type_: NonNull, - ) -> Id { - msg_send_id![Self::class(), valueWithBytes: value, objCType: type_] - } + ) -> Id; + # [method_id (value : withObjCType :)] pub unsafe fn value_withObjCType( value: NonNull, type_: NonNull, - ) -> Id { - msg_send_id![Self::class(), value: value, withObjCType: type_] - } + ) -> Id; } ); extern_methods!( #[doc = "NSValueExtensionMethods"] unsafe impl NSValue { - pub unsafe fn valueWithNonretainedObject(anObject: Option<&Object>) -> Id { - msg_send_id![Self::class(), valueWithNonretainedObject: anObject] - } - pub unsafe fn nonretainedObjectValue(&self) -> Option> { - msg_send_id![self, nonretainedObjectValue] - } - pub unsafe fn valueWithPointer(pointer: *mut c_void) -> Id { - msg_send_id![Self::class(), valueWithPointer: pointer] - } - pub unsafe fn pointerValue(&self) -> *mut c_void { - msg_send![self, pointerValue] - } - pub unsafe fn isEqualToValue(&self, value: &NSValue) -> bool { - msg_send![self, isEqualToValue: value] - } + # [method_id (valueWithNonretainedObject :)] + pub unsafe fn valueWithNonretainedObject(anObject: Option<&Object>) -> Id; + #[method_id(nonretainedObjectValue)] + pub unsafe fn nonretainedObjectValue(&self) -> Option>; + # [method_id (valueWithPointer :)] + pub unsafe fn valueWithPointer(pointer: *mut c_void) -> Id; + #[method(pointerValue)] + pub unsafe fn pointerValue(&self) -> *mut c_void; + # [method (isEqualToValue :)] + pub unsafe fn isEqualToValue(&self, value: &NSValue) -> bool; } ); extern_class!( @@ -78,171 +67,118 @@ extern_class!( ); extern_methods!( unsafe impl NSNumber { - pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option> { - msg_send_id![self, initWithCoder: coder] - } - pub unsafe fn initWithChar(&self, value: c_char) -> Id { - msg_send_id![self, initWithChar: value] - } - pub unsafe fn initWithUnsignedChar(&self, value: c_uchar) -> Id { - msg_send_id![self, initWithUnsignedChar: value] - } - pub unsafe fn initWithShort(&self, value: c_short) -> Id { - msg_send_id![self, initWithShort: value] - } - pub unsafe fn initWithUnsignedShort(&self, value: c_ushort) -> Id { - msg_send_id![self, initWithUnsignedShort: value] - } - pub unsafe fn initWithInt(&self, value: c_int) -> Id { - msg_send_id![self, initWithInt: value] - } - pub unsafe fn initWithUnsignedInt(&self, value: c_uint) -> Id { - msg_send_id![self, initWithUnsignedInt: value] - } - pub unsafe fn initWithLong(&self, value: c_long) -> Id { - msg_send_id![self, initWithLong: value] - } - pub unsafe fn initWithUnsignedLong(&self, value: c_ulong) -> Id { - msg_send_id![self, initWithUnsignedLong: value] - } - pub unsafe fn initWithLongLong(&self, value: c_longlong) -> Id { - msg_send_id![self, initWithLongLong: value] - } - pub unsafe fn initWithUnsignedLongLong(&self, value: c_ulonglong) -> Id { - msg_send_id![self, initWithUnsignedLongLong: value] - } - pub unsafe fn initWithFloat(&self, value: c_float) -> Id { - msg_send_id![self, initWithFloat: value] - } - pub unsafe fn initWithDouble(&self, value: c_double) -> Id { - msg_send_id![self, initWithDouble: value] - } - pub unsafe fn initWithBool(&self, value: bool) -> Id { - msg_send_id![self, initWithBool: value] - } - pub unsafe fn initWithInteger(&self, value: NSInteger) -> Id { - msg_send_id![self, initWithInteger: value] - } - pub unsafe fn initWithUnsignedInteger(&self, value: NSUInteger) -> Id { - msg_send_id![self, initWithUnsignedInteger: value] - } - pub unsafe fn charValue(&self) -> c_char { - msg_send![self, charValue] - } - pub unsafe fn unsignedCharValue(&self) -> c_uchar { - msg_send![self, unsignedCharValue] - } - pub unsafe fn shortValue(&self) -> c_short { - msg_send![self, shortValue] - } - pub unsafe fn unsignedShortValue(&self) -> c_ushort { - msg_send![self, unsignedShortValue] - } - pub unsafe fn intValue(&self) -> c_int { - msg_send![self, intValue] - } - pub unsafe fn unsignedIntValue(&self) -> c_uint { - msg_send![self, unsignedIntValue] - } - pub unsafe fn longValue(&self) -> c_long { - msg_send![self, longValue] - } - pub unsafe fn unsignedLongValue(&self) -> c_ulong { - msg_send![self, unsignedLongValue] - } - pub unsafe fn longLongValue(&self) -> c_longlong { - msg_send![self, longLongValue] - } - pub unsafe fn unsignedLongLongValue(&self) -> c_ulonglong { - msg_send![self, unsignedLongLongValue] - } - pub unsafe fn floatValue(&self) -> c_float { - msg_send![self, floatValue] - } - pub unsafe fn doubleValue(&self) -> c_double { - msg_send![self, doubleValue] - } - pub unsafe fn boolValue(&self) -> bool { - msg_send![self, boolValue] - } - pub unsafe fn integerValue(&self) -> NSInteger { - msg_send![self, integerValue] - } - pub unsafe fn unsignedIntegerValue(&self) -> NSUInteger { - msg_send![self, unsignedIntegerValue] - } - pub unsafe fn stringValue(&self) -> Id { - msg_send_id![self, stringValue] - } - pub unsafe fn compare(&self, otherNumber: &NSNumber) -> NSComparisonResult { - msg_send![self, compare: otherNumber] - } - pub unsafe fn isEqualToNumber(&self, number: &NSNumber) -> bool { - msg_send![self, isEqualToNumber: number] - } - pub unsafe fn descriptionWithLocale( - &self, - locale: Option<&Object>, - ) -> Id { - msg_send_id![self, descriptionWithLocale: locale] - } + # [method_id (initWithCoder :)] + pub unsafe fn initWithCoder(&self, coder: &NSCoder) -> Option>; + # [method_id (initWithChar :)] + pub unsafe fn initWithChar(&self, value: c_char) -> Id; + # [method_id (initWithUnsignedChar :)] + pub unsafe fn initWithUnsignedChar(&self, value: c_uchar) -> Id; + # [method_id (initWithShort :)] + pub unsafe fn initWithShort(&self, value: c_short) -> Id; + # [method_id (initWithUnsignedShort :)] + pub unsafe fn initWithUnsignedShort(&self, value: c_ushort) -> Id; + # [method_id (initWithInt :)] + pub unsafe fn initWithInt(&self, value: c_int) -> Id; + # [method_id (initWithUnsignedInt :)] + pub unsafe fn initWithUnsignedInt(&self, value: c_uint) -> Id; + # [method_id (initWithLong :)] + pub unsafe fn initWithLong(&self, value: c_long) -> Id; + # [method_id (initWithUnsignedLong :)] + pub unsafe fn initWithUnsignedLong(&self, value: c_ulong) -> Id; + # [method_id (initWithLongLong :)] + pub unsafe fn initWithLongLong(&self, value: c_longlong) -> Id; + # [method_id (initWithUnsignedLongLong :)] + pub unsafe fn initWithUnsignedLongLong(&self, value: c_ulonglong) -> Id; + # [method_id (initWithFloat :)] + pub unsafe fn initWithFloat(&self, value: c_float) -> Id; + # [method_id (initWithDouble :)] + pub unsafe fn initWithDouble(&self, value: c_double) -> Id; + # [method_id (initWithBool :)] + pub unsafe fn initWithBool(&self, value: bool) -> Id; + # [method_id (initWithInteger :)] + pub unsafe fn initWithInteger(&self, value: NSInteger) -> Id; + # [method_id (initWithUnsignedInteger :)] + pub unsafe fn initWithUnsignedInteger(&self, value: NSUInteger) -> Id; + #[method(charValue)] + pub unsafe fn charValue(&self) -> c_char; + #[method(unsignedCharValue)] + pub unsafe fn unsignedCharValue(&self) -> c_uchar; + #[method(shortValue)] + pub unsafe fn shortValue(&self) -> c_short; + #[method(unsignedShortValue)] + pub unsafe fn unsignedShortValue(&self) -> c_ushort; + #[method(intValue)] + pub unsafe fn intValue(&self) -> c_int; + #[method(unsignedIntValue)] + pub unsafe fn unsignedIntValue(&self) -> c_uint; + #[method(longValue)] + pub unsafe fn longValue(&self) -> c_long; + #[method(unsignedLongValue)] + pub unsafe fn unsignedLongValue(&self) -> c_ulong; + #[method(longLongValue)] + pub unsafe fn longLongValue(&self) -> c_longlong; + #[method(unsignedLongLongValue)] + pub unsafe fn unsignedLongLongValue(&self) -> c_ulonglong; + #[method(floatValue)] + pub unsafe fn floatValue(&self) -> c_float; + #[method(doubleValue)] + pub unsafe fn doubleValue(&self) -> c_double; + #[method(boolValue)] + pub unsafe fn boolValue(&self) -> bool; + #[method(integerValue)] + pub unsafe fn integerValue(&self) -> NSInteger; + #[method(unsignedIntegerValue)] + pub unsafe fn unsignedIntegerValue(&self) -> NSUInteger; + #[method_id(stringValue)] + pub unsafe fn stringValue(&self) -> Id; + # [method (compare :)] + pub unsafe fn compare(&self, otherNumber: &NSNumber) -> NSComparisonResult; + # [method (isEqualToNumber :)] + pub unsafe fn isEqualToNumber(&self, number: &NSNumber) -> bool; + # [method_id (descriptionWithLocale :)] + pub unsafe fn descriptionWithLocale(&self, locale: Option<&Object>) + -> Id; } ); extern_methods!( #[doc = "NSNumberCreation"] unsafe impl NSNumber { - pub unsafe fn numberWithChar(value: c_char) -> Id { - msg_send_id![Self::class(), numberWithChar: value] - } - pub unsafe fn numberWithUnsignedChar(value: c_uchar) -> Id { - msg_send_id![Self::class(), numberWithUnsignedChar: value] - } - pub unsafe fn numberWithShort(value: c_short) -> Id { - msg_send_id![Self::class(), numberWithShort: value] - } - pub unsafe fn numberWithUnsignedShort(value: c_ushort) -> Id { - msg_send_id![Self::class(), numberWithUnsignedShort: value] - } - pub unsafe fn numberWithInt(value: c_int) -> Id { - msg_send_id![Self::class(), numberWithInt: value] - } - pub unsafe fn numberWithUnsignedInt(value: c_uint) -> Id { - msg_send_id![Self::class(), numberWithUnsignedInt: value] - } - pub unsafe fn numberWithLong(value: c_long) -> Id { - msg_send_id![Self::class(), numberWithLong: value] - } - pub unsafe fn numberWithUnsignedLong(value: c_ulong) -> Id { - msg_send_id![Self::class(), numberWithUnsignedLong: value] - } - pub unsafe fn numberWithLongLong(value: c_longlong) -> Id { - msg_send_id![Self::class(), numberWithLongLong: value] - } - pub unsafe fn numberWithUnsignedLongLong(value: c_ulonglong) -> Id { - msg_send_id![Self::class(), numberWithUnsignedLongLong: value] - } - pub unsafe fn numberWithFloat(value: c_float) -> Id { - msg_send_id![Self::class(), numberWithFloat: value] - } - pub unsafe fn numberWithDouble(value: c_double) -> Id { - msg_send_id![Self::class(), numberWithDouble: value] - } - pub unsafe fn numberWithBool(value: bool) -> Id { - msg_send_id![Self::class(), numberWithBool: value] - } - pub unsafe fn numberWithInteger(value: NSInteger) -> Id { - msg_send_id![Self::class(), numberWithInteger: value] - } - pub unsafe fn numberWithUnsignedInteger(value: NSUInteger) -> Id { - msg_send_id![Self::class(), numberWithUnsignedInteger: value] - } + # [method_id (numberWithChar :)] + pub unsafe fn numberWithChar(value: c_char) -> Id; + # [method_id (numberWithUnsignedChar :)] + pub unsafe fn numberWithUnsignedChar(value: c_uchar) -> Id; + # [method_id (numberWithShort :)] + pub unsafe fn numberWithShort(value: c_short) -> Id; + # [method_id (numberWithUnsignedShort :)] + pub unsafe fn numberWithUnsignedShort(value: c_ushort) -> Id; + # [method_id (numberWithInt :)] + pub unsafe fn numberWithInt(value: c_int) -> Id; + # [method_id (numberWithUnsignedInt :)] + pub unsafe fn numberWithUnsignedInt(value: c_uint) -> Id; + # [method_id (numberWithLong :)] + pub unsafe fn numberWithLong(value: c_long) -> Id; + # [method_id (numberWithUnsignedLong :)] + pub unsafe fn numberWithUnsignedLong(value: c_ulong) -> Id; + # [method_id (numberWithLongLong :)] + pub unsafe fn numberWithLongLong(value: c_longlong) -> Id; + # [method_id (numberWithUnsignedLongLong :)] + pub unsafe fn numberWithUnsignedLongLong(value: c_ulonglong) -> Id; + # [method_id (numberWithFloat :)] + pub unsafe fn numberWithFloat(value: c_float) -> Id; + # [method_id (numberWithDouble :)] + pub unsafe fn numberWithDouble(value: c_double) -> Id; + # [method_id (numberWithBool :)] + pub unsafe fn numberWithBool(value: bool) -> Id; + # [method_id (numberWithInteger :)] + pub unsafe fn numberWithInteger(value: NSInteger) -> Id; + # [method_id (numberWithUnsignedInteger :)] + pub unsafe fn numberWithUnsignedInteger(value: NSUInteger) -> Id; } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSValue { - pub unsafe fn getValue(&self, value: NonNull) { - msg_send![self, getValue: value] - } + # [method (getValue :)] + pub unsafe fn getValue(&self, value: NonNull); } ); diff --git a/icrate/src/Foundation/generated/NSValueTransformer.rs b/icrate/src/Foundation/generated/NSValueTransformer.rs index 15d75d40d..55265ebbe 100644 --- a/icrate/src/Foundation/generated/NSValueTransformer.rs +++ b/icrate/src/Foundation/generated/NSValueTransformer.rs @@ -4,7 +4,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSValueTransformerName = NSString; extern_class!( #[derive(Debug)] @@ -15,42 +15,29 @@ extern_class!( ); extern_methods!( unsafe impl NSValueTransformer { + # [method (setValueTransformer : forName :)] pub unsafe fn setValueTransformer_forName( transformer: Option<&NSValueTransformer>, name: &NSValueTransformerName, - ) { - msg_send![ - Self::class(), - setValueTransformer: transformer, - forName: name - ] - } + ); + # [method_id (valueTransformerForName :)] pub unsafe fn valueTransformerForName( name: &NSValueTransformerName, - ) -> Option> { - msg_send_id![Self::class(), valueTransformerForName: name] - } - pub unsafe fn valueTransformerNames() -> Id, Shared> { - msg_send_id![Self::class(), valueTransformerNames] - } - pub unsafe fn transformedValueClass() -> &Class { - msg_send![Self::class(), transformedValueClass] - } - pub unsafe fn allowsReverseTransformation() -> bool { - msg_send![Self::class(), allowsReverseTransformation] - } - pub unsafe fn transformedValue( - &self, - value: Option<&Object>, - ) -> Option> { - msg_send_id![self, transformedValue: value] - } + ) -> Option>; + #[method_id(valueTransformerNames)] + pub unsafe fn valueTransformerNames() -> Id, Shared>; + #[method(transformedValueClass)] + pub unsafe fn transformedValueClass() -> &Class; + #[method(allowsReverseTransformation)] + pub unsafe fn allowsReverseTransformation() -> bool; + # [method_id (transformedValue :)] + pub unsafe fn transformedValue(&self, value: Option<&Object>) + -> Option>; + # [method_id (reverseTransformedValue :)] pub unsafe fn reverseTransformedValue( &self, value: Option<&Object>, - ) -> Option> { - msg_send_id![self, reverseTransformedValue: value] - } + ) -> Option>; } ); extern_class!( @@ -62,8 +49,7 @@ extern_class!( ); extern_methods!( unsafe impl NSSecureUnarchiveFromDataTransformer { - pub unsafe fn allowedTopLevelClasses() -> Id, Shared> { - msg_send_id![Self::class(), allowedTopLevelClasses] - } + #[method_id(allowedTopLevelClasses)] + pub unsafe fn allowedTopLevelClasses() -> Id, Shared>; } ); diff --git a/icrate/src/Foundation/generated/NSXMLDTD.rs b/icrate/src/Foundation/generated/NSXMLDTD.rs index dfe7d0d23..d7ece7f0d 100644 --- a/icrate/src/Foundation/generated/NSXMLDTD.rs +++ b/icrate/src/Foundation/generated/NSXMLDTD.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSXMLNode::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSXMLDTD; @@ -16,97 +16,74 @@ extern_class!( ); extern_methods!( unsafe impl NSXMLDTD { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithKind : options :)] pub unsafe fn initWithKind_options( &self, kind: NSXMLNodeKind, options: NSXMLNodeOptions, - ) -> Id { - msg_send_id![self, initWithKind: kind, options: options] - } + ) -> Id; + # [method_id (initWithContentsOfURL : options : error :)] pub unsafe fn initWithContentsOfURL_options_error( &self, url: &NSURL, mask: NSXMLNodeOptions, - ) -> Result, Id> { - msg_send_id![self, initWithContentsOfURL: url, options: mask, error: _] - } + ) -> Result, Id>; + # [method_id (initWithData : options : error :)] pub unsafe fn initWithData_options_error( &self, data: &NSData, mask: NSXMLNodeOptions, - ) -> Result, Id> { - msg_send_id![self, initWithData: data, options: mask, error: _] - } - pub unsafe fn publicID(&self) -> Option> { - msg_send_id![self, publicID] - } - pub unsafe fn setPublicID(&self, publicID: Option<&NSString>) { - msg_send![self, setPublicID: publicID] - } - pub unsafe fn systemID(&self) -> Option> { - msg_send_id![self, systemID] - } - pub unsafe fn setSystemID(&self, systemID: Option<&NSString>) { - msg_send![self, setSystemID: systemID] - } - pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger) { - msg_send![self, insertChild: child, atIndex: index] - } + ) -> Result, Id>; + #[method_id(publicID)] + pub unsafe fn publicID(&self) -> Option>; + # [method (setPublicID :)] + pub unsafe fn setPublicID(&self, publicID: Option<&NSString>); + #[method_id(systemID)] + pub unsafe fn systemID(&self) -> Option>; + # [method (setSystemID :)] + pub unsafe fn setSystemID(&self, systemID: Option<&NSString>); + # [method (insertChild : atIndex :)] + pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger); + # [method (insertChildren : atIndex :)] pub unsafe fn insertChildren_atIndex( &self, children: &NSArray, index: NSUInteger, - ) { - msg_send![self, insertChildren: children, atIndex: index] - } - pub unsafe fn removeChildAtIndex(&self, index: NSUInteger) { - msg_send![self, removeChildAtIndex: index] - } - pub unsafe fn setChildren(&self, children: Option<&NSArray>) { - msg_send![self, setChildren: children] - } - pub unsafe fn addChild(&self, child: &NSXMLNode) { - msg_send![self, addChild: child] - } - pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode) { - msg_send![self, replaceChildAtIndex: index, withNode: node] - } + ); + # [method (removeChildAtIndex :)] + pub unsafe fn removeChildAtIndex(&self, index: NSUInteger); + # [method (setChildren :)] + pub unsafe fn setChildren(&self, children: Option<&NSArray>); + # [method (addChild :)] + pub unsafe fn addChild(&self, child: &NSXMLNode); + # [method (replaceChildAtIndex : withNode :)] + pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode); + # [method_id (entityDeclarationForName :)] pub unsafe fn entityDeclarationForName( &self, name: &NSString, - ) -> Option> { - msg_send_id![self, entityDeclarationForName: name] - } + ) -> Option>; + # [method_id (notationDeclarationForName :)] pub unsafe fn notationDeclarationForName( &self, name: &NSString, - ) -> Option> { - msg_send_id![self, notationDeclarationForName: name] - } + ) -> Option>; + # [method_id (elementDeclarationForName :)] pub unsafe fn elementDeclarationForName( &self, name: &NSString, - ) -> Option> { - msg_send_id![self, elementDeclarationForName: name] - } + ) -> Option>; + # [method_id (attributeDeclarationForName : elementName :)] pub unsafe fn attributeDeclarationForName_elementName( &self, name: &NSString, elementName: &NSString, - ) -> Option> { - msg_send_id![ - self, - attributeDeclarationForName: name, - elementName: elementName - ] - } + ) -> Option>; + # [method_id (predefinedEntityDeclarationForName :)] pub unsafe fn predefinedEntityDeclarationForName( name: &NSString, - ) -> Option> { - msg_send_id![Self::class(), predefinedEntityDeclarationForName: name] - } + ) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSXMLDTDNode.rs b/icrate/src/Foundation/generated/NSXMLDTDNode.rs index bca0d727d..bded139ac 100644 --- a/icrate/src/Foundation/generated/NSXMLDTDNode.rs +++ b/icrate/src/Foundation/generated/NSXMLDTDNode.rs @@ -2,7 +2,7 @@ use crate::Foundation::generated::NSXMLNode::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSXMLDTDNode; @@ -12,45 +12,33 @@ extern_class!( ); extern_methods!( unsafe impl NSXMLDTDNode { - pub unsafe fn initWithXMLString(&self, string: &NSString) -> Option> { - msg_send_id![self, initWithXMLString: string] - } + # [method_id (initWithXMLString :)] + pub unsafe fn initWithXMLString(&self, string: &NSString) -> Option>; + # [method_id (initWithKind : options :)] pub unsafe fn initWithKind_options( &self, kind: NSXMLNodeKind, options: NSXMLNodeOptions, - ) -> Id { - msg_send_id![self, initWithKind: kind, options: options] - } - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn DTDKind(&self) -> NSXMLDTDNodeKind { - msg_send![self, DTDKind] - } - pub unsafe fn setDTDKind(&self, DTDKind: NSXMLDTDNodeKind) { - msg_send![self, setDTDKind: DTDKind] - } - pub unsafe fn isExternal(&self) -> bool { - msg_send![self, isExternal] - } - pub unsafe fn publicID(&self) -> Option> { - msg_send_id![self, publicID] - } - pub unsafe fn setPublicID(&self, publicID: Option<&NSString>) { - msg_send![self, setPublicID: publicID] - } - pub unsafe fn systemID(&self) -> Option> { - msg_send_id![self, systemID] - } - pub unsafe fn setSystemID(&self, systemID: Option<&NSString>) { - msg_send![self, setSystemID: systemID] - } - pub unsafe fn notationName(&self) -> Option> { - msg_send_id![self, notationName] - } - pub unsafe fn setNotationName(&self, notationName: Option<&NSString>) { - msg_send![self, setNotationName: notationName] - } + ) -> Id; + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + #[method(DTDKind)] + pub unsafe fn DTDKind(&self) -> NSXMLDTDNodeKind; + # [method (setDTDKind :)] + pub unsafe fn setDTDKind(&self, DTDKind: NSXMLDTDNodeKind); + #[method(isExternal)] + pub unsafe fn isExternal(&self) -> bool; + #[method_id(publicID)] + pub unsafe fn publicID(&self) -> Option>; + # [method (setPublicID :)] + pub unsafe fn setPublicID(&self, publicID: Option<&NSString>); + #[method_id(systemID)] + pub unsafe fn systemID(&self) -> Option>; + # [method (setSystemID :)] + pub unsafe fn setSystemID(&self, systemID: Option<&NSString>); + #[method_id(notationName)] + pub unsafe fn notationName(&self) -> Option>; + # [method (setNotationName :)] + pub unsafe fn setNotationName(&self, notationName: Option<&NSString>); } ); diff --git a/icrate/src/Foundation/generated/NSXMLDocument.rs b/icrate/src/Foundation/generated/NSXMLDocument.rs index 6bd2b392b..2f3a215a7 100644 --- a/icrate/src/Foundation/generated/NSXMLDocument.rs +++ b/icrate/src/Foundation/generated/NSXMLDocument.rs @@ -6,7 +6,7 @@ use crate::Foundation::generated::NSXMLNode::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSXMLDocument; @@ -16,147 +16,100 @@ extern_class!( ); extern_methods!( unsafe impl NSXMLDocument { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithXMLString : options : error :)] pub unsafe fn initWithXMLString_options_error( &self, string: &NSString, mask: NSXMLNodeOptions, - ) -> Result, Id> { - msg_send_id![self, initWithXMLString: string, options: mask, error: _] - } + ) -> Result, Id>; + # [method_id (initWithContentsOfURL : options : error :)] pub unsafe fn initWithContentsOfURL_options_error( &self, url: &NSURL, mask: NSXMLNodeOptions, - ) -> Result, Id> { - msg_send_id![self, initWithContentsOfURL: url, options: mask, error: _] - } + ) -> Result, Id>; + # [method_id (initWithData : options : error :)] pub unsafe fn initWithData_options_error( &self, data: &NSData, mask: NSXMLNodeOptions, - ) -> Result, Id> { - msg_send_id![self, initWithData: data, options: mask, error: _] - } + ) -> Result, Id>; + # [method_id (initWithRootElement :)] pub unsafe fn initWithRootElement( &self, element: Option<&NSXMLElement>, - ) -> Id { - msg_send_id![self, initWithRootElement: element] - } - pub unsafe fn replacementClassForClass(cls: &Class) -> &Class { - msg_send![Self::class(), replacementClassForClass: cls] - } - pub unsafe fn characterEncoding(&self) -> Option> { - msg_send_id![self, characterEncoding] - } - pub unsafe fn setCharacterEncoding(&self, characterEncoding: Option<&NSString>) { - msg_send![self, setCharacterEncoding: characterEncoding] - } - pub unsafe fn version(&self) -> Option> { - msg_send_id![self, version] - } - pub unsafe fn setVersion(&self, version: Option<&NSString>) { - msg_send![self, setVersion: version] - } - pub unsafe fn isStandalone(&self) -> bool { - msg_send![self, isStandalone] - } - pub unsafe fn setStandalone(&self, standalone: bool) { - msg_send![self, setStandalone: standalone] - } - pub unsafe fn documentContentKind(&self) -> NSXMLDocumentContentKind { - msg_send![self, documentContentKind] - } - pub unsafe fn setDocumentContentKind(&self, documentContentKind: NSXMLDocumentContentKind) { - msg_send![self, setDocumentContentKind: documentContentKind] - } - pub unsafe fn MIMEType(&self) -> Option> { - msg_send_id![self, MIMEType] - } - pub unsafe fn setMIMEType(&self, MIMEType: Option<&NSString>) { - msg_send![self, setMIMEType: MIMEType] - } - pub unsafe fn DTD(&self) -> Option> { - msg_send_id![self, DTD] - } - pub unsafe fn setDTD(&self, DTD: Option<&NSXMLDTD>) { - msg_send![self, setDTD: DTD] - } - pub unsafe fn setRootElement(&self, root: &NSXMLElement) { - msg_send![self, setRootElement: root] - } - pub unsafe fn rootElement(&self) -> Option> { - msg_send_id![self, rootElement] - } - pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger) { - msg_send![self, insertChild: child, atIndex: index] - } + ) -> Id; + # [method (replacementClassForClass :)] + pub unsafe fn replacementClassForClass(cls: &Class) -> &Class; + #[method_id(characterEncoding)] + pub unsafe fn characterEncoding(&self) -> Option>; + # [method (setCharacterEncoding :)] + pub unsafe fn setCharacterEncoding(&self, characterEncoding: Option<&NSString>); + #[method_id(version)] + pub unsafe fn version(&self) -> Option>; + # [method (setVersion :)] + pub unsafe fn setVersion(&self, version: Option<&NSString>); + #[method(isStandalone)] + pub unsafe fn isStandalone(&self) -> bool; + # [method (setStandalone :)] + pub unsafe fn setStandalone(&self, standalone: bool); + #[method(documentContentKind)] + pub unsafe fn documentContentKind(&self) -> NSXMLDocumentContentKind; + # [method (setDocumentContentKind :)] + pub unsafe fn setDocumentContentKind(&self, documentContentKind: NSXMLDocumentContentKind); + #[method_id(MIMEType)] + pub unsafe fn MIMEType(&self) -> Option>; + # [method (setMIMEType :)] + pub unsafe fn setMIMEType(&self, MIMEType: Option<&NSString>); + #[method_id(DTD)] + pub unsafe fn DTD(&self) -> Option>; + # [method (setDTD :)] + pub unsafe fn setDTD(&self, DTD: Option<&NSXMLDTD>); + # [method (setRootElement :)] + pub unsafe fn setRootElement(&self, root: &NSXMLElement); + #[method_id(rootElement)] + pub unsafe fn rootElement(&self) -> Option>; + # [method (insertChild : atIndex :)] + pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger); + # [method (insertChildren : atIndex :)] pub unsafe fn insertChildren_atIndex( &self, children: &NSArray, index: NSUInteger, - ) { - msg_send![self, insertChildren: children, atIndex: index] - } - pub unsafe fn removeChildAtIndex(&self, index: NSUInteger) { - msg_send![self, removeChildAtIndex: index] - } - pub unsafe fn setChildren(&self, children: Option<&NSArray>) { - msg_send![self, setChildren: children] - } - pub unsafe fn addChild(&self, child: &NSXMLNode) { - msg_send![self, addChild: child] - } - pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode) { - msg_send![self, replaceChildAtIndex: index, withNode: node] - } - pub unsafe fn XMLData(&self) -> Id { - msg_send_id![self, XMLData] - } - pub unsafe fn XMLDataWithOptions(&self, options: NSXMLNodeOptions) -> Id { - msg_send_id![self, XMLDataWithOptions: options] - } + ); + # [method (removeChildAtIndex :)] + pub unsafe fn removeChildAtIndex(&self, index: NSUInteger); + # [method (setChildren :)] + pub unsafe fn setChildren(&self, children: Option<&NSArray>); + # [method (addChild :)] + pub unsafe fn addChild(&self, child: &NSXMLNode); + # [method (replaceChildAtIndex : withNode :)] + pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode); + #[method_id(XMLData)] + pub unsafe fn XMLData(&self) -> Id; + # [method_id (XMLDataWithOptions :)] + pub unsafe fn XMLDataWithOptions(&self, options: NSXMLNodeOptions) -> Id; + # [method_id (objectByApplyingXSLT : arguments : error :)] pub unsafe fn objectByApplyingXSLT_arguments_error( &self, xslt: &NSData, arguments: Option<&NSDictionary>, - ) -> Result, Id> { - msg_send_id![ - self, - objectByApplyingXSLT: xslt, - arguments: arguments, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (objectByApplyingXSLTString : arguments : error :)] pub unsafe fn objectByApplyingXSLTString_arguments_error( &self, xslt: &NSString, arguments: Option<&NSDictionary>, - ) -> Result, Id> { - msg_send_id![ - self, - objectByApplyingXSLTString: xslt, - arguments: arguments, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (objectByApplyingXSLTAtURL : arguments : error :)] pub unsafe fn objectByApplyingXSLTAtURL_arguments_error( &self, xsltURL: &NSURL, argument: Option<&NSDictionary>, - ) -> Result, Id> { - msg_send_id![ - self, - objectByApplyingXSLTAtURL: xsltURL, - arguments: argument, - error: _ - ] - } - pub unsafe fn validateAndReturnError(&self) -> Result<(), Id> { - msg_send![self, validateAndReturnError: _] - } + ) -> Result, Id>; + # [method (validateAndReturnError :)] + pub unsafe fn validateAndReturnError(&self) -> Result<(), Id>; } ); diff --git a/icrate/src/Foundation/generated/NSXMLElement.rs b/icrate/src/Foundation/generated/NSXMLElement.rs index e52ced552..7b0c09e14 100644 --- a/icrate/src/Foundation/generated/NSXMLElement.rs +++ b/icrate/src/Foundation/generated/NSXMLElement.rs @@ -7,7 +7,7 @@ use crate::Foundation::generated::NSXMLNode::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSXMLElement; @@ -17,133 +17,104 @@ extern_class!( ); extern_methods!( unsafe impl NSXMLElement { - pub unsafe fn initWithName(&self, name: &NSString) -> Id { - msg_send_id![self, initWithName: name] - } + # [method_id (initWithName :)] + pub unsafe fn initWithName(&self, name: &NSString) -> Id; + # [method_id (initWithName : URI :)] pub unsafe fn initWithName_URI( &self, name: &NSString, URI: Option<&NSString>, - ) -> Id { - msg_send_id![self, initWithName: name, URI: URI] - } + ) -> Id; + # [method_id (initWithName : stringValue :)] pub unsafe fn initWithName_stringValue( &self, name: &NSString, string: Option<&NSString>, - ) -> Id { - msg_send_id![self, initWithName: name, stringValue: string] - } + ) -> Id; + # [method_id (initWithXMLString : error :)] pub unsafe fn initWithXMLString_error( &self, string: &NSString, - ) -> Result, Id> { - msg_send_id![self, initWithXMLString: string, error: _] - } + ) -> Result, Id>; + # [method_id (initWithKind : options :)] pub unsafe fn initWithKind_options( &self, kind: NSXMLNodeKind, options: NSXMLNodeOptions, - ) -> Id { - msg_send_id![self, initWithKind: kind, options: options] - } - pub unsafe fn elementsForName(&self, name: &NSString) -> Id, Shared> { - msg_send_id![self, elementsForName: name] - } + ) -> Id; + # [method_id (elementsForName :)] + pub unsafe fn elementsForName(&self, name: &NSString) -> Id, Shared>; + # [method_id (elementsForLocalName : URI :)] pub unsafe fn elementsForLocalName_URI( &self, localName: &NSString, URI: Option<&NSString>, - ) -> Id, Shared> { - msg_send_id![self, elementsForLocalName: localName, URI: URI] - } - pub unsafe fn addAttribute(&self, attribute: &NSXMLNode) { - msg_send![self, addAttribute: attribute] - } - pub unsafe fn removeAttributeForName(&self, name: &NSString) { - msg_send![self, removeAttributeForName: name] - } - pub unsafe fn attributes(&self) -> Option, Shared>> { - msg_send_id![self, attributes] - } - pub unsafe fn setAttributes(&self, attributes: Option<&NSArray>) { - msg_send![self, setAttributes: attributes] - } + ) -> Id, Shared>; + # [method (addAttribute :)] + pub unsafe fn addAttribute(&self, attribute: &NSXMLNode); + # [method (removeAttributeForName :)] + pub unsafe fn removeAttributeForName(&self, name: &NSString); + #[method_id(attributes)] + pub unsafe fn attributes(&self) -> Option, Shared>>; + # [method (setAttributes :)] + pub unsafe fn setAttributes(&self, attributes: Option<&NSArray>); + # [method (setAttributesWithDictionary :)] pub unsafe fn setAttributesWithDictionary( &self, attributes: &NSDictionary, - ) { - msg_send![self, setAttributesWithDictionary: attributes] - } - pub unsafe fn attributeForName(&self, name: &NSString) -> Option> { - msg_send_id![self, attributeForName: name] - } + ); + # [method_id (attributeForName :)] + pub unsafe fn attributeForName(&self, name: &NSString) -> Option>; + # [method_id (attributeForLocalName : URI :)] pub unsafe fn attributeForLocalName_URI( &self, localName: &NSString, URI: Option<&NSString>, - ) -> Option> { - msg_send_id![self, attributeForLocalName: localName, URI: URI] - } - pub unsafe fn addNamespace(&self, aNamespace: &NSXMLNode) { - msg_send![self, addNamespace: aNamespace] - } - pub unsafe fn removeNamespaceForPrefix(&self, name: &NSString) { - msg_send![self, removeNamespaceForPrefix: name] - } - pub unsafe fn namespaces(&self) -> Option, Shared>> { - msg_send_id![self, namespaces] - } - pub unsafe fn setNamespaces(&self, namespaces: Option<&NSArray>) { - msg_send![self, setNamespaces: namespaces] - } - pub unsafe fn namespaceForPrefix(&self, name: &NSString) -> Option> { - msg_send_id![self, namespaceForPrefix: name] - } + ) -> Option>; + # [method (addNamespace :)] + pub unsafe fn addNamespace(&self, aNamespace: &NSXMLNode); + # [method (removeNamespaceForPrefix :)] + pub unsafe fn removeNamespaceForPrefix(&self, name: &NSString); + #[method_id(namespaces)] + pub unsafe fn namespaces(&self) -> Option, Shared>>; + # [method (setNamespaces :)] + pub unsafe fn setNamespaces(&self, namespaces: Option<&NSArray>); + # [method_id (namespaceForPrefix :)] + pub unsafe fn namespaceForPrefix(&self, name: &NSString) -> Option>; + # [method_id (resolveNamespaceForName :)] pub unsafe fn resolveNamespaceForName( &self, name: &NSString, - ) -> Option> { - msg_send_id![self, resolveNamespaceForName: name] - } + ) -> Option>; + # [method_id (resolvePrefixForNamespaceURI :)] pub unsafe fn resolvePrefixForNamespaceURI( &self, namespaceURI: &NSString, - ) -> Option> { - msg_send_id![self, resolvePrefixForNamespaceURI: namespaceURI] - } - pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger) { - msg_send![self, insertChild: child, atIndex: index] - } + ) -> Option>; + # [method (insertChild : atIndex :)] + pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger); + # [method (insertChildren : atIndex :)] pub unsafe fn insertChildren_atIndex( &self, children: &NSArray, index: NSUInteger, - ) { - msg_send![self, insertChildren: children, atIndex: index] - } - pub unsafe fn removeChildAtIndex(&self, index: NSUInteger) { - msg_send![self, removeChildAtIndex: index] - } - pub unsafe fn setChildren(&self, children: Option<&NSArray>) { - msg_send![self, setChildren: children] - } - pub unsafe fn addChild(&self, child: &NSXMLNode) { - msg_send![self, addChild: child] - } - pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode) { - msg_send![self, replaceChildAtIndex: index, withNode: node] - } - pub unsafe fn normalizeAdjacentTextNodesPreservingCDATA(&self, preserve: bool) { - msg_send![self, normalizeAdjacentTextNodesPreservingCDATA: preserve] - } + ); + # [method (removeChildAtIndex :)] + pub unsafe fn removeChildAtIndex(&self, index: NSUInteger); + # [method (setChildren :)] + pub unsafe fn setChildren(&self, children: Option<&NSArray>); + # [method (addChild :)] + pub unsafe fn addChild(&self, child: &NSXMLNode); + # [method (replaceChildAtIndex : withNode :)] + pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode); + # [method (normalizeAdjacentTextNodesPreservingCDATA :)] + pub unsafe fn normalizeAdjacentTextNodesPreservingCDATA(&self, preserve: bool); } ); extern_methods!( #[doc = "NSDeprecated"] unsafe impl NSXMLElement { - pub unsafe fn setAttributesAsDictionary(&self, attributes: &NSDictionary) { - msg_send![self, setAttributesAsDictionary: attributes] - } + # [method (setAttributesAsDictionary :)] + pub unsafe fn setAttributesAsDictionary(&self, attributes: &NSDictionary); } ); diff --git a/icrate/src/Foundation/generated/NSXMLNode.rs b/icrate/src/Foundation/generated/NSXMLNode.rs index f093142a5..9de6243d7 100644 --- a/icrate/src/Foundation/generated/NSXMLNode.rs +++ b/icrate/src/Foundation/generated/NSXMLNode.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSXMLNodeOptions::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSXMLNode; @@ -20,227 +20,149 @@ extern_class!( ); extern_methods!( unsafe impl NSXMLNode { - pub unsafe fn init(&self) -> Id { - msg_send_id![self, init] - } - pub unsafe fn initWithKind(&self, kind: NSXMLNodeKind) -> Id { - msg_send_id![self, initWithKind: kind] - } + #[method_id(init)] + pub unsafe fn init(&self) -> Id; + # [method_id (initWithKind :)] + pub unsafe fn initWithKind(&self, kind: NSXMLNodeKind) -> Id; + # [method_id (initWithKind : options :)] pub unsafe fn initWithKind_options( &self, kind: NSXMLNodeKind, options: NSXMLNodeOptions, - ) -> Id { - msg_send_id![self, initWithKind: kind, options: options] - } - pub unsafe fn document() -> Id { - msg_send_id![Self::class(), document] - } - pub unsafe fn documentWithRootElement(element: &NSXMLElement) -> Id { - msg_send_id![Self::class(), documentWithRootElement: element] - } - pub unsafe fn elementWithName(name: &NSString) -> Id { - msg_send_id![Self::class(), elementWithName: name] - } - pub unsafe fn elementWithName_URI(name: &NSString, URI: &NSString) -> Id { - msg_send_id![Self::class(), elementWithName: name, URI: URI] - } + ) -> Id; + #[method_id(document)] + pub unsafe fn document() -> Id; + # [method_id (documentWithRootElement :)] + pub unsafe fn documentWithRootElement(element: &NSXMLElement) -> Id; + # [method_id (elementWithName :)] + pub unsafe fn elementWithName(name: &NSString) -> Id; + # [method_id (elementWithName : URI :)] + pub unsafe fn elementWithName_URI(name: &NSString, URI: &NSString) -> Id; + # [method_id (elementWithName : stringValue :)] pub unsafe fn elementWithName_stringValue( name: &NSString, string: &NSString, - ) -> Id { - msg_send_id![Self::class(), elementWithName: name, stringValue: string] - } + ) -> Id; + # [method_id (elementWithName : children : attributes :)] pub unsafe fn elementWithName_children_attributes( name: &NSString, children: Option<&NSArray>, attributes: Option<&NSArray>, - ) -> Id { - msg_send_id![ - Self::class(), - elementWithName: name, - children: children, - attributes: attributes - ] - } + ) -> Id; + # [method_id (attributeWithName : stringValue :)] pub unsafe fn attributeWithName_stringValue( name: &NSString, stringValue: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - attributeWithName: name, - stringValue: stringValue - ] - } + ) -> Id; + # [method_id (attributeWithName : URI : stringValue :)] pub unsafe fn attributeWithName_URI_stringValue( name: &NSString, URI: &NSString, stringValue: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - attributeWithName: name, - URI: URI, - stringValue: stringValue - ] - } + ) -> Id; + # [method_id (namespaceWithName : stringValue :)] pub unsafe fn namespaceWithName_stringValue( name: &NSString, stringValue: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - namespaceWithName: name, - stringValue: stringValue - ] - } + ) -> Id; + # [method_id (processingInstructionWithName : stringValue :)] pub unsafe fn processingInstructionWithName_stringValue( name: &NSString, stringValue: &NSString, - ) -> Id { - msg_send_id![ - Self::class(), - processingInstructionWithName: name, - stringValue: stringValue - ] - } - pub unsafe fn commentWithStringValue(stringValue: &NSString) -> Id { - msg_send_id![Self::class(), commentWithStringValue: stringValue] - } - pub unsafe fn textWithStringValue(stringValue: &NSString) -> Id { - msg_send_id![Self::class(), textWithStringValue: stringValue] - } - pub unsafe fn DTDNodeWithXMLString(string: &NSString) -> Option> { - msg_send_id![Self::class(), DTDNodeWithXMLString: string] - } - pub unsafe fn kind(&self) -> NSXMLNodeKind { - msg_send![self, kind] - } - pub unsafe fn name(&self) -> Option> { - msg_send_id![self, name] - } - pub unsafe fn setName(&self, name: Option<&NSString>) { - msg_send![self, setName: name] - } - pub unsafe fn objectValue(&self) -> Option> { - msg_send_id![self, objectValue] - } - pub unsafe fn setObjectValue(&self, objectValue: Option<&Object>) { - msg_send![self, setObjectValue: objectValue] - } - pub unsafe fn stringValue(&self) -> Option> { - msg_send_id![self, stringValue] - } - pub unsafe fn setStringValue(&self, stringValue: Option<&NSString>) { - msg_send![self, setStringValue: stringValue] - } - pub unsafe fn setStringValue_resolvingEntities(&self, string: &NSString, resolve: bool) { - msg_send![self, setStringValue: string, resolvingEntities: resolve] - } - pub unsafe fn index(&self) -> NSUInteger { - msg_send![self, index] - } - pub unsafe fn level(&self) -> NSUInteger { - msg_send![self, level] - } - pub unsafe fn rootDocument(&self) -> Option> { - msg_send_id![self, rootDocument] - } - pub unsafe fn parent(&self) -> Option> { - msg_send_id![self, parent] - } - pub unsafe fn childCount(&self) -> NSUInteger { - msg_send![self, childCount] - } - pub unsafe fn children(&self) -> Option, Shared>> { - msg_send_id![self, children] - } - pub unsafe fn childAtIndex(&self, index: NSUInteger) -> Option> { - msg_send_id![self, childAtIndex: index] - } - pub unsafe fn previousSibling(&self) -> Option> { - msg_send_id![self, previousSibling] - } - pub unsafe fn nextSibling(&self) -> Option> { - msg_send_id![self, nextSibling] - } - pub unsafe fn previousNode(&self) -> Option> { - msg_send_id![self, previousNode] - } - pub unsafe fn nextNode(&self) -> Option> { - msg_send_id![self, nextNode] - } - pub unsafe fn detach(&self) { - msg_send![self, detach] - } - pub unsafe fn XPath(&self) -> Option> { - msg_send_id![self, XPath] - } - pub unsafe fn localName(&self) -> Option> { - msg_send_id![self, localName] - } - pub unsafe fn prefix(&self) -> Option> { - msg_send_id![self, prefix] - } - pub unsafe fn URI(&self) -> Option> { - msg_send_id![self, URI] - } - pub unsafe fn setURI(&self, URI: Option<&NSString>) { - msg_send![self, setURI: URI] - } - pub unsafe fn localNameForName(name: &NSString) -> Id { - msg_send_id![Self::class(), localNameForName: name] - } - pub unsafe fn prefixForName(name: &NSString) -> Option> { - msg_send_id![Self::class(), prefixForName: name] - } + ) -> Id; + # [method_id (commentWithStringValue :)] + pub unsafe fn commentWithStringValue(stringValue: &NSString) -> Id; + # [method_id (textWithStringValue :)] + pub unsafe fn textWithStringValue(stringValue: &NSString) -> Id; + # [method_id (DTDNodeWithXMLString :)] + pub unsafe fn DTDNodeWithXMLString(string: &NSString) -> Option>; + #[method(kind)] + pub unsafe fn kind(&self) -> NSXMLNodeKind; + #[method_id(name)] + pub unsafe fn name(&self) -> Option>; + # [method (setName :)] + pub unsafe fn setName(&self, name: Option<&NSString>); + #[method_id(objectValue)] + pub unsafe fn objectValue(&self) -> Option>; + # [method (setObjectValue :)] + pub unsafe fn setObjectValue(&self, objectValue: Option<&Object>); + #[method_id(stringValue)] + pub unsafe fn stringValue(&self) -> Option>; + # [method (setStringValue :)] + pub unsafe fn setStringValue(&self, stringValue: Option<&NSString>); + # [method (setStringValue : resolvingEntities :)] + pub unsafe fn setStringValue_resolvingEntities(&self, string: &NSString, resolve: bool); + #[method(index)] + pub unsafe fn index(&self) -> NSUInteger; + #[method(level)] + pub unsafe fn level(&self) -> NSUInteger; + #[method_id(rootDocument)] + pub unsafe fn rootDocument(&self) -> Option>; + #[method_id(parent)] + pub unsafe fn parent(&self) -> Option>; + #[method(childCount)] + pub unsafe fn childCount(&self) -> NSUInteger; + #[method_id(children)] + pub unsafe fn children(&self) -> Option, Shared>>; + # [method_id (childAtIndex :)] + pub unsafe fn childAtIndex(&self, index: NSUInteger) -> Option>; + #[method_id(previousSibling)] + pub unsafe fn previousSibling(&self) -> Option>; + #[method_id(nextSibling)] + pub unsafe fn nextSibling(&self) -> Option>; + #[method_id(previousNode)] + pub unsafe fn previousNode(&self) -> Option>; + #[method_id(nextNode)] + pub unsafe fn nextNode(&self) -> Option>; + #[method(detach)] + pub unsafe fn detach(&self); + #[method_id(XPath)] + pub unsafe fn XPath(&self) -> Option>; + #[method_id(localName)] + pub unsafe fn localName(&self) -> Option>; + #[method_id(prefix)] + pub unsafe fn prefix(&self) -> Option>; + #[method_id(URI)] + pub unsafe fn URI(&self) -> Option>; + # [method (setURI :)] + pub unsafe fn setURI(&self, URI: Option<&NSString>); + # [method_id (localNameForName :)] + pub unsafe fn localNameForName(name: &NSString) -> Id; + # [method_id (prefixForName :)] + pub unsafe fn prefixForName(name: &NSString) -> Option>; + # [method_id (predefinedNamespaceForPrefix :)] pub unsafe fn predefinedNamespaceForPrefix( name: &NSString, - ) -> Option> { - msg_send_id![Self::class(), predefinedNamespaceForPrefix: name] - } - pub unsafe fn description(&self) -> Id { - msg_send_id![self, description] - } - pub unsafe fn XMLString(&self) -> Id { - msg_send_id![self, XMLString] - } + ) -> Option>; + #[method_id(description)] + pub unsafe fn description(&self) -> Id; + #[method_id(XMLString)] + pub unsafe fn XMLString(&self) -> Id; + # [method_id (XMLStringWithOptions :)] pub unsafe fn XMLStringWithOptions( &self, options: NSXMLNodeOptions, - ) -> Id { - msg_send_id![self, XMLStringWithOptions: options] - } + ) -> Id; + # [method_id (canonicalXMLStringPreservingComments :)] pub unsafe fn canonicalXMLStringPreservingComments( &self, comments: bool, - ) -> Id { - msg_send_id![self, canonicalXMLStringPreservingComments: comments] - } + ) -> Id; + # [method_id (nodesForXPath : error :)] pub unsafe fn nodesForXPath_error( &self, xpath: &NSString, - ) -> Result, Shared>, Id> { - msg_send_id![self, nodesForXPath: xpath, error: _] - } + ) -> Result, Shared>, Id>; + # [method_id (objectsForXQuery : constants : error :)] pub unsafe fn objectsForXQuery_constants_error( &self, xquery: &NSString, constants: Option<&NSDictionary>, - ) -> Result, Id> { - msg_send_id![ - self, - objectsForXQuery: xquery, - constants: constants, - error: _ - ] - } + ) -> Result, Id>; + # [method_id (objectsForXQuery : error :)] pub unsafe fn objectsForXQuery_error( &self, xquery: &NSString, - ) -> Result, Id> { - msg_send_id![self, objectsForXQuery: xquery, error: _] - } + ) -> Result, Id>; } ); diff --git a/icrate/src/Foundation/generated/NSXMLNodeOptions.rs b/icrate/src/Foundation/generated/NSXMLNodeOptions.rs index 97bb9cbef..5362722ad 100644 --- a/icrate/src/Foundation/generated/NSXMLNodeOptions.rs +++ b/icrate/src/Foundation/generated/NSXMLNodeOptions.rs @@ -2,4 +2,4 @@ use crate::Foundation::generated::NSObjCRuntime::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; diff --git a/icrate/src/Foundation/generated/NSXMLParser.rs b/icrate/src/Foundation/generated/NSXMLParser.rs index 7c9a83651..313413b66 100644 --- a/icrate/src/Foundation/generated/NSXMLParser.rs +++ b/icrate/src/Foundation/generated/NSXMLParser.rs @@ -10,7 +10,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; extern_class!( #[derive(Debug)] pub struct NSXMLParser; @@ -20,97 +20,63 @@ extern_class!( ); extern_methods!( unsafe impl NSXMLParser { - pub unsafe fn initWithContentsOfURL(&self, url: &NSURL) -> Option> { - msg_send_id![self, initWithContentsOfURL: url] - } - pub unsafe fn initWithData(&self, data: &NSData) -> Id { - msg_send_id![self, initWithData: data] - } - pub unsafe fn initWithStream(&self, stream: &NSInputStream) -> Id { - msg_send_id![self, initWithStream: stream] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSXMLParserDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn shouldProcessNamespaces(&self) -> bool { - msg_send![self, shouldProcessNamespaces] - } - pub unsafe fn setShouldProcessNamespaces(&self, shouldProcessNamespaces: bool) { - msg_send![self, setShouldProcessNamespaces: shouldProcessNamespaces] - } - pub unsafe fn shouldReportNamespacePrefixes(&self) -> bool { - msg_send![self, shouldReportNamespacePrefixes] - } - pub unsafe fn setShouldReportNamespacePrefixes(&self, shouldReportNamespacePrefixes: bool) { - msg_send![ - self, - setShouldReportNamespacePrefixes: shouldReportNamespacePrefixes - ] - } + # [method_id (initWithContentsOfURL :)] + pub unsafe fn initWithContentsOfURL(&self, url: &NSURL) -> Option>; + # [method_id (initWithData :)] + pub unsafe fn initWithData(&self, data: &NSData) -> Id; + # [method_id (initWithStream :)] + pub unsafe fn initWithStream(&self, stream: &NSInputStream) -> Id; + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSXMLParserDelegate>); + #[method(shouldProcessNamespaces)] + pub unsafe fn shouldProcessNamespaces(&self) -> bool; + # [method (setShouldProcessNamespaces :)] + pub unsafe fn setShouldProcessNamespaces(&self, shouldProcessNamespaces: bool); + #[method(shouldReportNamespacePrefixes)] + pub unsafe fn shouldReportNamespacePrefixes(&self) -> bool; + # [method (setShouldReportNamespacePrefixes :)] + pub unsafe fn setShouldReportNamespacePrefixes(&self, shouldReportNamespacePrefixes: bool); + #[method(externalEntityResolvingPolicy)] pub unsafe fn externalEntityResolvingPolicy( &self, - ) -> NSXMLParserExternalEntityResolvingPolicy { - msg_send![self, externalEntityResolvingPolicy] - } + ) -> NSXMLParserExternalEntityResolvingPolicy; + # [method (setExternalEntityResolvingPolicy :)] pub unsafe fn setExternalEntityResolvingPolicy( &self, externalEntityResolvingPolicy: NSXMLParserExternalEntityResolvingPolicy, - ) { - msg_send![ - self, - setExternalEntityResolvingPolicy: externalEntityResolvingPolicy - ] - } - pub unsafe fn allowedExternalEntityURLs(&self) -> Option, Shared>> { - msg_send_id![self, allowedExternalEntityURLs] - } + ); + #[method_id(allowedExternalEntityURLs)] + pub unsafe fn allowedExternalEntityURLs(&self) -> Option, Shared>>; + # [method (setAllowedExternalEntityURLs :)] pub unsafe fn setAllowedExternalEntityURLs( &self, allowedExternalEntityURLs: Option<&NSSet>, - ) { - msg_send![ - self, - setAllowedExternalEntityURLs: allowedExternalEntityURLs - ] - } - pub unsafe fn parse(&self) -> bool { - msg_send![self, parse] - } - pub unsafe fn abortParsing(&self) { - msg_send![self, abortParsing] - } - pub unsafe fn parserError(&self) -> Option> { - msg_send_id![self, parserError] - } - pub unsafe fn shouldResolveExternalEntities(&self) -> bool { - msg_send![self, shouldResolveExternalEntities] - } - pub unsafe fn setShouldResolveExternalEntities(&self, shouldResolveExternalEntities: bool) { - msg_send![ - self, - setShouldResolveExternalEntities: shouldResolveExternalEntities - ] - } + ); + #[method(parse)] + pub unsafe fn parse(&self) -> bool; + #[method(abortParsing)] + pub unsafe fn abortParsing(&self); + #[method_id(parserError)] + pub unsafe fn parserError(&self) -> Option>; + #[method(shouldResolveExternalEntities)] + pub unsafe fn shouldResolveExternalEntities(&self) -> bool; + # [method (setShouldResolveExternalEntities :)] + pub unsafe fn setShouldResolveExternalEntities(&self, shouldResolveExternalEntities: bool); } ); extern_methods!( #[doc = "NSXMLParserLocatorAdditions"] unsafe impl NSXMLParser { - pub unsafe fn publicID(&self) -> Option> { - msg_send_id![self, publicID] - } - pub unsafe fn systemID(&self) -> Option> { - msg_send_id![self, systemID] - } - pub unsafe fn lineNumber(&self) -> NSInteger { - msg_send![self, lineNumber] - } - pub unsafe fn columnNumber(&self) -> NSInteger { - msg_send![self, columnNumber] - } + #[method_id(publicID)] + pub unsafe fn publicID(&self) -> Option>; + #[method_id(systemID)] + pub unsafe fn systemID(&self) -> Option>; + #[method(lineNumber)] + pub unsafe fn lineNumber(&self) -> NSInteger; + #[method(columnNumber)] + pub unsafe fn columnNumber(&self) -> NSInteger; } ); pub type NSXMLParserDelegate = NSObject; diff --git a/icrate/src/Foundation/generated/NSXPCConnection.rs b/icrate/src/Foundation/generated/NSXPCConnection.rs index 0a911784b..6b37b59bf 100644 --- a/icrate/src/Foundation/generated/NSXPCConnection.rs +++ b/icrate/src/Foundation/generated/NSXPCConnection.rs @@ -13,7 +13,7 @@ use crate::Foundation::generated::NSObject::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType}; pub type NSXPCProxyCreating = NSObject; extern_class!( #[derive(Debug)] @@ -24,103 +24,76 @@ extern_class!( ); extern_methods!( unsafe impl NSXPCConnection { - pub unsafe fn initWithServiceName(&self, serviceName: &NSString) -> Id { - msg_send_id![self, initWithServiceName: serviceName] - } - pub unsafe fn serviceName(&self) -> Option> { - msg_send_id![self, serviceName] - } + # [method_id (initWithServiceName :)] + pub unsafe fn initWithServiceName(&self, serviceName: &NSString) -> Id; + #[method_id(serviceName)] + pub unsafe fn serviceName(&self) -> Option>; + # [method_id (initWithMachServiceName : options :)] pub unsafe fn initWithMachServiceName_options( &self, name: &NSString, options: NSXPCConnectionOptions, - ) -> Id { - msg_send_id![self, initWithMachServiceName: name, options: options] - } + ) -> Id; + # [method_id (initWithListenerEndpoint :)] pub unsafe fn initWithListenerEndpoint( &self, endpoint: &NSXPCListenerEndpoint, - ) -> Id { - msg_send_id![self, initWithListenerEndpoint: endpoint] - } - pub unsafe fn endpoint(&self) -> Id { - msg_send_id![self, endpoint] - } - pub unsafe fn exportedInterface(&self) -> Option> { - msg_send_id![self, exportedInterface] - } - pub unsafe fn setExportedInterface(&self, exportedInterface: Option<&NSXPCInterface>) { - msg_send![self, setExportedInterface: exportedInterface] - } - pub unsafe fn exportedObject(&self) -> Option> { - msg_send_id![self, exportedObject] - } - pub unsafe fn setExportedObject(&self, exportedObject: Option<&Object>) { - msg_send![self, setExportedObject: exportedObject] - } - pub unsafe fn remoteObjectInterface(&self) -> Option> { - msg_send_id![self, remoteObjectInterface] - } + ) -> Id; + #[method_id(endpoint)] + pub unsafe fn endpoint(&self) -> Id; + #[method_id(exportedInterface)] + pub unsafe fn exportedInterface(&self) -> Option>; + # [method (setExportedInterface :)] + pub unsafe fn setExportedInterface(&self, exportedInterface: Option<&NSXPCInterface>); + #[method_id(exportedObject)] + pub unsafe fn exportedObject(&self) -> Option>; + # [method (setExportedObject :)] + pub unsafe fn setExportedObject(&self, exportedObject: Option<&Object>); + #[method_id(remoteObjectInterface)] + pub unsafe fn remoteObjectInterface(&self) -> Option>; + # [method (setRemoteObjectInterface :)] pub unsafe fn setRemoteObjectInterface( &self, remoteObjectInterface: Option<&NSXPCInterface>, - ) { - msg_send![self, setRemoteObjectInterface: remoteObjectInterface] - } - pub unsafe fn remoteObjectProxy(&self) -> Id { - msg_send_id![self, remoteObjectProxy] - } + ); + #[method_id(remoteObjectProxy)] + pub unsafe fn remoteObjectProxy(&self) -> Id; + # [method_id (remoteObjectProxyWithErrorHandler :)] pub unsafe fn remoteObjectProxyWithErrorHandler( &self, handler: TodoBlock, - ) -> Id { - msg_send_id![self, remoteObjectProxyWithErrorHandler: handler] - } + ) -> Id; + # [method_id (synchronousRemoteObjectProxyWithErrorHandler :)] pub unsafe fn synchronousRemoteObjectProxyWithErrorHandler( &self, handler: TodoBlock, - ) -> Id { - msg_send_id![self, synchronousRemoteObjectProxyWithErrorHandler: handler] - } - pub unsafe fn interruptionHandler(&self) -> TodoBlock { - msg_send![self, interruptionHandler] - } - pub unsafe fn setInterruptionHandler(&self, interruptionHandler: TodoBlock) { - msg_send![self, setInterruptionHandler: interruptionHandler] - } - pub unsafe fn invalidationHandler(&self) -> TodoBlock { - msg_send![self, invalidationHandler] - } - pub unsafe fn setInvalidationHandler(&self, invalidationHandler: TodoBlock) { - msg_send![self, setInvalidationHandler: invalidationHandler] - } - pub unsafe fn resume(&self) { - msg_send![self, resume] - } - pub unsafe fn suspend(&self) { - msg_send![self, suspend] - } - pub unsafe fn invalidate(&self) { - msg_send![self, invalidate] - } - pub unsafe fn auditSessionIdentifier(&self) -> au_asid_t { - msg_send![self, auditSessionIdentifier] - } - pub unsafe fn processIdentifier(&self) -> pid_t { - msg_send![self, processIdentifier] - } - pub unsafe fn effectiveUserIdentifier(&self) -> uid_t { - msg_send![self, effectiveUserIdentifier] - } - pub unsafe fn effectiveGroupIdentifier(&self) -> gid_t { - msg_send![self, effectiveGroupIdentifier] - } - pub unsafe fn currentConnection() -> Option> { - msg_send_id![Self::class(), currentConnection] - } - pub unsafe fn scheduleSendBarrierBlock(&self, block: TodoBlock) { - msg_send![self, scheduleSendBarrierBlock: block] - } + ) -> Id; + #[method(interruptionHandler)] + pub unsafe fn interruptionHandler(&self) -> TodoBlock; + # [method (setInterruptionHandler :)] + pub unsafe fn setInterruptionHandler(&self, interruptionHandler: TodoBlock); + #[method(invalidationHandler)] + pub unsafe fn invalidationHandler(&self) -> TodoBlock; + # [method (setInvalidationHandler :)] + pub unsafe fn setInvalidationHandler(&self, invalidationHandler: TodoBlock); + #[method(resume)] + pub unsafe fn resume(&self); + #[method(suspend)] + pub unsafe fn suspend(&self); + #[method(invalidate)] + pub unsafe fn invalidate(&self); + #[method(auditSessionIdentifier)] + pub unsafe fn auditSessionIdentifier(&self) -> au_asid_t; + #[method(processIdentifier)] + pub unsafe fn processIdentifier(&self) -> pid_t; + #[method(effectiveUserIdentifier)] + pub unsafe fn effectiveUserIdentifier(&self) -> uid_t; + #[method(effectiveGroupIdentifier)] + pub unsafe fn effectiveGroupIdentifier(&self) -> gid_t; + #[method_id(currentConnection)] + pub unsafe fn currentConnection() -> Option>; + # [method (scheduleSendBarrierBlock :)] + pub unsafe fn scheduleSendBarrierBlock(&self, block: TodoBlock); } ); extern_class!( @@ -132,33 +105,24 @@ extern_class!( ); extern_methods!( unsafe impl NSXPCListener { - pub unsafe fn serviceListener() -> Id { - msg_send_id![Self::class(), serviceListener] - } - pub unsafe fn anonymousListener() -> Id { - msg_send_id![Self::class(), anonymousListener] - } - pub unsafe fn initWithMachServiceName(&self, name: &NSString) -> Id { - msg_send_id![self, initWithMachServiceName: name] - } - pub unsafe fn delegate(&self) -> Option> { - msg_send_id![self, delegate] - } - pub unsafe fn setDelegate(&self, delegate: Option<&NSXPCListenerDelegate>) { - msg_send![self, setDelegate: delegate] - } - pub unsafe fn endpoint(&self) -> Id { - msg_send_id![self, endpoint] - } - pub unsafe fn resume(&self) { - msg_send![self, resume] - } - pub unsafe fn suspend(&self) { - msg_send![self, suspend] - } - pub unsafe fn invalidate(&self) { - msg_send![self, invalidate] - } + #[method_id(serviceListener)] + pub unsafe fn serviceListener() -> Id; + #[method_id(anonymousListener)] + pub unsafe fn anonymousListener() -> Id; + # [method_id (initWithMachServiceName :)] + pub unsafe fn initWithMachServiceName(&self, name: &NSString) -> Id; + #[method_id(delegate)] + pub unsafe fn delegate(&self) -> Option>; + # [method (setDelegate :)] + pub unsafe fn setDelegate(&self, delegate: Option<&NSXPCListenerDelegate>); + #[method_id(endpoint)] + pub unsafe fn endpoint(&self) -> Id; + #[method(resume)] + pub unsafe fn resume(&self); + #[method(suspend)] + pub unsafe fn suspend(&self); + #[method(invalidate)] + pub unsafe fn invalidate(&self); } ); pub type NSXPCListenerDelegate = NSObject; @@ -171,99 +135,57 @@ extern_class!( ); extern_methods!( unsafe impl NSXPCInterface { - pub unsafe fn interfaceWithProtocol(protocol: &Protocol) -> Id { - msg_send_id![Self::class(), interfaceWithProtocol: protocol] - } - pub unsafe fn protocol(&self) -> Id { - msg_send_id![self, protocol] - } - pub unsafe fn setProtocol(&self, protocol: &Protocol) { - msg_send![self, setProtocol: protocol] - } + # [method_id (interfaceWithProtocol :)] + pub unsafe fn interfaceWithProtocol(protocol: &Protocol) -> Id; + #[method_id(protocol)] + pub unsafe fn protocol(&self) -> Id; + # [method (setProtocol :)] + pub unsafe fn setProtocol(&self, protocol: &Protocol); + # [method (setClasses : forSelector : argumentIndex : ofReply :)] pub unsafe fn setClasses_forSelector_argumentIndex_ofReply( &self, classes: &NSSet, sel: Sel, arg: NSUInteger, ofReply: bool, - ) { - msg_send![ - self, - setClasses: classes, - forSelector: sel, - argumentIndex: arg, - ofReply: ofReply - ] - } + ); + # [method_id (classesForSelector : argumentIndex : ofReply :)] pub unsafe fn classesForSelector_argumentIndex_ofReply( &self, sel: Sel, arg: NSUInteger, ofReply: bool, - ) -> Id, Shared> { - msg_send_id![ - self, - classesForSelector: sel, - argumentIndex: arg, - ofReply: ofReply - ] - } + ) -> Id, Shared>; + # [method (setInterface : forSelector : argumentIndex : ofReply :)] pub unsafe fn setInterface_forSelector_argumentIndex_ofReply( &self, ifc: &NSXPCInterface, sel: Sel, arg: NSUInteger, ofReply: bool, - ) { - msg_send![ - self, - setInterface: ifc, - forSelector: sel, - argumentIndex: arg, - ofReply: ofReply - ] - } + ); + # [method_id (interfaceForSelector : argumentIndex : ofReply :)] pub unsafe fn interfaceForSelector_argumentIndex_ofReply( &self, sel: Sel, arg: NSUInteger, ofReply: bool, - ) -> Option> { - msg_send_id![ - self, - interfaceForSelector: sel, - argumentIndex: arg, - ofReply: ofReply - ] - } + ) -> Option>; + # [method (setXPCType : forSelector : argumentIndex : ofReply :)] pub unsafe fn setXPCType_forSelector_argumentIndex_ofReply( &self, type_: xpc_type_t, sel: Sel, arg: NSUInteger, ofReply: bool, - ) { - msg_send![ - self, - setXPCType: type_, - forSelector: sel, - argumentIndex: arg, - ofReply: ofReply - ] - } + ); + # [method (XPCTypeForSelector : argumentIndex : ofReply :)] pub unsafe fn XPCTypeForSelector_argumentIndex_ofReply( &self, sel: Sel, arg: NSUInteger, ofReply: bool, - ) -> xpc_type_t { - msg_send![ - self, - XPCTypeForSelector: sel, - argumentIndex: arg, - ofReply: ofReply - ] - } + ) -> xpc_type_t; } ); extern_class!( @@ -285,24 +207,19 @@ extern_class!( ); extern_methods!( unsafe impl NSXPCCoder { - pub unsafe fn encodeXPCObject_forKey(&self, xpcObject: &xpc_object_t, key: &NSString) { - msg_send![self, encodeXPCObject: xpcObject, forKey: key] - } + # [method (encodeXPCObject : forKey :)] + pub unsafe fn encodeXPCObject_forKey(&self, xpcObject: &xpc_object_t, key: &NSString); + # [method_id (decodeXPCObjectOfType : forKey :)] pub unsafe fn decodeXPCObjectOfType_forKey( &self, type_: xpc_type_t, key: &NSString, - ) -> Option> { - msg_send_id![self, decodeXPCObjectOfType: type_, forKey: key] - } - pub unsafe fn userInfo(&self) -> Option> { - msg_send_id![self, userInfo] - } - pub unsafe fn setUserInfo(&self, userInfo: Option<&NSObject>) { - msg_send![self, setUserInfo: userInfo] - } - pub unsafe fn connection(&self) -> Option> { - msg_send_id![self, connection] - } + ) -> Option>; + #[method_id(userInfo)] + pub unsafe fn userInfo(&self) -> Option>; + # [method (setUserInfo :)] + pub unsafe fn setUserInfo(&self, userInfo: Option<&NSObject>); + #[method_id(connection)] + pub unsafe fn connection(&self) -> Option>; } ); diff --git a/icrate/src/Foundation/generated/NSZone.rs b/icrate/src/Foundation/generated/NSZone.rs index 3df022269..d7522e9d6 100644 --- a/icrate/src/Foundation/generated/NSZone.rs +++ b/icrate/src/Foundation/generated/NSZone.rs @@ -4,4 +4,4 @@ use crate::Foundation::generated::NSObjCRuntime::*; #[allow(unused_imports)] use objc2::rc::{Id, Shared}; #[allow(unused_imports)] -use objc2::{extern_class, extern_methods, msg_send, msg_send_id, ClassType}; +use objc2::{extern_class, extern_methods, ClassType};