From fa1f0677ae8a1d0b952e42db38f5f8163395b696 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 10 Aug 2023 09:26:33 -0400 Subject: [PATCH] [Accessibility] Add support for xcode 15 beta 4. (#18643) Co-authored-by: GitHub Actions Autoformatter --- src/Accessibility/AXAnimatedImagesUtilities.cs | 18 ++++++++++++++++++ src/accessibility.cs | 16 ++++++++++++++++ src/frameworks.sources | 1 + .../iOS-Accessibility.todo | 4 ---- .../macOS-Accessibility.todo | 4 ---- .../tvOS-Accessibility.todo | 4 ---- tests/xtro-sharpie/iOS-Accessibility.todo | 4 ---- tests/xtro-sharpie/macOS-Accessibility.todo | 4 ---- tests/xtro-sharpie/tvOS-Accessibility.todo | 4 ---- tests/xtro-sharpie/watchOS-Accessibility.todo | 4 ---- 10 files changed, 35 insertions(+), 28 deletions(-) create mode 100644 src/Accessibility/AXAnimatedImagesUtilities.cs delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-Accessibility.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-Accessibility.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/tvOS-Accessibility.todo delete mode 100644 tests/xtro-sharpie/iOS-Accessibility.todo delete mode 100644 tests/xtro-sharpie/macOS-Accessibility.todo delete mode 100644 tests/xtro-sharpie/tvOS-Accessibility.todo delete mode 100644 tests/xtro-sharpie/watchOS-Accessibility.todo diff --git a/src/Accessibility/AXAnimatedImagesUtilities.cs b/src/Accessibility/AXAnimatedImagesUtilities.cs new file mode 100644 index 000000000000..9ab60457fca3 --- /dev/null +++ b/src/Accessibility/AXAnimatedImagesUtilities.cs @@ -0,0 +1,18 @@ +#nullable enable + +using System; +using System.Runtime.InteropServices; +using CoreGraphics; +using Foundation; +using ObjCRuntime; + +namespace Accessibility { + + public static partial class AXAnimatedImagesUtilities { + + [DllImport (Constants.AccessibilityLibrary)] + extern static byte AXAnimatedImagesEnabled (); + + public static bool Enabled => AXAnimatedImagesEnabled () != 0; + } +} diff --git a/src/accessibility.cs b/src/accessibility.cs index 82fa077aa4d0..cad2da7795e9 100644 --- a/src/accessibility.cs +++ b/src/accessibility.cs @@ -7,6 +7,8 @@ using NativeHandle = System.IntPtr; #endif +#nullable enable + namespace Accessibility { [Watch (8, 0), TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15, 0)] @@ -134,6 +136,11 @@ interface AXCustomContentProvider { [Abstract] [NullAllowed, Export ("accessibilityCustomContent", ArgumentSemantic.Copy)] AXCustomContent [] AccessibilityCustomContent { get; set; } + + [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [NullAllowed, Export ("accessibilityCustomContentBlock", ArgumentSemantic.Copy)] + Func AccessibilityCustomContentHandler { get; set; } + } interface IAXDataAxisDescriptor { } @@ -336,4 +343,13 @@ interface AXBrailleMapRenderer { [Export ("accessibilityBrailleMapRenderer", ArgumentSemantic.Copy)] Action AccessibilityBrailleMapRenderer { get; set; } } + + [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Static] + [Partial] + partial interface AXAnimatedImagesUtilities { + [Notification] + [Field ("AXAnimatedImagesEnabledDidChangeNotification")] + NSString AnimatedImagesEnabledDidChangeNotification { get; } + } } diff --git a/src/frameworks.sources b/src/frameworks.sources index 7f422882e992..0d7c2daa19ec 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -34,6 +34,7 @@ ACCELERATE_SOURCES = \ ACCESSIBILITY_SOURCES = \ Accessibility/AXHearingUtilities.cs \ + Accessibility/AXAnimatedImagesUtilities.cs \ # Accounts diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-Accessibility.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-Accessibility.todo deleted file mode 100644 index 336ee97d6698..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-Accessibility.todo +++ /dev/null @@ -1,4 +0,0 @@ -!missing-field! AXAnimatedImagesEnabledDidChangeNotification not bound -!missing-pinvoke! AXAnimatedImagesEnabled is not bound -!missing-protocol-member! AXCustomContentProvider::accessibilityCustomContentBlock not found -!missing-protocol-member! AXCustomContentProvider::setAccessibilityCustomContentBlock: not found diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-Accessibility.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-Accessibility.todo deleted file mode 100644 index 336ee97d6698..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-Accessibility.todo +++ /dev/null @@ -1,4 +0,0 @@ -!missing-field! AXAnimatedImagesEnabledDidChangeNotification not bound -!missing-pinvoke! AXAnimatedImagesEnabled is not bound -!missing-protocol-member! AXCustomContentProvider::accessibilityCustomContentBlock not found -!missing-protocol-member! AXCustomContentProvider::setAccessibilityCustomContentBlock: not found diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-Accessibility.todo b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-Accessibility.todo deleted file mode 100644 index 336ee97d6698..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-Accessibility.todo +++ /dev/null @@ -1,4 +0,0 @@ -!missing-field! AXAnimatedImagesEnabledDidChangeNotification not bound -!missing-pinvoke! AXAnimatedImagesEnabled is not bound -!missing-protocol-member! AXCustomContentProvider::accessibilityCustomContentBlock not found -!missing-protocol-member! AXCustomContentProvider::setAccessibilityCustomContentBlock: not found diff --git a/tests/xtro-sharpie/iOS-Accessibility.todo b/tests/xtro-sharpie/iOS-Accessibility.todo deleted file mode 100644 index 336ee97d6698..000000000000 --- a/tests/xtro-sharpie/iOS-Accessibility.todo +++ /dev/null @@ -1,4 +0,0 @@ -!missing-field! AXAnimatedImagesEnabledDidChangeNotification not bound -!missing-pinvoke! AXAnimatedImagesEnabled is not bound -!missing-protocol-member! AXCustomContentProvider::accessibilityCustomContentBlock not found -!missing-protocol-member! AXCustomContentProvider::setAccessibilityCustomContentBlock: not found diff --git a/tests/xtro-sharpie/macOS-Accessibility.todo b/tests/xtro-sharpie/macOS-Accessibility.todo deleted file mode 100644 index 336ee97d6698..000000000000 --- a/tests/xtro-sharpie/macOS-Accessibility.todo +++ /dev/null @@ -1,4 +0,0 @@ -!missing-field! AXAnimatedImagesEnabledDidChangeNotification not bound -!missing-pinvoke! AXAnimatedImagesEnabled is not bound -!missing-protocol-member! AXCustomContentProvider::accessibilityCustomContentBlock not found -!missing-protocol-member! AXCustomContentProvider::setAccessibilityCustomContentBlock: not found diff --git a/tests/xtro-sharpie/tvOS-Accessibility.todo b/tests/xtro-sharpie/tvOS-Accessibility.todo deleted file mode 100644 index 336ee97d6698..000000000000 --- a/tests/xtro-sharpie/tvOS-Accessibility.todo +++ /dev/null @@ -1,4 +0,0 @@ -!missing-field! AXAnimatedImagesEnabledDidChangeNotification not bound -!missing-pinvoke! AXAnimatedImagesEnabled is not bound -!missing-protocol-member! AXCustomContentProvider::accessibilityCustomContentBlock not found -!missing-protocol-member! AXCustomContentProvider::setAccessibilityCustomContentBlock: not found diff --git a/tests/xtro-sharpie/watchOS-Accessibility.todo b/tests/xtro-sharpie/watchOS-Accessibility.todo deleted file mode 100644 index 336ee97d6698..000000000000 --- a/tests/xtro-sharpie/watchOS-Accessibility.todo +++ /dev/null @@ -1,4 +0,0 @@ -!missing-field! AXAnimatedImagesEnabledDidChangeNotification not bound -!missing-pinvoke! AXAnimatedImagesEnabled is not bound -!missing-protocol-member! AXCustomContentProvider::accessibilityCustomContentBlock not found -!missing-protocol-member! AXCustomContentProvider::setAccessibilityCustomContentBlock: not found