-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UIKit] Update bindings to Xcode 13 Beta 5 #12706
Changes from 1 commit
cd118fc
d333bf6
590efbe
e9a87f3
3e3760a
229389e
5097b9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,7 +150,46 @@ public override int GetHashCode () | |
public static UIFloatRange Infinite = new UIFloatRange (nfloat.NegativeInfinity, nfloat.PositiveInfinity); | ||
} | ||
#endif | ||
|
||
|
||
#if IOS | ||
[StructLayout (LayoutKind.Sequential)] | ||
public struct UIPointerAccessoryPosition { | ||
public nfloat Offset, Angle; | ||
|
||
public UIPointerAccessoryPosition (nfloat offset, nfloat angle) | ||
{ | ||
Offset = offset; | ||
Angle = angle; | ||
} | ||
|
||
#if !COREBUILD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tests are missing for these manual code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
[Field ("UIPointerAccessoryPositionTop")] | ||
public static UIPointerAccessoryPosition Top => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionTop"), typeof (UIPointerAccessoryPosition))!; | ||
|
||
[Field ("UIPointerAccessoryPositionTopRight")] | ||
public static UIPointerAccessoryPosition TopRight => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionTopRight"), typeof (UIPointerAccessoryPosition))!; | ||
|
||
[Field ("UIPointerAccessoryPositionRight")] | ||
public static UIPointerAccessoryPosition Right => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionRight"), typeof (UIPointerAccessoryPosition))!; | ||
|
||
[Field ("UIPointerAccessoryPositionBottomRight")] | ||
public static UIPointerAccessoryPosition BottomRight => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionBottomRight"), typeof (UIPointerAccessoryPosition))!; | ||
|
||
[Field ("UIPointerAccessoryPositionBottom")] | ||
public static UIPointerAccessoryPosition Bottom => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionBottom"), typeof (UIPointerAccessoryPosition))!; | ||
|
||
[Field ("UIPointerAccessoryPositionBottomLeft")] | ||
public static UIPointerAccessoryPosition BottomLeft => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionBottomLeft"), typeof (UIPointerAccessoryPosition))!; | ||
|
||
[Field ("UIPointerAccessoryPositionLeft")] | ||
public static UIPointerAccessoryPosition Left => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionLeft"), typeof (UIPointerAccessoryPosition))!; | ||
|
||
[Field ("UIPointerAccessoryPositionTopLeft")] | ||
public static UIPointerAccessoryPosition TopLeft => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionTopLeft"), typeof (UIPointerAccessoryPosition))!; | ||
#endif | ||
} | ||
#endif | ||
|
||
#if false | ||
[Protocol] | ||
public interface IUITextInputTraits { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
// | ||
// Unit tests for UIPointerAccessory | ||
// | ||
// Authors: | ||
// Alex Soto <alexsoto@microsoft.com> | ||
// | ||
// | ||
// Copyright Microsoft Corporation. | ||
// | ||
|
||
#if __IOS__ | ||
using System; | ||
using NUnit.Framework; | ||
using Foundation; | ||
using UIKit; | ||
using ObjCRuntime; | ||
|
||
namespace MonoTouchFixtures.UIKit { | ||
[TestFixture] | ||
[Preserve (AllMembers = true)] | ||
public class UIPointerAccessoryTest { | ||
|
||
[SetUp] | ||
public void Setup () | ||
{ | ||
TestRuntime.AssertXcodeVersion (13, 0); | ||
} | ||
|
||
[Test] | ||
public void UIPointerAccessoryPositionTopTest () | ||
{ | ||
UIPointerAccessory acc = null; | ||
Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.Top), "Should not throw"); | ||
Assert.NotNull (acc, $"{nameof (acc)} was null"); | ||
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.Top.Offset, "Offset"); | ||
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.Top.Angle, "Offset"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: "Angle" |
||
} | ||
|
||
[Test] | ||
public void UIPointerAccessoryPositionTopRightTest () | ||
{ | ||
UIPointerAccessory acc = null; | ||
Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.TopRight), "Should not throw"); | ||
Assert.NotNull (acc, $"{nameof (acc)} was null"); | ||
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.TopRight.Offset, "Offset"); | ||
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.TopRight.Angle, "Offset"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: "Angle" |
||
} | ||
|
||
[Test] | ||
public void UIPointerAccessoryPositionRightTest () | ||
{ | ||
UIPointerAccessory acc = null; | ||
Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.Right), "Should not throw"); | ||
Assert.NotNull (acc, $"{nameof (acc)} was null"); | ||
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.Right.Offset, "Offset"); | ||
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.Right.Angle, "Offset"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: "Angle" |
||
} | ||
|
||
[Test] | ||
public void UIPointerAccessoryPositionBottomRightTest () | ||
{ | ||
UIPointerAccessory acc = null; | ||
Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.BottomRight), "Should not throw"); | ||
Assert.NotNull (acc, $"{nameof (acc)} was null"); | ||
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.BottomRight.Offset, "Offset"); | ||
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.BottomRight.Angle, "Offset"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: "Angle" |
||
} | ||
|
||
[Test] | ||
public void UIPointerAccessoryPositionBottomTest () | ||
{ | ||
UIPointerAccessory acc = null; | ||
Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.Bottom), "Should not throw"); | ||
Assert.NotNull (acc, $"{nameof (acc)} was null"); | ||
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.Bottom.Offset, "Offset"); | ||
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.Bottom.Angle, "Offset"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: "Angle" |
||
} | ||
|
||
[Test] | ||
public void UIPointerAccessoryPositionBottomLeftTest () | ||
{ | ||
UIPointerAccessory acc = null; | ||
Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.BottomLeft), "Should not throw"); | ||
Assert.NotNull (acc, $"{nameof (acc)} was null"); | ||
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.BottomLeft.Offset, "Offset"); | ||
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.BottomLeft.Angle, "Offset"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: "Angle" |
||
} | ||
|
||
[Test] | ||
public void UIPointerAccessoryPositionLeftTest () | ||
{ | ||
UIPointerAccessory acc = null; | ||
Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.Left), "Should not throw"); | ||
Assert.NotNull (acc, $"{nameof (acc)} was null"); | ||
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.Left.Offset, "Offset"); | ||
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.Left.Angle, "Offset"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: "Angle" |
||
} | ||
|
||
[Test] | ||
public void UIPointerAccessoryPositionTopLeftTest () | ||
{ | ||
UIPointerAccessory acc = null; | ||
Assert.DoesNotThrow (() => acc = UIPointerAccessory.CreateArrow (UIPointerAccessoryPosition.TopLeft), "Should not throw"); | ||
Assert.NotNull (acc, $"{nameof (acc)} was null"); | ||
Assert.AreEqual (acc.Position.Offset, UIPointerAccessoryPosition.TopLeft.Offset, "Offset"); | ||
Assert.AreEqual (acc.Position.Angle, UIPointerAccessoryPosition.TopLeft.Angle, "Offset"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: "Angle" |
||
} | ||
} | ||
} | ||
#endif // __IOS__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Availability is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm Availability is there too!