-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Accessibility] Update bindings for Xcode 13.0 beta 1
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com> Co-authored-by: Rachel Kang <rachelkang@microsoft.com>
- Loading branch information
1 parent
801063d
commit eca53e5
Showing
9 changed files
with
357 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// Copyright 2021 Microsoft Corp | ||
// | ||
// Authors: | ||
// Rachel Kang (rachelkang@microsoft.com) | ||
// | ||
|
||
#nullable enable | ||
|
||
#if !TVOS && !MONOMAC | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using CoreGraphics; | ||
using Foundation; | ||
using ObjCRuntime; | ||
|
||
namespace Accessibility { | ||
|
||
// accessibility.cs already provide the following attributes on the type | ||
// [iOS (15,0), NoMac, NoTV, Watch (8,0), MacCatalyst (15,0)] | ||
public static partial class AXHearingUtilities { | ||
|
||
[DllImport (Constants.AccessibilityLibrary)] | ||
static extern /* AXHearingDeviceEar */ nint AXMFiHearingDeviceStreamingEar (); | ||
|
||
[DllImport (Constants.AccessibilityLibrary)] | ||
static extern /* NSArray<NSUUID *> * */ IntPtr AXMFiHearingDevicePairedUUIDs (); | ||
|
||
[DllImport (Constants.AccessibilityLibrary, EntryPoint = "AXSupportsBidirectionalAXMFiHearingDeviceStreaming")] | ||
[return: MarshalAs (UnmanagedType.I1)] | ||
public static extern bool SupportsBidirectionalStreaming (); | ||
|
||
public static AXHearingDeviceEar GetMFiHearingDeviceStreamingEar () | ||
{ | ||
return (AXHearingDeviceEar) (long) AXMFiHearingDeviceStreamingEar (); | ||
} | ||
|
||
public static NSUuid[] GetMFiHearingDevicePairedUuids () | ||
{ | ||
return NSArray.ArrayFromHandle<NSUuid> (AXMFiHearingDevicePairedUUIDs ()); | ||
} | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
tests/monotouch-test/Accessibility/AXHearingUtilitiesTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// Copyright 2021 Microsoft Corp | ||
// | ||
// Authors: | ||
// Rachel Kang (rachelkang@microsoft.com) | ||
// | ||
|
||
#if !__TVOS__ && !MONOMAC | ||
|
||
using System; | ||
using Foundation; | ||
using Accessibility; | ||
using NUnit.Framework; | ||
|
||
namespace MonoTouchFixtures.Accessibility { | ||
|
||
[TestFixture] | ||
[Preserve (AllMembers = true)] | ||
public class AXHearingUtilitiesTests { | ||
|
||
[SetUp] | ||
public void Setup () | ||
{ | ||
TestRuntime.AssertXcodeVersion (13, 0); | ||
} | ||
|
||
[Test] | ||
public void GetHearingDeviceEar () | ||
{ | ||
Assert.That (AXHearingUtilities.GetMFiHearingDeviceStreamingEar (), Is.EqualTo (AXHearingDeviceEar.None), "default"); | ||
} | ||
|
||
[Test] | ||
public void GetDoesSupportBidirectionalHearing () | ||
{ | ||
Assert.That (AXHearingUtilities.SupportsBidirectionalStreaming (), Is.EqualTo (false), "GetDoesSupportBidirectionalHearing"); | ||
} | ||
|
||
[Test] | ||
public void GetHearingDevicePairedUuids () | ||
{ | ||
NSUuid[] emptyArray = new NSUuid[0]; | ||
Assert.That (AXHearingUtilities.GetMFiHearingDevicePairedUuids (), Is.EqualTo (emptyArray), "GetHearingDevicePairedUuids"); | ||
} | ||
} | ||
} | ||
#endif |
Oops, something went wrong.