From 900691781983492a7a5d7de18434e4c9869d32fc Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 1 Aug 2025 14:33:23 +0200 Subject: [PATCH 1/4] [QuickLook] Update to Xcode 26 beta 1-4. --- src/arkit.cs | 16 ------------ src/quicklook.cs | 26 +++++++++++++++++++ .../MacCatalyst-QuickLook.todo | 6 ----- 3 files changed, 26 insertions(+), 22 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-QuickLook.todo diff --git a/src/arkit.cs b/src/arkit.cs index a35eaefd3cbc..2a13c2a7dc5b 100644 --- a/src/arkit.cs +++ b/src/arkit.cs @@ -2287,22 +2287,6 @@ interface ARMatteGenerator { IMTLTexture GenerateDilatedDepth (ARFrame frame, IMTLCommandBuffer commandBuffer); } - [iOS (13, 0)] - [BaseType (typeof (NSObject))] - [DisableDefaultCtor] - interface ARQuickLookPreviewItem : QLPreviewItem { - - [Export ("initWithFileAtURL:")] - [DesignatedInitializer] - NativeHandle Constructor (NSUrl url); - - [NullAllowed, Export ("canonicalWebPageURL", ArgumentSemantic.Strong)] - NSUrl CanonicalWebPageUrl { get; set; } - - [Export ("allowsContentScaling")] - bool AllowsContentScaling { get; set; } - } - [iOS (13, 0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] diff --git a/src/quicklook.cs b/src/quicklook.cs index 73ef9eebe30d..dc81dcd354ac 100644 --- a/src/quicklook.cs +++ b/src/quicklook.cs @@ -417,3 +417,29 @@ interface QLThumbnailImage { #endif } + +#if !MONOMAC +// Apple moved ARQuickLookPreviewItem from the ARKit framework to the QuickLook framework in Xcode 26, +// and also added it to Mac Catalyst. +#if XAMCORE_5_0 +namespace ARKit { +#else +namespace QuickLook { +#endif + [iOS (13, 0), MacCatalyst (13, 1), NoTV, NoMac] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface ARQuickLookPreviewItem : QLPreviewItem { + + [Export ("initWithFileAtURL:")] + [DesignatedInitializer] + NativeHandle Constructor (NSUrl url); + + [NullAllowed, Export ("canonicalWebPageURL", ArgumentSemantic.Strong)] + NSUrl CanonicalWebPageUrl { get; set; } + + [Export ("allowsContentScaling")] + bool AllowsContentScaling { get; set; } + } +} +#endif // !MONOMAC diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-QuickLook.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-QuickLook.todo deleted file mode 100644 index 1c1f8e6b5125..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-QuickLook.todo +++ /dev/null @@ -1,6 +0,0 @@ -!missing-selector! ARQuickLookPreviewItem::allowsContentScaling not bound -!missing-selector! ARQuickLookPreviewItem::canonicalWebPageURL not bound -!missing-selector! ARQuickLookPreviewItem::initWithFileAtURL: not bound -!missing-selector! ARQuickLookPreviewItem::setAllowsContentScaling: not bound -!missing-selector! ARQuickLookPreviewItem::setCanonicalWebPageURL: not bound -!missing-type! ARQuickLookPreviewItem not bound From 1497fc8d04685a9e36c0afeb3992e707f7ab2dab Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 8 Aug 2025 16:08:05 +0200 Subject: [PATCH 2/4] Fix availability. --- src/quicklook.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quicklook.cs b/src/quicklook.cs index dc81dcd354ac..925e33c6ef80 100644 --- a/src/quicklook.cs +++ b/src/quicklook.cs @@ -426,7 +426,7 @@ namespace ARKit { #else namespace QuickLook { #endif - [iOS (13, 0), MacCatalyst (13, 1), NoTV, NoMac] + [iOS (13, 0), MacCatalyst (26, 0), NoTV, NoMac] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface ARQuickLookPreviewItem : QLPreviewItem { From 0746ad30ecdac1962c59da087531e04cbbf02506 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 12 Aug 2025 16:31:16 +0200 Subject: [PATCH 3/4] Fix boolean condition --- src/quicklook.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quicklook.cs b/src/quicklook.cs index 925e33c6ef80..bb2f5f964bb8 100644 --- a/src/quicklook.cs +++ b/src/quicklook.cs @@ -421,7 +421,7 @@ interface QLThumbnailImage { #if !MONOMAC // Apple moved ARQuickLookPreviewItem from the ARKit framework to the QuickLook framework in Xcode 26, // and also added it to Mac Catalyst. -#if XAMCORE_5_0 +#if !XAMCORE_5_0 namespace ARKit { #else namespace QuickLook { From ddd7482faecba8d4832cc88c77bce6bd26ca2878 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 13 Aug 2025 18:26:38 +0200 Subject: [PATCH 4/4] Fix build --- src/quicklook.cs | 7 ++++--- tests/cecil-tests/AttributeTest.cs | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/quicklook.cs b/src/quicklook.cs index bb2f5f964bb8..c112c6cd6239 100644 --- a/src/quicklook.cs +++ b/src/quicklook.cs @@ -421,10 +421,11 @@ interface QLThumbnailImage { #if !MONOMAC // Apple moved ARQuickLookPreviewItem from the ARKit framework to the QuickLook framework in Xcode 26, // and also added it to Mac Catalyst. -#if !XAMCORE_5_0 -namespace ARKit { -#else +#if XAMCORE_5_0 || __MACCATALYST__ namespace QuickLook { +#else +namespace ARKit { + using QuickLook; #endif [iOS (13, 0), MacCatalyst (26, 0), NoTV, NoMac] [BaseType (typeof (NSObject))] diff --git a/tests/cecil-tests/AttributeTest.cs b/tests/cecil-tests/AttributeTest.cs index 1b5b32cb862f..bd68ebe92253 100644 --- a/tests/cecil-tests/AttributeTest.cs +++ b/tests/cecil-tests/AttributeTest.cs @@ -328,6 +328,14 @@ static HashSet IgnoreElementsThatDoNotExistInThatAssembly { "PdfKit.PdfView.ShouldReceiveTouch (XKit.XGestureRecognizer, XKit.XTouch)", "PdfKit.PdfView.ShouldRecognizeSimultaneously (XKit.XGestureRecognizer, XKit.XGestureRecognizer)", "PdfKit.PdfView.ShouldRequireFailureOf (XKit.XGestureRecognizer, XKit.XGestureRecognizer)", + +#if !XAMCORE_5_0 + // The ARQuickLookPreviewItem type is in the QuickLook framework for Mac Catalyst, and ARKit for all other platforms. + "QuickLook.ARQuickLookPreviewItem.get_PreviewItemTitle ()", + "QuickLook.ARQuickLookPreviewItem.get_PreviewItemUrl ()", + "QuickLook.ARQuickLookPreviewItem.PreviewItemTitle", + "QuickLook.ARQuickLookPreviewItem.PreviewItemUrl", +#endif }; } }