diff --git a/crates/header-translator/framework-includes.h b/crates/header-translator/framework-includes.h index 15110d78b..60fd78ad0 100644 --- a/crates/header-translator/framework-includes.h +++ b/crates/header-translator/framework-includes.h @@ -19,3 +19,5 @@ #import #import + +#import diff --git a/crates/header-translator/src/data/WebKit.rs b/crates/header-translator/src/data/WebKit.rs new file mode 100644 index 000000000..89a871f29 --- /dev/null +++ b/crates/header-translator/src/data/WebKit.rs @@ -0,0 +1,2 @@ +data! { +} diff --git a/crates/header-translator/src/data/mod.rs b/crates/header-translator/src/data/mod.rs index 4346107db..449d3cfe5 100644 --- a/crates/header-translator/src/data/mod.rs +++ b/crates/header-translator/src/data/mod.rs @@ -10,4 +10,5 @@ data! { mod CoreData; mod Foundation; mod Metal; + mod WebKit; } diff --git a/crates/header-translator/translation-config.toml b/crates/header-translator/translation-config.toml index 8d56b4e79..48f57b5d5 100644 --- a/crates/header-translator/translation-config.toml +++ b/crates/header-translator/translation-config.toml @@ -23,6 +23,9 @@ imports = ["AppKit", "CoreData", "Foundation"] [library.AuthenticationServices] imports = ["AuthenticationServices", "Foundation"] +[library.WebKit] +imports = ["WebKit", "AppKit", "Foundation"] + ### ### Attributes that change a function/method's calling convention. ### @@ -337,6 +340,8 @@ skipped = true skipped = true [protocol.NSWindowRestoration.methods.restoreWindowWithIdentifier_state_completionHandler] skipped = true +[protocol.WebPlugInViewFactory.methods.plugInViewWithArguments] +skipped = true # Custom implementation for now [struct.NSRange] @@ -827,3 +832,19 @@ skipped = true skipped = true [fn.MTLPackedFloat3Make] skipped = true + +# Needs `JSGlobalContextRef` from JavaScriptCore +[class.WebFrame.methods.globalContext] +skipped = true +# Needs `JSObjectRef` from JavaScriptCore +[class.WebScriptObject.methods.JSObject] +skipped = true + +# error: translator assertion failure: invalid error nullability (left: Unspecified) (Right: Nullable) +[class.WebHistory.methods] +loadFromURL_error = { skipped = true } +saveToURL_error = { skipped = true } + +[class.WKWebView.methods] +# uses `SecTrustRef` from Security.framework (not yet translated) +serverTrust = { skipped = true } diff --git a/crates/icrate/Cargo.toml b/crates/icrate/Cargo.toml index 386a1e475..e8dee717c 100644 --- a/crates/icrate/Cargo.toml +++ b/crates/icrate/Cargo.toml @@ -166,13 +166,19 @@ Metal = [ "Metal_MTLRenderPipelineReflection", "Metal_MTLComputePipelineReflection", ] +WebKit = [ + "AppKit", + "Foundation", + # Temporary, since some structs and statics use these + "Foundation_NSAttributedString", +] # Helps with CI unstable-frameworks-all = ["unstable-frameworks-ios", "unstable-frameworks-macos-12"] unstable-frameworks-gnustep = ["AppKit_all", "Foundation_all"] unstable-frameworks-gnustep-32bit = ["Foundation_all"] -unstable-frameworks-ios = ["AuthenticationServices_all", "CoreData_all", "CoreAnimation_all", "Foundation_all", "Metal_all"] -unstable-frameworks-macos-10-7 = ["AppKit_all", "CoreAnimation_all", "CoreData_all", "Foundation_all"] +unstable-frameworks-ios = ["AuthenticationServices_all", "CoreData_all", "CoreAnimation_all", "Foundation_all", "Metal_all", "WebKit_all"] +unstable-frameworks-macos-10-7 = ["AppKit_all", "CoreAnimation_all", "CoreData_all", "Foundation_all", "WebKit_all"] unstable-frameworks-macos-10-13 = ["unstable-frameworks-macos-10-7"] unstable-frameworks-macos-11 = ["unstable-frameworks-macos-10-13", "AuthenticationServices_all", "Metal_all"] unstable-frameworks-macos-12 = ["unstable-frameworks-macos-11"] @@ -2401,3 +2407,540 @@ Metal_all = [ "Metal_MTLVertexDescriptor", "Metal_MTLVisibleFunctionTableDescriptor", ] +WebKit_DOMAbstractView = [ + "WebKit_DOMObject", +] +WebKit_DOMAttr = [ + "WebKit_DOMNode", +] +WebKit_DOMBlob = [ + "WebKit_DOMObject", +] +WebKit_DOMCDATASection = [ + "WebKit_DOMText", +] +WebKit_DOMCSSCharsetRule = [ + "WebKit_DOMCSSRule", +] +WebKit_DOMCSSFontFaceRule = [ + "WebKit_DOMCSSRule", +] +WebKit_DOMCSSImportRule = [ + "WebKit_DOMCSSRule", +] +WebKit_DOMCSSMediaRule = [ + "WebKit_DOMCSSRule", +] +WebKit_DOMCSSPageRule = [ + "WebKit_DOMCSSRule", +] +WebKit_DOMCSSPrimitiveValue = [ + "WebKit_DOMCSSValue", +] +WebKit_DOMCSSRule = [ + "WebKit_DOMObject", +] +WebKit_DOMCSSRuleList = [ + "WebKit_DOMObject", +] +WebKit_DOMCSSStyleDeclaration = [ + "WebKit_DOMObject", +] +WebKit_DOMCSSStyleRule = [ + "WebKit_DOMCSSRule", +] +WebKit_DOMCSSStyleSheet = [ + "WebKit_DOMStyleSheet", +] +WebKit_DOMCSSUnknownRule = [ + "WebKit_DOMCSSRule", +] +WebKit_DOMCSSValue = [ + "WebKit_DOMObject", +] +WebKit_DOMCSSValueList = [ + "WebKit_DOMCSSValue", +] +WebKit_DOMCharacterData = [ + "WebKit_DOMNode", +] +WebKit_DOMComment = [ + "WebKit_DOMCharacterData", +] +WebKit_DOMCounter = [ + "WebKit_DOMObject", +] +WebKit_DOMDocument = [ + "WebKit_DOMNode", +] +WebKit_DOMDocumentFragment = [ + "WebKit_DOMNode", +] +WebKit_DOMDocumentType = [ + "WebKit_DOMNode", +] +WebKit_DOMElement = [ + "WebKit_DOMNode", +] +WebKit_DOMEntity = [ + "WebKit_DOMNode", +] +WebKit_DOMEntityReference = [ + "WebKit_DOMNode", +] +WebKit_DOMEvent = [ + "WebKit_DOMObject", +] +WebKit_DOMFile = [ + "WebKit_DOMBlob", +] +WebKit_DOMFileList = [ + "WebKit_DOMObject", +] +WebKit_DOMHTMLAnchorElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLAppletElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLAreaElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLBRElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLBaseElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLBaseFontElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLBodyElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLButtonElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLCollection = [ + "WebKit_DOMObject", +] +WebKit_DOMHTMLDListElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLDirectoryElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLDivElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLDocument = [ + "WebKit_DOMDocument", +] +WebKit_DOMHTMLElement = [ + "WebKit_DOMElement", +] +WebKit_DOMHTMLEmbedElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLFieldSetElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLFontElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLFormElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLFrameElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLFrameSetElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLHRElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLHeadElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLHeadingElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLHtmlElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLIFrameElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLImageElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLInputElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLLIElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLLabelElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLLegendElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLLinkElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLMapElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLMarqueeElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLMenuElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLMetaElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLModElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLOListElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLObjectElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLOptGroupElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLOptionElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLOptionsCollection = [ + "WebKit_DOMObject", +] +WebKit_DOMHTMLParagraphElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLParamElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLPreElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLQuoteElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLScriptElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLSelectElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLStyleElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLTableCaptionElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLTableCellElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLTableColElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLTableElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLTableRowElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLTableSectionElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLTextAreaElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLTitleElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMHTMLUListElement = [ + "WebKit_DOMHTMLElement", +] +WebKit_DOMImplementation = [ + "WebKit_DOMObject", +] +WebKit_DOMKeyboardEvent = [ + "WebKit_DOMUIEvent", +] +WebKit_DOMMediaList = [ + "WebKit_DOMObject", +] +WebKit_DOMMouseEvent = [ + "WebKit_DOMUIEvent", +] +WebKit_DOMMutationEvent = [ + "WebKit_DOMEvent", +] +WebKit_DOMNamedNodeMap = [ + "WebKit_DOMObject", +] +WebKit_DOMNode = [ + "WebKit_DOMObject", +] +WebKit_DOMNodeIterator = [ + "WebKit_DOMObject", +] +WebKit_DOMNodeList = [ + "WebKit_DOMObject", +] +WebKit_DOMObject = [ + "WebKit_WebScriptObject", +] +WebKit_DOMOverflowEvent = [ + "WebKit_DOMEvent", +] +WebKit_DOMProcessingInstruction = [ + "WebKit_DOMCharacterData", +] +WebKit_DOMProgressEvent = [ + "WebKit_DOMEvent", +] +WebKit_DOMRGBColor = [ + "WebKit_DOMObject", +] +WebKit_DOMRange = [ + "WebKit_DOMObject", +] +WebKit_DOMRect = [ + "WebKit_DOMObject", +] +WebKit_DOMStyleSheet = [ + "WebKit_DOMObject", +] +WebKit_DOMStyleSheetList = [ + "WebKit_DOMObject", +] +WebKit_DOMText = [ + "WebKit_DOMCharacterData", +] +WebKit_DOMTreeWalker = [ + "WebKit_DOMObject", +] +WebKit_DOMUIEvent = [ + "WebKit_DOMEvent", +] +WebKit_DOMWheelEvent = [ + "WebKit_DOMMouseEvent", +] +WebKit_DOMXPathExpression = [ + "WebKit_DOMObject", +] +WebKit_DOMXPathResult = [ + "WebKit_DOMObject", +] +WebKit_WKBackForwardList = [] +WebKit_WKBackForwardListItem = [] +WebKit_WKContentRuleList = [] +WebKit_WKContentRuleListStore = [] +WebKit_WKContentWorld = [] +WebKit_WKDownload = [] +WebKit_WKFindConfiguration = [] +WebKit_WKFindResult = [] +WebKit_WKFrameInfo = [] +WebKit_WKHTTPCookieStore = [] +WebKit_WKNavigation = [] +WebKit_WKNavigationAction = [] +WebKit_WKNavigationResponse = [] +WebKit_WKOpenPanelParameters = [] +WebKit_WKPDFConfiguration = [] +WebKit_WKPreferences = [] +WebKit_WKProcessPool = [] +WebKit_WKScriptMessage = [] +WebKit_WKSecurityOrigin = [] +WebKit_WKSnapshotConfiguration = [] +WebKit_WKUserContentController = [] +WebKit_WKUserScript = [] +WebKit_WKWebView = [ + "AppKit_NSView", +] +WebKit_WKWebViewConfiguration = [] +WebKit_WKWebpagePreferences = [] +WebKit_WKWebsiteDataRecord = [] +WebKit_WKWebsiteDataStore = [] +WebKit_WKWindowFeatures = [] +WebKit_WebArchive = [] +WebKit_WebBackForwardList = [] +WebKit_WebDataSource = [] +WebKit_WebDownload = [ + "Foundation_NSURLDownload", +] +WebKit_WebFrame = [] +WebKit_WebFrameView = [ + "AppKit_NSView", +] +WebKit_WebHistory = [] +WebKit_WebHistoryItem = [] +WebKit_WebPreferences = [] +WebKit_WebResource = [] +WebKit_WebScriptObject = [] +WebKit_WebUndefined = [] +WebKit_WebView = [ + "AppKit_NSView", +] +WebKit_all = [ + "WebKit", + "WebKit_DOMAbstractView", + "WebKit_DOMAttr", + "WebKit_DOMBlob", + "WebKit_DOMCDATASection", + "WebKit_DOMCSSCharsetRule", + "WebKit_DOMCSSFontFaceRule", + "WebKit_DOMCSSImportRule", + "WebKit_DOMCSSMediaRule", + "WebKit_DOMCSSPageRule", + "WebKit_DOMCSSPrimitiveValue", + "WebKit_DOMCSSRule", + "WebKit_DOMCSSRuleList", + "WebKit_DOMCSSStyleDeclaration", + "WebKit_DOMCSSStyleRule", + "WebKit_DOMCSSStyleSheet", + "WebKit_DOMCSSUnknownRule", + "WebKit_DOMCSSValue", + "WebKit_DOMCSSValueList", + "WebKit_DOMCharacterData", + "WebKit_DOMComment", + "WebKit_DOMCounter", + "WebKit_DOMDocument", + "WebKit_DOMDocumentFragment", + "WebKit_DOMDocumentType", + "WebKit_DOMElement", + "WebKit_DOMEntity", + "WebKit_DOMEntityReference", + "WebKit_DOMEvent", + "WebKit_DOMFile", + "WebKit_DOMFileList", + "WebKit_DOMHTMLAnchorElement", + "WebKit_DOMHTMLAppletElement", + "WebKit_DOMHTMLAreaElement", + "WebKit_DOMHTMLBRElement", + "WebKit_DOMHTMLBaseElement", + "WebKit_DOMHTMLBaseFontElement", + "WebKit_DOMHTMLBodyElement", + "WebKit_DOMHTMLButtonElement", + "WebKit_DOMHTMLCollection", + "WebKit_DOMHTMLDListElement", + "WebKit_DOMHTMLDirectoryElement", + "WebKit_DOMHTMLDivElement", + "WebKit_DOMHTMLDocument", + "WebKit_DOMHTMLElement", + "WebKit_DOMHTMLEmbedElement", + "WebKit_DOMHTMLFieldSetElement", + "WebKit_DOMHTMLFontElement", + "WebKit_DOMHTMLFormElement", + "WebKit_DOMHTMLFrameElement", + "WebKit_DOMHTMLFrameSetElement", + "WebKit_DOMHTMLHRElement", + "WebKit_DOMHTMLHeadElement", + "WebKit_DOMHTMLHeadingElement", + "WebKit_DOMHTMLHtmlElement", + "WebKit_DOMHTMLIFrameElement", + "WebKit_DOMHTMLImageElement", + "WebKit_DOMHTMLInputElement", + "WebKit_DOMHTMLLIElement", + "WebKit_DOMHTMLLabelElement", + "WebKit_DOMHTMLLegendElement", + "WebKit_DOMHTMLLinkElement", + "WebKit_DOMHTMLMapElement", + "WebKit_DOMHTMLMarqueeElement", + "WebKit_DOMHTMLMenuElement", + "WebKit_DOMHTMLMetaElement", + "WebKit_DOMHTMLModElement", + "WebKit_DOMHTMLOListElement", + "WebKit_DOMHTMLObjectElement", + "WebKit_DOMHTMLOptGroupElement", + "WebKit_DOMHTMLOptionElement", + "WebKit_DOMHTMLOptionsCollection", + "WebKit_DOMHTMLParagraphElement", + "WebKit_DOMHTMLParamElement", + "WebKit_DOMHTMLPreElement", + "WebKit_DOMHTMLQuoteElement", + "WebKit_DOMHTMLScriptElement", + "WebKit_DOMHTMLSelectElement", + "WebKit_DOMHTMLStyleElement", + "WebKit_DOMHTMLTableCaptionElement", + "WebKit_DOMHTMLTableCellElement", + "WebKit_DOMHTMLTableColElement", + "WebKit_DOMHTMLTableElement", + "WebKit_DOMHTMLTableRowElement", + "WebKit_DOMHTMLTableSectionElement", + "WebKit_DOMHTMLTextAreaElement", + "WebKit_DOMHTMLTitleElement", + "WebKit_DOMHTMLUListElement", + "WebKit_DOMImplementation", + "WebKit_DOMKeyboardEvent", + "WebKit_DOMMediaList", + "WebKit_DOMMouseEvent", + "WebKit_DOMMutationEvent", + "WebKit_DOMNamedNodeMap", + "WebKit_DOMNode", + "WebKit_DOMNodeIterator", + "WebKit_DOMNodeList", + "WebKit_DOMObject", + "WebKit_DOMOverflowEvent", + "WebKit_DOMProcessingInstruction", + "WebKit_DOMProgressEvent", + "WebKit_DOMRGBColor", + "WebKit_DOMRange", + "WebKit_DOMRect", + "WebKit_DOMStyleSheet", + "WebKit_DOMStyleSheetList", + "WebKit_DOMText", + "WebKit_DOMTreeWalker", + "WebKit_DOMUIEvent", + "WebKit_DOMWheelEvent", + "WebKit_DOMXPathExpression", + "WebKit_DOMXPathResult", + "WebKit_WKBackForwardList", + "WebKit_WKBackForwardListItem", + "WebKit_WKContentRuleList", + "WebKit_WKContentRuleListStore", + "WebKit_WKContentWorld", + "WebKit_WKDownload", + "WebKit_WKFindConfiguration", + "WebKit_WKFindResult", + "WebKit_WKFrameInfo", + "WebKit_WKHTTPCookieStore", + "WebKit_WKNavigation", + "WebKit_WKNavigationAction", + "WebKit_WKNavigationResponse", + "WebKit_WKOpenPanelParameters", + "WebKit_WKPDFConfiguration", + "WebKit_WKPreferences", + "WebKit_WKProcessPool", + "WebKit_WKScriptMessage", + "WebKit_WKSecurityOrigin", + "WebKit_WKSnapshotConfiguration", + "WebKit_WKUserContentController", + "WebKit_WKUserScript", + "WebKit_WKWebView", + "WebKit_WKWebViewConfiguration", + "WebKit_WKWebpagePreferences", + "WebKit_WKWebsiteDataRecord", + "WebKit_WKWebsiteDataStore", + "WebKit_WKWindowFeatures", + "WebKit_WebArchive", + "WebKit_WebBackForwardList", + "WebKit_WebDataSource", + "WebKit_WebDownload", + "WebKit_WebFrame", + "WebKit_WebFrameView", + "WebKit_WebHistory", + "WebKit_WebHistoryItem", + "WebKit_WebPreferences", + "WebKit_WebResource", + "WebKit_WebScriptObject", + "WebKit_WebUndefined", + "WebKit_WebView", +] diff --git a/crates/icrate/src/WebKit/mod.rs b/crates/icrate/src/WebKit/mod.rs new file mode 100644 index 000000000..ad502d36d --- /dev/null +++ b/crates/icrate/src/WebKit/mod.rs @@ -0,0 +1,7 @@ +#[path = "../generated/WebKit/mod.rs"] +mod generated; + +pub use self::generated::*; + +#[link(name = "WebKit", kind = "framework")] +extern "C" {} diff --git a/crates/icrate/src/generated b/crates/icrate/src/generated index dca263163..7831ae848 160000 --- a/crates/icrate/src/generated +++ b/crates/icrate/src/generated @@ -1 +1 @@ -Subproject commit dca2631636f1c9a7e94b6605f4a0722744606ccb +Subproject commit 7831ae8483e4f93266e540aafc1b7712f70023d2 diff --git a/crates/icrate/src/lib.rs b/crates/icrate/src/lib.rs index a7802b6e9..1cd6cf770 100644 --- a/crates/icrate/src/lib.rs +++ b/crates/icrate/src/lib.rs @@ -44,3 +44,5 @@ pub mod CoreData; pub mod Foundation; #[cfg(feature = "Metal")] pub mod Metal; +#[cfg(feature = "WebKit")] +pub mod WebKit; diff --git a/crates/objc2-encode/src/encode.rs b/crates/objc2-encode/src/encode.rs index 59ab4c082..459af92a0 100644 --- a/crates/objc2-encode/src/encode.rs +++ b/crates/objc2-encode/src/encode.rs @@ -664,7 +664,7 @@ mod args_private { /// Types that represent an ordered group of function arguments, where each /// argument has an Objective-C type-encoding, or can be converted from one. /// -/// This is implemented for tuples of up to 12 arguments, where each argument +/// This is implemented for tuples of up to 16 arguments, where each argument /// implements [`EncodeConvert`]. It is primarily used to make generic code /// a bit easier. /// @@ -712,6 +712,10 @@ encode_args_impl!(A, B, C, D, E, F, G, H, I); encode_args_impl!(A, B, C, D, E, F, G, H, I, J); encode_args_impl!(A, B, C, D, E, F, G, H, I, J, K); encode_args_impl!(A, B, C, D, E, F, G, H, I, J, K, L); +encode_args_impl!(A, B, C, D, E, F, G, H, I, J, K, L, M); +encode_args_impl!(A, B, C, D, E, F, G, H, I, J, K, L, M, N); +encode_args_impl!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); +encode_args_impl!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P); #[cfg(test)] mod tests { diff --git a/crates/objc2/CHANGELOG.md b/crates/objc2/CHANGELOG.md index d66b8bc1d..af4a10d84 100644 --- a/crates/objc2/CHANGELOG.md +++ b/crates/objc2/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). `extern_class!`, `extern_protocol!` and `declare_class!` macros. * Added ability to use `#[method_id(mySelector:)]` inside `declare_class!`, just like you would do in `extern_methods!`. +* Added 16-fold impls for `EncodeArguments`, `MessageArguments`, and `MethodImplementation`. ### Changed * **BREAKING**: Using the automatic `NSError**`-to-`Result` functionality in diff --git a/crates/objc2/src/declare.rs b/crates/objc2/src/declare.rs index 1f1632d03..a07b59985 100644 --- a/crates/objc2/src/declare.rs +++ b/crates/objc2/src/declare.rs @@ -263,6 +263,10 @@ method_decl_impl!(A, B, C, D, E, F, G, H, I); method_decl_impl!(A, B, C, D, E, F, G, H, I, J); method_decl_impl!(A, B, C, D, E, F, G, H, I, J, K); method_decl_impl!(A, B, C, D, E, F, G, H, I, J, K, L); +method_decl_impl!(A, B, C, D, E, F, G, H, I, J, K, L, M); +method_decl_impl!(A, B, C, D, E, F, G, H, I, J, K, L, M, N); +method_decl_impl!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); +method_decl_impl!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P); /// Helper type for implementing `MethodImplementation` with a receiver of /// `Allocated`, without exposing that implementation to users. diff --git a/crates/objc2/src/message/mod.rs b/crates/objc2/src/message/mod.rs index 8fcc05ad3..f057ea6f9 100644 --- a/crates/objc2/src/message/mod.rs +++ b/crates/objc2/src/message/mod.rs @@ -467,7 +467,7 @@ unsafe impl<'a> MessageReceiver for &'a Class { /// Types that may be used as the arguments of an Objective-C message. /// -/// This is implemented for tuples of up to 12 arguments, where each argument +/// This is implemented for tuples of up to 16 arguments, where each argument /// implements [`Encode`][crate::Encode] (or can be converted from one). /// /// @@ -565,6 +565,72 @@ message_args_impl!( k: K, l: L ); +message_args_impl!( + a: A, + b: B, + c: C, + d: D, + e: E, + f: F, + g: G, + h: H, + i: I, + j: J, + k: K, + l: L, + m: M +); +message_args_impl!( + a: A, + b: B, + c: C, + d: D, + e: E, + f: F, + g: G, + h: H, + i: I, + j: J, + k: K, + l: L, + m: M, + n: N +); +message_args_impl!( + a: A, + b: B, + c: C, + d: D, + e: E, + f: F, + g: G, + h: H, + i: I, + j: J, + k: K, + l: L, + m: M, + n: N, + o: O +); +message_args_impl!( + a: A, + b: B, + c: C, + d: D, + e: E, + f: F, + g: G, + h: H, + i: I, + j: J, + k: K, + l: L, + m: M, + n: N, + o: O, + p: P +); #[cfg(test)] mod tests {