forked from xamarin/xamarin-macios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xcode13] Update all already publish frameworks to Xcode13 GA. (xamar…
…in#12797) * [Xcode13] Update all already publish frameworks to Xcode13 GA. * Address reviews. * Fix tests. Co-authored-by: Alex Soto <alex@alexsoto.me>
- Loading branch information
1 parent
011ef43
commit 7367cf0
Showing
16 changed files
with
236 additions
and
83 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
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 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Collections.Generic; | ||
using System.Runtime.Versioning; | ||
|
||
using CoreFoundation; | ||
using Foundation; | ||
using ObjCRuntime; | ||
|
||
#nullable enable | ||
|
||
namespace CoreAnimation { | ||
|
||
#if !NET | ||
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
#else | ||
[SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] | ||
#endif | ||
[StructLayout (LayoutKind.Sequential)] | ||
public struct CAFrameRateRange | ||
{ | ||
|
||
public float Minimum; | ||
public float Maximum; | ||
public float Preferred; | ||
|
||
public CAFrameRateRange (float min, float max, float preferred) { | ||
Minimum = min; | ||
Maximum = max; | ||
Preferred = preferred; | ||
} | ||
|
||
#if !COREBUILD | ||
[Field ("CAFrameRateRangeDefault", "CoreAnimation")] | ||
public static CAFrameRateRange Default | ||
=> (CAFrameRateRange) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.CoreAnimation.Handle, "CAFrameRateRangeDefault"), typeof (CAFrameRateRange))!; | ||
#endif | ||
|
||
[DllImport (Constants.CoreAnimationLibrary)] | ||
[return: MarshalAs (UnmanagedType.I1)] | ||
static extern bool CAFrameRateRangeIsEqualToRange (CAFrameRateRange range, CAFrameRateRange other); | ||
|
||
public bool IsEqualTo (CAFrameRateRange other) | ||
=> CAFrameRateRangeIsEqualToRange (this, other); | ||
|
||
} | ||
} |
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
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
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
34 changes: 34 additions & 0 deletions
34
tests/monotouch-test/CoreAnimation/CAFrameRateRangeTest.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,34 @@ | ||
#if !__WATCHOS__ | ||
using Foundation; | ||
using CoreAnimation; | ||
using NUnit.Framework; | ||
|
||
namespace MonoTouchFixtures.CoreAnimation { | ||
|
||
[TestFixture] | ||
[Preserve (AllMembers = true)] | ||
public class CAFrameRateRangeTest { | ||
|
||
[SetUp] | ||
public void SetUp () | ||
=> TestRuntime.AssertXcodeVersion (13,0); | ||
|
||
[Test] | ||
public void IsEqualToTest () | ||
{ | ||
var first = new CAFrameRateRange (1.0f, 1.0f, 1.0f); | ||
var second = new CAFrameRateRange (1.5f, 1.0f, 1.0f); | ||
|
||
Assert.IsFalse (first.IsEqualTo (second), "Not equal"); | ||
Assert.IsTrue (first.IsEqualTo (first), "Equal"); | ||
} | ||
|
||
[Test] | ||
public void DefaultTest () | ||
{ | ||
var defaultValue = CAFrameRateRange.Default; | ||
Assert.IsTrue (defaultValue.IsEqualTo (defaultValue), "Default"); | ||
} | ||
} | ||
} | ||
#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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.