diff --git a/src/AppKit/NSAccessibility.cs b/src/AppKit/NSAccessibility.cs index 30d32b25132..5ca6531326b 100644 --- a/src/AppKit/NSAccessibility.cs +++ b/src/AppKit/NSAccessibility.cs @@ -69,13 +69,13 @@ public enum NSAccessibilityPriorityLevel : long High = 90 } -#if !COREBUILD [Mac (10,10)] // protocol added in 10.10 public partial interface INSAccessibility {} [Mac (10,9)] // but the field/notifications are in 10.9 public partial class NSAccessibility { +#if !COREBUILD [Mac (10,10)] [DllImport (Constants.AppKitLibrary)] static extern CGRect NSAccessibilityFrameInView (NSView parentView, CGRect frame); @@ -229,6 +229,6 @@ public static bool SetMayContainProtectedContent (bool flag) { return NSAccessibilitySetMayContainProtectedContent (flag); } - } #endif + } } diff --git a/src/appkit.cs b/src/appkit.cs index 8a8f2d4b461..b47c9be7646 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -23917,18 +23917,22 @@ interface NSAccessibility [NullAllowed, Export ("accessibilityVerticalUnitDescription")] string AccessibilityVerticalUnitDescription { get; set; } + [Mac (10,10)] [Abstract] [Export ("accessibilityLayoutPointForScreenPoint:")] CGPoint GetAccessibilityLayoutForScreen (CGPoint point); + [Mac (10,10)] [Abstract] [Export ("accessibilityLayoutSizeForScreenSize:")] CGSize GetAccessibilityLayoutForScreen (CGSize size); + [Mac (10,10)] [Abstract] [Export ("accessibilityScreenPointForLayoutPoint:")] CGPoint GetAccessibilityScreenForLayout (CGPoint point); + [Mac (10,10)] [Abstract] [Export ("accessibilityScreenSizeForLayoutSize:")] CGSize GetAccessibilityScreenForLayout (CGSize size); @@ -24123,6 +24127,7 @@ interface NSAccessibility [NullAllowed, Export ("accessibilityColumnHeaderUIElements", ArgumentSemantic.Copy)] NSObject[] AccessibilityColumnHeaderUIElements { get; set; } + [Mac (10,10)] [Abstract] [Export ("accessibilityCellForColumn:row:")] [return: NullAllowed] @@ -24178,41 +24183,50 @@ interface NSAccessibility [NullAllowed, Export ("accessibilitySelectedTextRanges", ArgumentSemantic.Copy)] NSValue[] AccessibilitySelectedTextRanges { get; set; } + [Mac (10,10)] [Abstract] [Export ("accessibilityAttributedStringForRange:")] [return: NullAllowed] NSAttributedString GetAccessibilityAttributedString (NSRange range); + [Mac (10,10)] [Abstract] [Export ("accessibilityRangeForLine:")] NSRange GetAccessibilityRangeForLine (nint line); + [Mac (10,10)] [Abstract] [Export ("accessibilityStringForRange:")] [return: NullAllowed] string GetAccessibilityString (NSRange range); + [Mac (10,10)] [Abstract] [Export ("accessibilityRangeForPosition:")] NSRange GetAccessibilityRange (CGPoint point); + [Mac (10,10)] [Abstract] [Export ("accessibilityRangeForIndex:")] NSRange GetAccessibilityRange (nint index); + [Mac (10,10)] [Abstract] [Export ("accessibilityFrameForRange:")] CGRect GetAccessibilityFrame (NSRange range); + [Mac (10,10)] [Abstract] [Export ("accessibilityRTFForRange:")] [return: NullAllowed] NSData GetAccessibilityRtf (NSRange range); + [Mac (10,10)] [Abstract] [Export ("accessibilityStyleRangeForIndex:")] NSRange GetAccessibilityStyleRange (nint index); + [Mac (10,10)] [Abstract] [Export ("accessibilityLineForIndex:")] nint GetAccessibilityLine (nint index); @@ -24277,50 +24291,62 @@ interface NSAccessibility [Export ("accessibilityMinimized")] bool AccessibilityMinimized { [Bind ("isAccessibilityMinimized")] get; set; } + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformCancel")] bool AccessibilityPerformCancel (); + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformConfirm")] bool AccessibilityPerformConfirm (); + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformDecrement")] bool AccessibilityPerformDecrement (); + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformDelete")] bool AccessibilityPerformDelete (); + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformIncrement")] bool AccessibilityPerformIncrement (); + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformPick")] bool AccessibilityPerformPick (); + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformPress")] bool AccessibilityPerformPress (); + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformRaise")] bool AccessibilityPerformRaise (); + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformShowAlternateUI")] bool AccessibilityPerformShowAlternateUI (); + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformShowDefaultUI")] bool AccessibilityPerformShowDefaultUI (); + [Mac (10, 10)] [Abstract] [Export ("accessibilityPerformShowMenu")] bool AccessibilityPerformShowMenu (); + [Mac (10,10)] [Abstract] [Export ("isAccessibilitySelectorAllowed:")] bool IsAccessibilitySelectorAllowed (Selector selector); diff --git a/tests/introspection/ApiAvailabilityTest.cs b/tests/introspection/ApiAvailabilityTest.cs index ce01dc854ad..7fca0025a9c 100644 --- a/tests/introspection/ApiAvailabilityTest.cs +++ b/tests/introspection/ApiAvailabilityTest.cs @@ -141,7 +141,16 @@ public void Introduced () // Duplicate checks, e.g. same attribute on member and type (extranous metadata) if (ma.Version == ta.Version) { - AddErrorLine ($"[FAIL] {ma.Version} ({m}) == {ta.Version} ({t})"); + switch (t.FullName) { + case "AppKit.INSAccessibility": + // special case for [I]NSAccessibility type (10.9) / protocol (10.10) mix up + // https://github.com/xamarin/xamarin-macios/issues/10009 + // better some dupes than being inaccurate when protocol members are inlined + break; + default: + AddErrorLine ($"[FAIL] {ma.Version} ({m}) == {ta.Version} ({t})"); + break; + } } // Consistency checks, e.g. member lower than type // note: that's valid in some cases, like a new base type being introduced