Skip to content
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

Merged
merged 7 commits into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions src/UIKit/UIEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2336,6 +2336,8 @@ public enum UIMenuElementAttributes : ulong {
public enum UIMenuOptions : ulong {
DisplayInline = 1uL << 0,
Destructive = 1uL << 1,
[iOS (15,0), TV (15,0), NoWatch, MacCatalyst (15,0)]
SingleSelection = 1uL << 5,
}

[NoWatch, NoTV, iOS (13, 0)]
Expand Down Expand Up @@ -2443,6 +2445,9 @@ public enum UIMenuIdentifier {
Alignment,
[Field ("UIMenuToolbar")]
Toolbar,
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
[Field ("UIMenuSidebar")]
Sidebar,
[Field ("UIMenuFullscreen")]
Fullscreen,
[Field ("UIMenuMinimizeAndZoom")]
Expand Down Expand Up @@ -2947,6 +2952,30 @@ public enum UIPasteboardDetectionPattern {
ProbableWebSearch,
[Field ("UIPasteboardDetectionPatternNumber")]
Number,
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
[Field ("UIPasteboardDetectionPatternLink")]
Link,
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
[Field ("UIPasteboardDetectionPatternPhoneNumber")]
PhoneNumber,
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
[Field ("UIPasteboardDetectionPatternEmailAddress")]
EmailAddress,
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
[Field ("UIPasteboardDetectionPatternPostalAddress")]
PostalAddress,
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
[Field ("UIPasteboardDetectionPatternCalendarEvent")]
CalendarEvent,
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
[Field ("UIPasteboardDetectionPatternShipmentTrackingNumber")]
ShipmentTrackingNumber,
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
[Field ("UIPasteboardDetectionPatternFlightNumber")]
FlightNumber,
[iOS (15,0), TV (15,0), MacCatalyst (15,0)]
[Field ("UIPasteboardDetectionPatternMoneyAmount")]
MoneyAmount,
}

[Introduced (PlatformName.MacCatalyst, 14, 0)]
Expand Down Expand Up @@ -3026,4 +3055,116 @@ public enum UIGuidedAccessRestrictionState : long {
Allow,
Deny,
}

[TV (15,0), iOS (15,0), NoWatch, MacCatalyst (15,0)]
public enum UIActionIdentifier {
[DefaultEnumValue]
[Field (null)]
None = -1,

[Field ("UIActionPaste")]
Paste,

[Field ("UIActionPasteAndMatchStyle")]
PasteAndMatchStyle,

[Field ("UIActionPasteAndGo")]
PasteAndGo,

[Field ("UIActionPasteAndSearch")]
PasteAndSearch,
}

[NoWatch, NoTV, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum UIBandSelectionInteractionState : long {
Possible = 0,
Began,
Selecting,
Ended,
}

[NoWatch, NoTV, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum UIBehavioralStyle : ulong {
Automatic = 0,
Pad,
Mac,
}

[TV (15,0), NoWatch, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum UIButtonConfigurationSize : long {
Medium,
Small,
Mini,
Large,
}

[TV (15,0), NoWatch, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum UIButtonConfigurationTitleAlignment : long {
Automatic,
Leading,
Center,
Trailing,
}

[TV (15,0), NoWatch, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum UIButtonConfigurationCornerStyle : long {
Fixed = -1,
Dynamic,
Small,
Medium,
Large,
Capsule,
}

[TV (15,0), NoWatch, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum UIButtonConfigurationMacIdiomStyle : long {
Automatic,
Bordered,
Borderless,
BorderlessTinted,
}

[NoTV, NoWatch, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum UIFocusGroupPriority : long {
Ignored = 0,
PreviouslyFocused = 1000,
Prioritized = 2000,
CurrentlyFocused = Int64.MaxValue,
}

[NoWatch, NoTV, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum UIFocusHaloEffectPosition : long {
Automatic = 0,
Outside,
Inside,
}

[NoWatch, NoTV, iOS (15,0), MacCatalyst (15,0)]
public enum UISheetPresentationControllerDetentIdentifier {
[DefaultEnumValue]
[Field (null)]
Unknown = -1,

[Field ("UISheetPresentationControllerDetentIdentifierMedium")]
Medium,

[Field ("UISheetPresentationControllerDetentIdentifierLarge")]
Large,
}

[NoWatch, TV (15,0), iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum UIWindowScenePresentationStyle : ulong {
Automatic,
Standard,
Prominent,
}
}
47 changes: 46 additions & 1 deletion src/UIKit/UITypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;

using ObjCRuntime;
using Foundation;
Expand Down Expand Up @@ -150,7 +151,51 @@ public override int GetHashCode ()
public static UIFloatRange Infinite = new UIFloatRange (nfloat.NegativeInfinity, nfloat.PositiveInfinity);
}
#endif


#if IOS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Availability is missing.

Copy link
Member Author

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!

#if !NET
 	[Introduced (PlatformName.iOS, 15,0)]
 #else
 	[SupportedOSPlatform ("ios15.0")]
 #endif //!NET

#if !NET
[Introduced (PlatformName.iOS, 15,0)]
#else
[SupportedOSPlatform ("ios15.0")]
#endif //!NET
[StructLayout (LayoutKind.Sequential)]
public struct UIPointerAccessoryPosition {
public nfloat Offset, Angle;

public UIPointerAccessoryPosition (nfloat offset, nfloat angle)
{
Offset = offset;
Angle = angle;
}

#if !COREBUILD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are missing for these manual code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Field ("UIPointerAccessoryPositionTop", "UIKit")]
public static UIPointerAccessoryPosition Top => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionTop"), typeof (UIPointerAccessoryPosition))!;

[Field ("UIPointerAccessoryPositionTopRight", "UIKit")]
public static UIPointerAccessoryPosition TopRight => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionTopRight"), typeof (UIPointerAccessoryPosition))!;

[Field ("UIPointerAccessoryPositionRight", "UIKit")]
public static UIPointerAccessoryPosition Right => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionRight"), typeof (UIPointerAccessoryPosition))!;

[Field ("UIPointerAccessoryPositionBottomRight", "UIKit")]
public static UIPointerAccessoryPosition BottomRight => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionBottomRight"), typeof (UIPointerAccessoryPosition))!;

[Field ("UIPointerAccessoryPositionBottom", "UIKit")]
public static UIPointerAccessoryPosition Bottom => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionBottom"), typeof (UIPointerAccessoryPosition))!;

[Field ("UIPointerAccessoryPositionBottomLeft", "UIKit")]
public static UIPointerAccessoryPosition BottomLeft => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionBottomLeft"), typeof (UIPointerAccessoryPosition))!;

[Field ("UIPointerAccessoryPositionLeft", "UIKit")]
public static UIPointerAccessoryPosition Left => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionLeft"), typeof (UIPointerAccessoryPosition))!;

[Field ("UIPointerAccessoryPositionTopLeft", "UIKit")]
public static UIPointerAccessoryPosition TopLeft => (UIPointerAccessoryPosition) Marshal.PtrToStructure (Dlfcn.GetIndirect (Libraries.UIKit.Handle, "UIPointerAccessoryPositionTopLeft"), typeof (UIPointerAccessoryPosition))!;
#endif
}
#endif

#if false
[Protocol]
public interface IUITextInputTraits {
Expand Down
Loading