Skip to content

Commit

Permalink
[UIKit] Add support for Xcode 14 up to beta 5. (#15694)
Browse files Browse the repository at this point in the history
Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
Co-authored-by: TJ Lambert <[email protected]>
Co-authored-by: Alex Soto <[email protected]>
  • Loading branch information
4 people committed Aug 27, 2022
1 parent 76e395b commit 8cecb96
Show file tree
Hide file tree
Showing 22 changed files with 1,968 additions and 2,287 deletions.
7 changes: 0 additions & 7 deletions src/AppKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1637,13 +1637,6 @@ public enum NSTextTableLayoutAlgorithm : ulong {
Automatic, Fixed
}

[NoMacCatalyst]
[Flags]
[Native]
public enum NSTextListOptions : ulong {
PrependEnclosingMarker = 1
}

[NoMacCatalyst]
[Flags]
public enum NSFontSymbolicTraits : int { // uint32_t NSFontSymbolicTraits
Expand Down
2 changes: 1 addition & 1 deletion src/UIKit/UIBarButtonItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public UIBarButtonItem (UIBarButtonSystemItem systemItem, EventHandler handler)
MarkDirty ();
}

public UIBarButtonItem (UIBarButtonSystemItem systemItem) : this (systemItem, null, null)
public UIBarButtonItem (UIBarButtonSystemItem systemItem) : this (systemItem: systemItem, target: null, action: null)
{
}

Expand Down
36 changes: 35 additions & 1 deletion src/UIKit/UIEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,10 @@ public enum UIDataDetectorType : ulong {
FlightNumber = 1 << 5,
[iOS (10,0)]
LookupSuggestion = 1 << 6,
[NoWatch, NoTV, iOS (16,0), MacCatalyst (16,0)]
Money = 1 << 7,
[NoWatch, NoTV, iOS (16,0), MacCatalyst (16,0)]
PhysicalValue = 1uL << 8,

None = 0,
All = UInt64.MaxValue
Expand Down Expand Up @@ -894,6 +898,9 @@ public enum UIModalPresentationStyle : long {
OverCurrentContext,
[NoTV]
Popover,
[Deprecated (PlatformName.iOS, 16, 0)]
[Deprecated (PlatformName.TvOS, 16, 0)]
[Deprecated (PlatformName.MacCatalyst, 16, 0)]
BlurOverFullScreen,
}

Expand Down Expand Up @@ -1375,7 +1382,13 @@ public enum UIKeyModifierFlags : long {
[Native]
[NoWatch]
public enum UIScrollViewKeyboardDismissMode : long {
None, OnDrag, Interactive
None,
OnDrag,
Interactive,
[TV (16,0), iOS (16,0), MacCatalyst (16,0)]
OnDragWithAccessory,
[TV (16,0), iOS (16,0), MacCatalyst (16,0)]
InteractiveWithAccessory,
}

// NSInteger -> UIWebView.h
Expand Down Expand Up @@ -1686,6 +1699,14 @@ public enum UIFontWeight {
Black,
}

[Watch (9,0), TV (16,0), iOS (16, 0), MacCatalyst (16,0)]
public enum UIFontWidth {
Condensed,
Standard,
Expanded,
Compressed,
}

[NoWatch]
[iOS (9,0)]
[Native]
Expand Down Expand Up @@ -2270,6 +2291,8 @@ public enum UISceneErrorCode : long
{
MultipleScenesNotSupported,
RequestDenied,
GeometryRequestUnsupported = 100,
GeometryRequestDenied,
}

[Watch (6,0), TV (13,0), iOS (13,0)]
Expand Down Expand Up @@ -2322,6 +2345,8 @@ public enum UIMenuElementAttributes : ulong {
Disabled = 1uL << 0,
Destructive = 1uL << 1,
Hidden = 1uL << 2,
[TV (16,0), iOS (16,0), MacCatalyst (16,0)]
KeepsMenuPresented = 1uL << 3,
}

[Flags]
Expand Down Expand Up @@ -2354,6 +2379,10 @@ public enum UIWindowSceneSessionRole {
[Field ("CPTemplateApplicationSceneSessionRoleApplication", "CarPlay")]
#endif
CarTemplateApplication,

[TV (16,0), iOS (16, 0), MacCatalyst (16,0)]
[Field ("UIWindowSceneSessionRoleExternalDisplayNonInteractive")]
ExternalDisplayNonInteractive,
}

[iOS (13,0), TV (13,0), NoWatch]
Expand Down Expand Up @@ -2455,6 +2484,11 @@ public enum UIMenuIdentifier {
[MacCatalyst (14,0)]
[Field ("UIMenuOpenRecent")]
OpenRecent,

[TV (16,0), iOS (16, 0), MacCatalyst (16,0)]
[Field ("UIMenuDocument")]
Document,

}

[iOS (13,0), TV (13,0), Watch (6,0)]
Expand Down
36 changes: 36 additions & 0 deletions src/UIKit/UIFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,30 @@ static nfloat GetFontWeight (UIFontWeight weight)
}
}

#if NET
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
[SupportedOSPlatform ("tvos16.0")]
#else
[Watch (9,0), iOS (16,0), TV (16,0), MacCatalyst (16,0)]
#endif
static double GetFontWidth (UIFontWidth width)
{
switch (width) {
case UIFontWidth.Condensed:
return UIFontWidthConstants.Condensed;
case UIFontWidth.Standard:
return UIFontWidthConstants.Standard;
case UIFontWidth.Expanded:
return UIFontWidthConstants.Expanded;
case UIFontWidth.Compressed:
return UIFontWidthConstants.Compressed;
default:
throw new ArgumentException (width.ToString ());
}
}


#if NET
[SupportedOSPlatform ("ios8.2")]
[SupportedOSPlatform ("maccatalyst")]
Expand Down Expand Up @@ -318,6 +342,18 @@ public static UIFont SystemFontOfSize (nfloat size)
return ptr == IntPtr.Zero ? null : new UIFont (ptr);
}

#if NET
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
[SupportedOSPlatform ("tvos16.0")]
#else
[Watch (9,0), iOS (16,0), TV (16,0), MacCatalyst (16,0)]
#endif
public static UIFont SystemFontOfSize (nfloat fontSize, UIFontWeight weight, UIFontWidth width) {
var ptr = _SystemFontOfSize (fontSize, GetFontWeight (weight), GetFontWidth (width));
return ptr == IntPtr.Zero ? null : new UIFont (ptr);
}

#if NET
[SupportedOSPlatform ("ios8.2")]
[SupportedOSPlatform ("maccatalyst")]
Expand Down
109 changes: 0 additions & 109 deletions src/appkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18961,115 +18961,6 @@ partial interface NSTextInputContext {
string LocalizedNameForInputSource (string inputSourceIdentifier);
}

[NoMacCatalyst]
[BaseType (typeof (NSObject))]
interface NSTextList : NSCoding, NSCopying, NSSecureCoding {
[Export ("initWithMarkerFormat:options:")]
#if NET
NativeHandle Constructor ([BindAs (typeof (NSTextListMarkerFormats))] NSString format, NSTextListOptions mask);
#else
NativeHandle Constructor (string format, NSTextListOptions mask);
#endif

#if !NET
[Wrap ("this (format.GetConstant(), mask)")]
NativeHandle Constructor (NSTextListMarkerFormats format, NSTextListOptions mask);
#endif

#if NET
[BindAs (typeof (NSTextListMarkerFormats))]
#endif
[Export ("markerFormat")]
#if NET
NSString MarkerFormat { get; }
#else
string MarkerFormat { get; }
#endif

[Export ("listOptions")]
NSTextListOptions ListOptions { get; }

[Export ("markerForItemNumber:")]
string GetMarker (nint itemNum);

//Detected properties
[Export ("startingItemNumber")]
nint StartingItemNumber { get; set; }

}

[NoMacCatalyst]
enum NSTextListMarkerFormats
{
[Mac (10, 13)]
[Field ("NSTextListMarkerBox")]
Box,

[Mac (10, 13)]
[Field ("NSTextListMarkerCheck")]
Check,

[Mac (10, 13)]
[Field ("NSTextListMarkerCircle")]
Circle,

[Mac (10, 13)]
[Field ("NSTextListMarkerDiamond")]
Diamond,

[Mac (10, 13)]
[Field ("NSTextListMarkerDisc")]
Disc,

[Mac (10, 13)]
[Field ("NSTextListMarkerHyphen")]
Hyphen,

[Mac (10, 13)]
[Field ("NSTextListMarkerSquare")]
Square,

[Mac (10, 13)]
[Field ("NSTextListMarkerLowercaseHexadecimal")]
LowercaseHexadecimal,

[Mac (10, 13)]
[Field ("NSTextListMarkerUppercaseHexadecimal")]
UppercaseHexadecimal,

[Mac (10, 13)]
[Field ("NSTextListMarkerOctal")]
Octal,

[Mac (10, 13)]
[Field ("NSTextListMarkerLowercaseAlpha")]
LowercaseAlpha,

[Mac (10, 13)]
[Field ("NSTextListMarkerUppercaseAlpha")]
UppercaseAlpha,

[Mac (10, 13)]
[Field ("NSTextListMarkerLowercaseLatin")]
LowercaseLatin,

[Mac (10, 13)]
[Field ("NSTextListMarkerUppercaseLatin")]
UppercaseLatin,

[Mac (10, 13)]
[Field ("NSTextListMarkerLowercaseRoman")]
LowercaseRoman,

[Mac (10, 13)]
[Field ("NSTextListMarkerUppercaseRoman")]
UppercaseRoman,

[Mac (10, 13)]
[Field ("NSTextListMarkerDecimal")]
Decimal,
}

[NoMacCatalyst]
[BaseType (typeof (NSTextBlock))]
[DisableDefaultCtor]
Expand Down
2 changes: 1 addition & 1 deletion src/generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,7 @@ public TrampolineInfo MakeTrampoline (Type t)
}

var rt = mi.ReturnType;
var rts = IsNativeEnum (rt) ? "var" : rt.ToString ();
var rts = IsNativeEnum (rt) ? "var" : RenderType (rt);
var trampoline_name = MakeTrampolineName (t);
var ti = new TrampolineInfo (userDelegate: FormatType (null, t),
delegateName: "D" + trampoline_name,
Expand Down
Loading

6 comments on commit 8cecb96

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥 [CI Build] Build failed 🔥

Build failed for the job 'Detect API changes'

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥 Unable to find the contents for the comment: D:\a\1\s\change-detection\results\gh-comment.md does not exist :fire

Pipeline on Agent
Hash: 8cecb962a46e8c7be55b5db5e29cc416028b2803 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

💻 [CI Build] Tests on macOS Mac Catalina (10.15) passed 💻

All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Hash: 8cecb962a46e8c7be55b5db5e29cc416028b2803 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

📚 [CI Build] Artifacts 📚

Artifacts were not provided.

Pipeline on Agent XAMMINI-060.Monterey'
Hash: 8cecb962a46e8c7be55b5db5e29cc416028b2803 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌

Failed tests are:

  • introspection
  • xammac_tests
  • monotouch-test

Pipeline on Agent
Hash: 8cecb962a46e8c7be55b5db5e29cc416028b2803 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

0 tests crashed, 1 tests failed, 227 tests passed.

Failures

❌ introspection tests

1 tests failed, 12 tests passed.
  • introspection/watchOS 32-bits - simulator/Debug (watchOS 6.0): Crashed Known issue: HE0038)

Html Report (VSDrops) Download

Successes

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 23 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: [CI build]

Please sign in to comment.