From c166a7f1f64c3d0ba7f50e17771cbcca4b5d5800 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 6 Nov 2024 21:24:04 +0100 Subject: [PATCH 1/3] [MediaExtension] Mark a few fields as Notification fields. --- src/mediaextension.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mediaextension.cs b/src/mediaextension.cs index 2929a3a370c6..5ce016e11799 100644 --- a/src/mediaextension.cs +++ b/src/mediaextension.cs @@ -513,6 +513,7 @@ interface IMEVideoDecoder {} [NoWatch, NoTV, NoiOS, Mac (15,0), NoMacCatalyst] [Static] interface MEVideoDecoderFields { + [Notification] [Field ("MEVideoDecoderReadyForMoreMediaDataDidChangeNotification")] NSString ReadyForMoreMediaDataDidChangeNotification { get; } } @@ -759,9 +760,11 @@ interface MERawProcessor [Static] interface MERawProcessorFields { + [Notification] [Field ("MERAWProcessorValuesDidChangeNotification")] NSString ValuesDidChangeNotification { get; } + [Notification] [Field ("MERAWProcessorReadyForMoreMediaDataDidChangeNotification")] NSString ReadyForMoreMediaDataDidChangeNotification { get; } } From 0690717a8a388b6f72c44c7395faa8e72aa40804 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 7 Nov 2024 08:25:58 +0100 Subject: [PATCH 2/3] [AppKit] Remove extreanous NSSharingCollaborationModeRestriction.AlertRecoverySuggestionButtonLaunchUrl setter. --- src/appkit.cs | 10 +++++++++- tests/introspection/ApiSelectorTest.cs | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/appkit.cs b/src/appkit.cs index 3279cb05973a..4cfa7ff7548b 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -28757,7 +28757,15 @@ interface NSSharingCollaborationModeRestriction : NSSecureCoding, NSCopying { string AlertRecoverySuggestionButtonTitle { get; } [Export ("alertRecoverySuggestionButtonLaunchURL", ArgumentSemantic.Copy), NullAllowed] - NSUrl AlertRecoverySuggestionButtonLaunchUrl { get; set; } +#if XAMCORE_5_0 + NSUrl AlertRecoverySuggestionButtonLaunchUrl { get; } +#else + NSUrl AlertRecoverySuggestionButtonLaunchUrl { + get; + [Obsolete ("Do not use, the native class doesn't have this setter.")] + set; + } +#endif [Export ("initWithDisabledMode:")] NativeHandle Constructor (NSSharingCollaborationMode disabledMode); diff --git a/tests/introspection/ApiSelectorTest.cs b/tests/introspection/ApiSelectorTest.cs index c1b4f1cada57..a1a026c2e500 100644 --- a/tests/introspection/ApiSelectorTest.cs +++ b/tests/introspection/ApiSelectorTest.cs @@ -1051,6 +1051,14 @@ protected virtual bool Skip (Type type, string selectorName) } break; #endif // __MACCATALYST__ +#if !XAMCORE_5_0 + case "NSSharingCollaborationModeRestriction": + switch (selectorName) { + case "setAlertRecoverySuggestionButtonLaunchURL:":// binding mistake + return true; + } + break; +#endif } // old binding mistake From c773ba8f082159c65e739a8e3bb216921193d18c Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 7 Nov 2024 10:26:27 +0100 Subject: [PATCH 3/3] [introspection] Ignore methods that start with '_Init', aren't publicly visible, and bind an Objective-C constructor. --- tests/introspection/ApiSelectorTest.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/introspection/ApiSelectorTest.cs b/tests/introspection/ApiSelectorTest.cs index a1a026c2e500..d3e73a2615ce 100644 --- a/tests/introspection/ApiSelectorTest.cs +++ b/tests/introspection/ApiSelectorTest.cs @@ -1221,8 +1221,13 @@ void CheckInit (Type t, MethodBase m, string name) if (!init) ReportError ("Selector {0} used on a constructor (not a method) on {1}", name, t.FullName); } else { - if (init) - ReportError ("Selector {0} used on a method (not a constructor) on {1}", name, t.FullName); + if (init) { + var isPubliclyVisible = m.IsPublic || m.IsFamily || m.IsFamilyOrAssembly; + if (isPubliclyVisible || !m.Name.StartsWith ("_Init", StringComparison.Ordinal)) { + // ignore methods that start '_Init' and aren't publicly exposed, they're probably used by manually bound ctors. + ReportError ($"Selector {name} used on the method '{m.Name}' (not a constructor) on {t.FullName}"); + } + } } }