From 4688f61731f0fae76852f40ff0ae2293d2929c20 Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Tue, 19 Apr 2022 13:54:53 -0500 Subject: [PATCH 01/19] [NET Attribute Conversion][generator] Generate NET style attributes - The integration with the existing generator code is not ideal in this commit, but given time pressures it will hopefully be improved in the future. - GetPlatformAttributesToPrint is repeating some of the logic that is #if !NET'ed out in places such as PrintPlatformAttributes because those checks were not robust enough for the NET6 attribute logic (we generate many more 'duplicate' attributes now) --- src/generate-frameworks.csharp | 2 +- src/generator.cs | 323 ++++++++++++++++++++++++++++++++- 2 files changed, 320 insertions(+), 5 deletions(-) diff --git a/src/generate-frameworks.csharp b/src/generate-frameworks.csharp index d972ca97ee75..2b35a5adfde2 100755 --- a/src/generate-frameworks.csharp +++ b/src/generate-frameworks.csharp @@ -52,7 +52,7 @@ try { for (int i = 0; i < names.Length; i++) { var name = names [i]; var frameworks = allframeworks [i]; - sb.Append ($"\treadonly HashSet {name} = new HashSet {{\""); + sb.Append ($"\tinternal readonly HashSet {name} = new HashSet {{\""); sb.Append (string.Join ("\", \"", frameworks)); sb.AppendLine ("\"};"); } diff --git a/src/generator.cs b/src/generator.cs index ee279aa4cf2e..f1e050cbd89e 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3369,6 +3369,11 @@ bool Duplicated (AvailabilityBaseAttribute candidate, AvailabilityBaseAttribute[ // more important since dotnet and legacy have different minimums (so this can't be done in binding files) bool FilterMinimumVersion (AvailabilityBaseAttribute aa) { +#if NET + // dotnet can never filter minimum versions, as they are semantically important in some cases + // See for details: https://github.com/xamarin/xamarin-macios/issues/10170 + return true; +#else if (aa.AvailabilityKind != AvailabilityKind.Introduced) return true; @@ -3393,6 +3398,306 @@ bool FilterMinimumVersion (AvailabilityBaseAttribute aa) throw new BindingException (1047, aa.Platform.ToString ()); } return aa.Version > min; +#endif + } + + static AvailabilityBaseAttribute CloneFromOtherPlatform (AvailabilityBaseAttribute attr, PlatformName platform) + { + if (attr.Version is null) { + switch (attr.AvailabilityKind) { + case AvailabilityKind.Introduced: + return new IntroducedAttribute (platform, message: attr.Message); + case AvailabilityKind.Deprecated: + return new DeprecatedAttribute(platform, message: attr.Message); + case AvailabilityKind.Obsoleted: + return new ObsoletedAttribute(platform, message: attr.Message); + case AvailabilityKind.Unavailable: + return new UnavailableAttribute(platform, message: attr.Message); + default: + throw new NotImplementedException (); + } + } + else { + // Revision is optional, and is returned as -1 if not yet. However the Version ctor called inside the attributes throws if you pass -1 so coerse to 0 + int revision = attr.Version.Revision == -1 ? 0 : attr.Version.Revision; + switch (attr.AvailabilityKind) { + case AvailabilityKind.Introduced: + return new IntroducedAttribute(platform, attr.Version.Major, attr.Version.Minor, revision, message: attr.Message); + case AvailabilityKind.Deprecated: + return new DeprecatedAttribute(platform, attr.Version.Major, attr.Version.Minor, revision, message: attr.Message); + case AvailabilityKind.Obsoleted: + return new ObsoletedAttribute(platform, attr.Version.Major, attr.Version.Minor, revision, message: attr.Message); + case AvailabilityKind.Unavailable: + return new UnavailableAttribute(platform, message: attr.Message); + default: + throw new NotImplementedException (); + } + } + } + + static AvailabilityBaseAttribute CreateMinSupportedAttribute (PlatformName platform) + { + switch (platform) { + case PlatformName.iOS: + return new IntroducedAttribute(platform, Xamarin.SdkVersions.MiniOSVersion.Major, Xamarin.SdkVersions.MiniOSVersion.Minor); + case PlatformName.TvOS: + return new IntroducedAttribute(platform, Xamarin.SdkVersions.MinTVOSVersion.Major, Xamarin.SdkVersions.MinTVOSVersion.Minor); + case PlatformName.MacOSX: + return new IntroducedAttribute(platform, Xamarin.SdkVersions.MinOSXVersion.Major, Xamarin.SdkVersions.MinOSXVersion.Minor); + case PlatformName.WatchOS: + throw new InvalidOperationException ("CreateMinSupportedAttribute for WatchOS never makes sense"); + case PlatformName.MacCatalyst: + throw new InvalidOperationException ("CreateMinSupportedAttribute for Catalyst never makes sense"); + default: + throw new NotImplementedException (); + } + } + + static AvailabilityBaseAttribute CreateUnsupportedAttribute (PlatformName platform) + { + switch (platform) { + case PlatformName.iOS: + case PlatformName.MacCatalyst: + case PlatformName.MacOSX: + case PlatformName.TvOS: + return new UnavailableAttribute(platform); + case PlatformName.WatchOS: + throw new InvalidOperationException ("CreateUnsupportedAttribute for WatchOS never makes sense"); + default: + throw new NotImplementedException (); + } + } + + HashSet GetFrameworkListForPlatform (PlatformName platform) + { + switch (platform) + { + case PlatformName.iOS: + return Frameworks.iosframeworks; + case PlatformName.TvOS: + return Frameworks.tvosframeworks; + case PlatformName.MacOSX: + return Frameworks.macosframeworks; + case PlatformName.MacCatalyst: + return Frameworks.maccatalystframeworks; + default: + return new HashSet(); + } + } + + static string FindNamespace (MemberInfo item) + { + switch (item) { + case TypeInfo type: + return type.Namespace; + case PropertyInfo prop: + return prop.DeclaringType.Namespace; + case MethodInfo meth: + return meth.DeclaringType.Namespace; + default: + throw new NotImplementedException ($"FindNamespace on {item} of type {item.GetType()}"); + } + } + + IEnumerable AddUnlistedAvailability (MemberInfo containingClass, List availability) + { + // If there are literally no attributes for a platform on a type, for non-catalyst platforms + // add a minimum supported introdced since it was "unlisted" + foreach (var platform in new [] { PlatformName.iOS, PlatformName.TvOS, PlatformName.MacOSX }) { + var list = GetFrameworkListForPlatform (platform); + if (!availability.Any (v => v.Platform == platform)) { + string ns = FindNamespace (containingClass); + if (list.Contains(ns)) { + yield return CreateMinSupportedAttribute (platform); + } + } + } + } + + static void AddImpliedCatalyst (List memberAvailability) + { + foreach (var attr in memberAvailability.Where (v => v.Platform == PlatformName.iOS && v is not ObsoletedAttribute).ToList()) { + if (!memberAvailability.Any (v => (v.Platform == PlatformName.MacCatalyst) && ImpliedKindsMatch (v.AvailabilityKind, attr.AvailabilityKind))) { + var newAttribute = CloneFromOtherPlatform (attr, PlatformName.MacCatalyst); + if (IsValidToCopyTo (memberAvailability, newAttribute)) { + memberAvailability.Add (newAttribute); + } + } + } + } + + // Especially for TV and Catalyst some entire namespaces are removed via framework_sources. + // However, almost all of those bindings are [iOS] which AddImpliedCatalyst and other places + // happily turn into other platforms. + // As a final step, if we are on a namespace that flatly doesn't exist, drop it. Then if we don't have a not supported, add it + void StripIntroducedOnNamespaceNotIncluded (List memberAvailability, MemberInfo context) + { + if (context is TypeInfo containingClass) { + var droppedPlatforms = new HashSet(); + + // Walk all members and look for introduced that are nonsense for our containing class's platform + foreach (var introduced in memberAvailability.Where (a => a.AvailabilityKind == AvailabilityKind.Introduced).ToList()) { + var list = GetFrameworkListForPlatform (introduced.Platform); + string ns = (containingClass as TypeInfo)?.Namespace; + if (!list.Contains(ns)) { + memberAvailability.Remove (introduced); + droppedPlatforms.Add (introduced.Platform); + } + } + + // For each attribute we dropped, if we don't have an existing non-introduced, create one + foreach (var platform in droppedPlatforms) { + if (!memberAvailability.Any (a => platform == a.Platform && a.AvailabilityKind != AvailabilityKind.Introduced)) { + memberAvailability.Add (CreateUnsupportedAttribute (platform)); + } + } + } + } + + static bool IsValidToCopyTo (List dest, AvailabilityBaseAttribute addition) + { + // If we are duplicating an existing attribute + if (dest.Any (d => d.Platform == addition.Platform && d.AvailabilityKind == addition.AvailabilityKind)) + return false; + // If we are introduced and there is already an Unavailable + if (addition is IntroducedAttribute && dest.Any (d => d.Platform == addition.Platform && d.AvailabilityKind == AvailabilityKind.Unavailable)) + return false; + return true; + } + + + static void CopyValidAttributes (List dest, IEnumerable additions) + { + foreach (var addition in additions.Where (a => IsValidToCopyTo (dest, a))) { + dest.Add (CloneFromOtherPlatform (addition, addition.Platform)); + } + } + + // Both deprecated and obsolete turn into UnsupportedOSPlatform, so we have to match more generally + static bool ImpliedKindsMatch (AvailabilityKind left, AvailabilityKind right) + { + return ConvertKindToMatchKind (left) == ConvertKindToMatchKind (right); + } + + static bool ConvertKindToMatchKind (AvailabilityKind kind) + { + switch (kind) + { + case AvailabilityKind.Introduced: + return true; + case AvailabilityKind.Deprecated: + case AvailabilityKind.Obsoleted: + case AvailabilityKind.Unavailable: + return false; + default: + throw new NotImplementedException ($"ConvertKindToMatchKind with unknown kind {kind}"); + } + } + + // This assumes the compiler implements property methods as get_ or set_ prefixes + static PropertyInfo GetProperyFromGetSetMethod (MethodInfo method) + { + string name = method.Name; + if (name.StartsWith ("get_") || name.StartsWith ("set_")) { + return method.DeclaringType.GetProperty (name.Substring(4)); + } + return null; + } + + static MemberInfo FindContainingContext (MemberInfo mi) + { + if (mi is null) { + throw new InvalidOperationException ("FindContainingContext could not find parent class?"); + } + if (mi is MethodInfo method) { + var containingProperty = GetProperyFromGetSetMethod (method); + if (containingProperty != null) { + return containingProperty; + } + } + if (mi is TypeInfo) { + return mi; + } + return FindContainingContext (mi.DeclaringType); + } + + // We need to collect all of the availabilty attriutes walking up the chain of context. + // Example: A get_Foo inside of a property Foo which is inside of a class Klass. + // The Foo property and the Klass both could have unique or duplicate attributes + // We collect them all, starting with the inner most first in the list. + // Later on CopyValidAttributes will handle only copying the first valid one down + List GetAllParentAttributes (MemberInfo context) + { + var parentAvailability = new List(); + while (true) { + parentAvailability.AddRange(AttributeManager.GetCustomAttributes (context)); + var parentContext = FindContainingContext (context); + if (context == parentContext) { + return parentAvailability; + } + context = parentContext; + } + } + + AvailabilityBaseAttribute [] GetPlatformAttributesToPrint (MemberInfo mi, Type type, MemberInfo inlinedType) + { + // Attributes are directly on the member + List memberAvailability = AttributeManager.GetCustomAttributes (mi).ToList(); + + // Due to differences between Xamarin and NET6 availability attributes, we have to synthesize many duplicates for NET6 + // See https://github.com/xamarin/xamarin-macios/issues/10170 for details +#if NET + MemberInfo context = type ?? FindContainingContext (mi); + // Attributes on the _target_ context, the class itself or the target of the protocol inlining + List parentContextAvailability = GetAllParentAttributes (context); + // (Optional) Attributes from the inlined protocol type itself + List inlinedTypeAvailability = inlinedType != null ? GetAllParentAttributes (inlinedType) : null; + + // We must consider attributes if we have any on our type, or if we're inlining and that inlined type has attributes + // If neither are true, we have zero attributes that are relevant + bool shouldConsiderAttributes = memberAvailability.Any () || inlinedTypeAvailability != null && inlinedTypeAvailability.Any (); + if (shouldConsiderAttributes) { + // We will consider any inlinedType attributes first, if any, before any from our parent context + List availabilityToConsider = new List(); + if (inlinedTypeAvailability != null) { + availabilityToConsider.AddRange (inlinedTypeAvailability); + } + availabilityToConsider.AddRange (parentContextAvailability); + + // We do not support Watch, so strip from both our input sources before any processing + memberAvailability = memberAvailability.Where (x => x.Platform != PlatformName.WatchOS).ToList(); + availabilityToConsider = availabilityToConsider.Where (x => x.Platform != PlatformName.WatchOS).ToList(); + + // Add any implied non-catalyst introduced (Catalyst will come later) + availabilityToConsider.AddRange (AddUnlistedAvailability (context, availabilityToConsider)); + + // Copy down any unavailable from the parent before expanding, since a [NoMacCatalyst] on the type trumps [iOS] on a member + CopyValidAttributes (memberAvailability, availabilityToConsider.Where (attr => attr.AvailabilityKind != AvailabilityKind.Introduced).Select (attr => CloneFromOtherPlatform (attr, attr.Platform))); + + // Add implied catalyst from [iOS] _before_ copying down from parent if no catalyst attributes + // As those take precedent. We will do this a second time later in a moment.. + AddImpliedCatalyst (memberAvailability); + + // Now copy it down introduced from the parent + CopyValidAttributes (memberAvailability, availabilityToConsider.Where (attr => attr.AvailabilityKind == AvailabilityKind.Introduced).Select (attr => CloneFromOtherPlatform (attr, attr.Platform))); + + // Now expand the implied catalyst from [iOS] a second time + // This is needed in some cases where the only iOS information is in the + // parent context, but we want to let any local iOS override a catalyst on the parent + AddImpliedCatalyst (memberAvailability); + + // If all of this implication gives us something silly, like being introduced + // on a type that is on a namespace we don't support, ignore those Supported + StripIntroducedOnNamespaceNotIncluded (memberAvailability, context); + if (inlinedType != null) { + StripIntroducedOnNamespaceNotIncluded (memberAvailability, inlinedType); + } + + // Remove any duplicates attributes as well + memberAvailability = memberAvailability.Distinct().ToList (); + } +#endif + return memberAvailability.ToArray (); } public bool PrintPlatformAttributes (MemberInfo mi, Type type = null) @@ -3403,7 +3708,7 @@ public bool PrintPlatformAttributes (MemberInfo mi, Type type = null) AvailabilityBaseAttribute [] type_ca = null; - foreach (var availability in AttributeManager.GetCustomAttributes (mi)) { + foreach (var availability in GetPlatformAttributesToPrint (mi, type, mi.DeclaringType)) { var t = type ?? (mi as TypeInfo) ?? mi.DeclaringType; if (type_ca == null) { if (t != null) @@ -3411,9 +3716,11 @@ public bool PrintPlatformAttributes (MemberInfo mi, Type type = null) else type_ca = Array.Empty (); } +#if !NET // if we're comparing to something else (than ourself) then don't generate duplicate attributes if ((mi != t) && Duplicated (availability, type_ca)) continue; +#endif switch (availability.AvailabilityKind) { case AvailabilityKind.Unavailable: // an unavailable member can override type-level attribute @@ -3421,9 +3728,11 @@ public bool PrintPlatformAttributes (MemberInfo mi, Type type = null) printed = true; break; default: +#if !NET // can't introduce or deprecate/obsolete a member on a type that is not available if (IsUnavailable (type_ca, availability.Platform)) continue; +#endif if (FilterMinimumVersion (availability)) print (availability.ToString ()); printed = true; @@ -3461,10 +3770,10 @@ public void PrintPlatformAttributesNoDuplicates (MemberInfo generatedType, Membe return; var inlined_ca = new List (); - inlined_ca.AddRange (AttributeManager.GetCustomAttributes (inlinedMethod)); + inlined_ca.AddRange (GetPlatformAttributesToPrint (inlinedMethod, generatedType.DeclaringType, generatedType)); if (inlinedMethod.DeclaringType != null) { // if not conflictual add the custom attributes from the type - foreach (var availability in AttributeManager.GetCustomAttributes (inlinedMethod.DeclaringType)) { + foreach (var availability in GetPlatformAttributesToPrint (inlinedMethod.DeclaringType, null, generatedType)) { // already decorated, skip if (HasAvailability (inlined_ca, availability.Platform)) continue; @@ -3478,10 +3787,12 @@ public void PrintPlatformAttributesNoDuplicates (MemberInfo generatedType, Membe var generated_type_ca = new HashSet (); +#if !NET foreach (var availability in AttributeManager.GetCustomAttributes (generatedType)) { var s = availability.ToString (); generated_type_ca.Add (s); } +#endif // the type, in which we are inlining the current method, might already have the same availability attribute // which we would duplicate if generated @@ -4258,7 +4569,7 @@ bool Is64BitiOSOnly (ICustomAttributeProvider provider) return Is64BitiOSOnly (minfo.DeclaringType); return false; } - return attrib.Version.Major >= 11; + return attrib.Version?.Major >= 11; } // @@ -5096,7 +5407,9 @@ void GenerateProperty (Type type, PropertyInfo pi, List instance_fields_ string sel = ba != null ? ba.Selector : export.Selector; // print availability separately since we could be inlining +#if !NET PrintPlatformAttributes (pi, type); +#endif PrintAttributes (pi, platform:false); if (!minfo.is_sealed || !minfo.is_wrapper) { @@ -5169,7 +5482,9 @@ void GenerateProperty (Type type, PropertyInfo pi, List instance_fields_ PrintBlockProxy (pi.PropertyType); // print availability separately since we could be inlining +#if !NET PrintPlatformAttributes (pi, type); +#endif PrintAttributes (pi, platform: false); if (not_implemented_attr == null && (!minfo.is_sealed || !minfo.is_wrapper)) From c56499dc90a75dae33f9e7ce200dcb42390d27a4 Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Tue, 19 Apr 2022 13:58:52 -0500 Subject: [PATCH 02/19] Add new FindSupportedOnElementsThatDoNotExistInThatAssembly test and remove now unnecessary ignores on other tests --- tests/cecil-tests/AttributeTest.cs | 514 +++++++++++++++++++++-------- 1 file changed, 368 insertions(+), 146 deletions(-) diff --git a/tests/cecil-tests/AttributeTest.cs b/tests/cecil-tests/AttributeTest.cs index 18d75560618f..2599bf24a364 100644 --- a/tests/cecil-tests/AttributeTest.cs +++ b/tests/cecil-tests/AttributeTest.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Diagnostics; using System.IO; +using System.Text; using NUnit.Framework; @@ -47,18 +48,16 @@ public void ChildElementsListAvailabilityForAllPlatformsOnParent (string assembl } HashSet found = new HashSet (); - foreach (var prop in Helper.FilterProperties (assembly, a => HasAnyAvailabilityAttribute (a, includeUnsupported: true))) { + foreach (var prop in Helper.FilterProperties (assembly, a => HasAnyAvailabilityAttribute (a))) { CheckAllPlatformsOnParent (prop, prop.FullName, prop.DeclaringType, found); } - foreach (var meth in Helper.FilterMethods (assembly, a => HasAnyAvailabilityAttribute (a, includeUnsupported: true))) { + foreach (var meth in Helper.FilterMethods (assembly, a => HasAnyAvailabilityAttribute (a))) { CheckAllPlatformsOnParent (meth, meth.FullName, meth.DeclaringType, found); } - // XXX - This is triggering due to lack of detection of source code generated types - // foreach (var field in Helper.FilterFields (assembly, a => HasAnyAvailabilityAttribute (a, includeUnsupported: true))) { - // CheckAllPlatformsOnParent (field, field.FullName, field.DeclaringType, found); - // } - - Assert.That (found, Is.Empty); + foreach (var field in Helper.FilterFields (assembly, a => HasAnyAvailabilityAttribute (a))) { + CheckAllPlatformsOnParent (field, field.FullName, field.DeclaringType, found); + } + Assert.That (found, Is.Empty, $"{found.Count} issues found"); } // Look for classes/struct that have double attributes, either because of partial classes or binding errors @@ -84,9 +83,9 @@ public void DoubleAttributedElements (string assemblyPath) } var doubleAttributed = new List(); - foreach (var type in Helper.FilterTypes (assembly, a => HasAnyAvailabilityAttribute (a, includeUnsupported: true))) { + foreach (var type in Helper.FilterTypes (assembly, a => HasAnyAvailabilityAttribute (a))) { var platformCount = new Dictionary (); - foreach (var attribute in type.CustomAttributes.Where (a => IsAvailabilityAttribute (a, includeUnsupported: true))) { + foreach (var attribute in type.CustomAttributes.Where (a => IsAvailabilityAttribute (a))) { var kind = FindAvailabilityKind (attribute); if (kind is not null) { string key = $"{attribute.AttributeType.Name}-{kind}"; @@ -99,6 +98,11 @@ public void DoubleAttributedElements (string assemblyPath) } } foreach (var (kind, count) in platformCount) { + // AVFoundation.AVMetadataIdentifiers uses an old pattern of a parent + // class and many child classes with constants. + if (type.ToString() == "AVFoundation.AVMetadataIdentifiers") { + continue; + } if (count != 1) { doubleAttributed.Add ($"{kind} on {type} had a count of {count}"); #if DEBUG @@ -107,35 +111,342 @@ public void DoubleAttributedElements (string assemblyPath) } } } - Assert.That (doubleAttributed, Is.Empty); + Assert.That (doubleAttributed, Is.Empty, $"{doubleAttributed.Count} issues found"); } void CheckAllPlatformsOnParent (ICustomAttributeProvider item, string fullName, TypeDefinition parent, HashSet found) { - // XXX - For now skip generated code until associated generator.cs changes are in - if (Ignore (fullName) || HasCodegenAttribute (item)) { - return; + var parentAvailability = GetAvailabilityAttributes (parent).ToList (); + + var myAvailability = GetAvailabilityAttributes (item); + if (!FirstContainsAllOfSecond (myAvailability, parentAvailability)) { + DebugPrint (fullName, parentAvailability, myAvailability); + found.Add (fullName); } -// #if DEBUG -// const string Filter = "AppKit"; -// if (!fullName.Contains (" " + Filter)) { -// return; -// } -// #endif + } + + public class PlatformClaimInfo + { + public HashSet MentionedPlatforms { get; set; } // Mentioned in both Supported and Unsupported contexts + public HashSet ClaimedPlatforms { get; set; } // Mentioned only in Supported contexts - var parentAvailability = GetAvailabilityAttributes (parent, includeUnsupported: false).ToList (); -// // This is true in theory, but our code should be explicit and list every platform individually -// // This can be re-enabled if that decision is reverted. + public PlatformClaimInfo (List mentionedPlatforms, List claimedPlatforms) + { + MentionedPlatforms = new HashSet (mentionedPlatforms); + ClaimedPlatforms = new HashSet (claimedPlatforms); + } -// // iOS implies maccatalyst, but only for parent scope -// if (parentAvailability.Contains("ios") && !parentAvailability.Contains("maccatalyst")) { -// parentAvailability.Append("maccatalyst"); -// } + public void UnionWith (PlatformClaimInfo other) + { + MentionedPlatforms.UnionWith (other.MentionedPlatforms); + ClaimedPlatforms.UnionWith (other.ClaimedPlatforms); + } - var myAvailability = GetAvailabilityAttributes (item, includeUnsupported: true); - if (!FirstContainsAllOfSecond (myAvailability, parentAvailability)) { - DebugPrint (fullName, parentAvailability, myAvailability); - found.Add (fullName); + public override string ToString () + { + var str = new StringBuilder (); + str.Append ($"Mentioned: ({String.Join (", ", MentionedPlatforms)})"); + str.Append ($" Claimed: ({String.Join (", ", ClaimedPlatforms)})"); + return str.ToString (); + } + } + + // Due to binding and conversion mistakes, sometimes attributes like `[SupportedOSPlatform ("macos")]` + // might be documented on elements that are removed from the build with conditional compilation + // This test detects these by loading every NET6 platform assembly, and + // comparing reality (what types/members actually exist) with the attributes + // We can not do this against a single assembly at a time, as the attributes saying "this is supported on mac" aren't + // in the mac assembly, that's the bug. + [Test] + public void FindSupportedOnElementsThatDoNotExistInThatAssembly () + { + // Dictionary of (FullName of Member) -> (Dictionary of (Actual Platform) -> Platform Claim Info) + var harvestedInfo = new Dictionary> (); + + // Load each platform assembly + foreach (string assemblyPath in Helper.NetPlatformAssemblies) { + var assembly = Helper.GetAssembly (assemblyPath); + if (assembly is null) { + Assert.Ignore ("{assemblyPath} could not be found (might be disabled in build)"); + return; + } + + string currentPlatform = AssemblyToAttributeName (assemblyPath); + + // Walk every class/struct/enum/property/method/enum value/pinvoke/event + foreach (var module in assembly.Modules) { + foreach (var type in module.Types) { + foreach (var member in GetAllTypeMembers (type)) { + var mentionedPlatforms = GetAvailabilityAttributes (member).ToList(); + if (mentionedPlatforms.Any()) { + var claimedPlatforms = GetSupportedAvailabilityAttributes (member).ToList(); + string key = GetMemberLookupKey (member); + if (!harvestedInfo.ContainsKey (key)) { + harvestedInfo[key] = new Dictionary(); + } + var claimInfo = new PlatformClaimInfo (mentionedPlatforms, claimedPlatforms); + if (harvestedInfo[key].ContainsKey(currentPlatform)) { + harvestedInfo[key][currentPlatform].UnionWith (claimInfo); + } + else { + harvestedInfo[key][currentPlatform] = claimInfo; + } + } + } + } + } + } + + // Now walk every item found above and check two things: + var attributesWereCompiledOut = new List(); + var doesNotExistWhereClaimed = new List(); + foreach (var (member, info) in harvestedInfo) { + // 1. All platforms match in count of mentioned (we did not conditionally compile out attributes) + int expectedPlatformCount = info.First().Value.MentionedPlatforms.Count(); + if (info.Any (i => i.Value.MentionedPlatforms.Count() != expectedPlatformCount)) { + if (IgnoreElementsThatDoNotExistInThatAssembly (member)) { + continue; + } + string detailedPlatformBreakdown = string.Join ("\n", info.Select(x => ($"Assembly {x.Key} => {x.Value}"))); + string errorMessage = $"{member} did not have the same number of SupportedOSPlatformAttribute in every assembly:\n{detailedPlatformBreakdown}"; + attributesWereCompiledOut.Add (errorMessage); +#if DEBUG + Console.Error.WriteLine (errorMessage); +#endif + } + + + // 2. For each supported attribute claim exist, that it exists on that platform + // Since we know each platform claims are now equal, just use the first one + var claimedPlatforms = info.First().Value.ClaimedPlatforms; + foreach (var platform in claimedPlatforms) { + if (!info.ContainsKey (platform)) { + if (IgnoreElementsThatDoNotExistInThatAssembly (member)) { + continue; + } + string detailedPlatformBreakdown = string.Join ("\n", info.Select(x => ($"Assembly {x.Key} => Declares ({string.Join (" ", x.Value)})"))); + string errorMessage = $"{member} was not found on {platform} despite being declared supported there."; + doesNotExistWhereClaimed.Add (errorMessage); +#if DEBUG + Console.Error.WriteLine (errorMessage); +#endif + } + } + } + + Assert.That (attributesWereCompiledOut, Is.Empty, $"{attributesWereCompiledOut.Count} issues found"); + Assert.That (doesNotExistWhereClaimed, Is.Empty, $"{doesNotExistWhereClaimed.Count} issues found"); + } + + static bool IgnoreElementsThatDoNotExistInThatAssembly (string member) + { + // Xkit has many platform specific bits in AppKit/UIKit and is a mess to get right + if (member.StartsWith ("Kit")) { + return true; + } + // QuickLook is aliased with QuickLookUI on some platforms + if (member.StartsWith("QuickLook")) { + return true; + } + // These two types are defined with non-trivial define magic and one platform doesn't necessarily have + // the same members + if (member.StartsWith ("MediaPlayer.MPMediaItem") || member.StartsWith ("MediaPlayer.MPMediaEntity")) { + return true; + } + // These are defined with a code behind due to API differences based on version + switch (member) { + case "MetricKit.MXMetaData.get_DictionaryRepresentation": + case "MetricKit.MXMetaData.DictionaryRepresentation": + return true; + } + // Generator Bug - Protocol inline with different attribute bug + if (member.StartsWith ("SceneKit.SCNLayer") || + member.StartsWith ("AVFoundation.AVAudioSession")) { + return true; + } + switch (member) { + case "GameplayKit.GKHybridStrategist.get_GameModel": + case "GameplayKit.GKHybridStrategist.get_RandomSource": + case "GameplayKit.GKHybridStrategist.set_GameModel": + case "GameplayKit.GKHybridStrategist.set_RandomSource": + case "GLKit.GLKMeshBuffer.get_Allocator": + case "GLKit.GLKMeshBuffer.get_Length": + case "GLKit.GLKMeshBuffer.get_Map": + case "GLKit.GLKMeshBuffer.get_Type": + case "GLKit.GLKMeshBuffer.get_Zone": + case "Intents.INObject.get_AlternativeSpeakableMatches": + case "Intents.INObject.get_Identifier": + case "Intents.INObject.get_PronunciationHint": + case "Intents.INObject.get_SpokenPhrase": + case "Intents.INObject.get_VocabularyIdentifier": + case "TVKit.TVMediaItemContentView.get_Configuration": + case "TVKit.TVMediaItemContentView.set_Configuration": + case "TVKit.TVMonogramContentView.get_Configuration": + case "TVKit.TVMonogramContentView.set_Configuration": + case "CarPlay.CPApplicationDelegate.get_Window": + case "CarPlay.CPApplicationDelegate.set_Window": + case "AVFoundation.AVAssetDownloadDelegate.DidFinishCollectingMetrics": + case "AVFoundation.AVAssetDownloadDelegate.TaskIsWaitingForConnectivity": + case "AVFoundation.AVAssetDownloadDelegate.WillBeginDelayedRequest": + case "ARKit.ARQuickLookPreviewItem.get_PreviewItemTitle": + case "ARKit.ARQuickLookPreviewItem.get_PreviewItemUrl": + case "Intents.INPerson.get_AlternativeSpeakableMatches": + case "Intents.INPerson.get_Identifier": + case "Intents.INPerson.get_PronunciationHint": + case "Intents.INPerson.get_SpokenPhrase": + case "Intents.INPerson.get_VocabularyIdentifier": + case "MetricKit.MXUnitSignalBars.get_Symbol": + case "MetricKit.MXUnitAveragePixelLuminance.get_Symbol": + return true; + } + // Generator Bug/Limitation - Related to ^, Wrapper protocol get/set with attributes + switch (member) { + case "AuthenticationServices.ASExtensionErrorCodeExtensions.get_LocalizedFailureReasonErrorKey": + case "AuthenticationServices.ASExtensionErrorCodeExtensions.LocalizedFailureReasonErrorKey": + case "Intents.INSearchForMessagesIntentHandling_Extensions.ResolveSpeakableGroupNames:": + case "Intents.INSearchIntents.INSearchCallHistoryIntentHandling_Extensions": + case "Intents.INStartAudioCallIntentHandling_Extensions.ResolveDestinationType": + case "Metal.IMTLResourceStateCommandEncoder.Wait": + case "Metal.IMTLBlitCommandEncoder.ResetTextureAccessCounters": + case "Metal.IMTLRenderCommandEncoder_Extensions.SetScissorRects": + case "Metal.IMTLRenderCommandEncoder_Extensions.SetViewports": + case "Metal.MTLAccelerationStructureCommandEncoderWrapper.get_Device": + case "Metal.MTLAccelerationStructureCommandEncoderWrapper.get_Label": + case "Metal.MTLAccelerationStructureCommandEncoderWrapper.set_Label": + case "Metal.MTLAccelerationStructureWrapper.AllocatedSize": + case "Metal.MTLAccelerationStructureWrapper.get_AllocatedSize": + case "Metal.MTLAccelerationStructureWrapper.get_CpuCacheMode": + case "Metal.MTLAccelerationStructureWrapper.get_Device": + case "Metal.MTLAccelerationStructureWrapper.get_HazardTrackingMode": + case "Metal.MTLAccelerationStructureWrapper.get_Heap": + case "Metal.MTLAccelerationStructureWrapper.get_HeapOffset": + case "Metal.MTLAccelerationStructureWrapper.get_IsAliasable": + case "Metal.MTLAccelerationStructureWrapper.get_Label": + case "Metal.MTLAccelerationStructureWrapper.get_ResourceOptions": + case "Metal.MTLAccelerationStructureWrapper.get_StorageMode": + case "Metal.MTLAccelerationStructureWrapper.HazardTrackingMode": + case "Metal.MTLAccelerationStructureWrapper.Heap": + case "Metal.MTLAccelerationStructureWrapper.HeapOffset": + case "Metal.MTLAccelerationStructureWrapper.IsAliasable": + case "Metal.MTLAccelerationStructureWrapper.ResourceOptions": + case "Metal.MTLAccelerationStructureWrapper.set_Label": + case "Metal.MTLBlitCommandEncoder_Extensions.GetTextureAccessCounters": + case "Metal.MTLBlitCommandEncoder_Extensions.ResetTextureAccessCounters": + case "Metal.IMTLBlitCommandEncoder.GetTextureAccessCounters": + case "Metal.MTLIntersectionFunctionTableWrapper.AllocatedSize": + case "Metal.MTLIntersectionFunctionTableWrapper.get_AllocatedSize": + case "Metal.MTLIntersectionFunctionTableWrapper.get_CpuCacheMode": + case "Metal.MTLIntersectionFunctionTableWrapper.get_Device": + case "Metal.MTLIntersectionFunctionTableWrapper.get_HazardTrackingMode": + case "Metal.MTLIntersectionFunctionTableWrapper.get_Heap": + case "Metal.MTLIntersectionFunctionTableWrapper.get_HeapOffset": + case "Metal.MTLIntersectionFunctionTableWrapper.get_IsAliasable": + case "Metal.MTLIntersectionFunctionTableWrapper.get_Label": + case "Metal.MTLIntersectionFunctionTableWrapper.get_ResourceOptions": + case "Metal.MTLIntersectionFunctionTableWrapper.get_StorageMode": + case "Metal.MTLIntersectionFunctionTableWrapper.HazardTrackingMode": + case "Metal.MTLIntersectionFunctionTableWrapper.Heap": + case "Metal.MTLIntersectionFunctionTableWrapper.HeapOffset": + case "Metal.MTLIntersectionFunctionTableWrapper.IsAliasable": + case "Metal.MTLIntersectionFunctionTableWrapper.ResourceOptions": + case "Metal.MTLIntersectionFunctionTableWrapper.set_Label": + case "Metal.MTLResourceStateCommandEncoder_Extensions.Wait": + case "Metal.IMTLResourceStateCommandEncoder_Extensions.Wait": + case "Metal.MTLResourceStateCommandEncoderWrapper.get_Device": + case "Metal.MTLResourceStateCommandEncoderWrapper.get_Label": + case "Metal.MTLResourceStateCommandEncoderWrapper.set_Label": + case "Metal.IMTLResourceStateCommandEncoder.Update": + case "Metal.MTLTexture_Extensions.GetFirstMipmapInTail": + case "Metal.MTLTexture_Extensions.GetIsSparse": + case "Metal.MTLTexture_Extensions.GetTailSizeInBytes": + case "Metal.MTLTextureWrapper.FirstMipmapInTail": + case "Metal.MTLTextureWrapper.get_FirstMipmapInTail": + case "Metal.MTLTextureWrapper.get_IsSparse": + case "Metal.MTLTextureWrapper.get_TailSizeInBytes": + case "Metal.MTLTextureWrapper.IsSparse": + case "Metal.MTLTextureWrapper.TailSizeInBytes": + case "Metal.MTLVisibleFunctionTableWrapper.AllocatedSize": + case "Metal.MTLVisibleFunctionTableWrapper.get_AllocatedSize": + case "Metal.MTLVisibleFunctionTableWrapper.get_CpuCacheMode": + case "Metal.MTLVisibleFunctionTableWrapper.get_Device": + case "Metal.MTLVisibleFunctionTableWrapper.get_HazardTrackingMode": + case "Metal.MTLVisibleFunctionTableWrapper.get_Heap": + case "Metal.MTLVisibleFunctionTableWrapper.get_HeapOffset": + case "Metal.MTLVisibleFunctionTableWrapper.get_IsAliasable": + case "Metal.MTLVisibleFunctionTableWrapper.get_Label": + case "Metal.MTLVisibleFunctionTableWrapper.get_ResourceOptions": + case "Metal.MTLVisibleFunctionTableWrapper.get_StorageMode": + case "Metal.MTLVisibleFunctionTableWrapper.HazardTrackingMode": + case "Metal.MTLVisibleFunctionTableWrapper.Heap": + case "Metal.MTLVisibleFunctionTableWrapper.HeapOffset": + case "Metal.MTLVisibleFunctionTableWrapper.IsAliasable": + case "Metal.MTLVisibleFunctionTableWrapper.ResourceOptions": + case "Metal.MTLVisibleFunctionTableWrapper.set_Label": + case "WebKit.WKPreviewActionItemWrapper.get_Title": + return true; + } + // Generator Bug/Limitation - Also related to 2 ^, this time with catagories + switch (member) { + case "AVFoundation.AVMovie_AVMovieTrackInspection.LoadTrack": + case "AVFoundation.AVMovie_AVMovieTrackInspection.LoadTrackAsync": + case "AVFoundation.AVMovie_AVMovieTrackInspection.LoadTracksWithMediaCharacteristic": + case "AVFoundation.AVMovie_AVMovieTrackInspection.LoadTracksWithMediaCharacteristicAsync": + case "AVFoundation.AVMovie_AVMovieTrackInspection.LoadTracksWithMediaType": + case "AVFoundation.AVMovie_AVMovieTrackInspection.LoadTracksWithMediaTypeAsync": + case "AVFoundation.AVMutableMovie.LoadTrack": + case "AVFoundation.AVMutableMovie.LoadTrackAsync": + case "AVFoundation.AVMutableMovie.LoadTracksWithMediaCharacteristic": + case "AVFoundation.AVMutableMovie.LoadTracksWithMediaCharacteristicAsync": + case "AVFoundation.AVMutableMovie.LoadTracksWithMediaType": + case "AVFoundation.AVMutableMovie.LoadTracksWithMediaTypeAsync": + return true; + } + + // Generator Bug/Limitation - Conditional protocol inclusion (NSItemProviderReading, NSItemProviderWriting, NSCoding, NSProgressReporting) + if (member.EndsWith ("GetItemProviderVisibilityForTypeIdentifier") || + member.EndsWith ("GetObject") || + member.EndsWith ("LoadData") || + member.EndsWith ("LoadDataAsync") || + member.EndsWith ("get_ReadableTypeIdentifiers") || + member.EndsWith ("get_WritableTypeIdentifiers") || + member.EndsWith ("get_WritableTypeIdentifiersForItemProvider") || + member.EndsWith ("ReadableTypeIdentifiers") || + member.EndsWith ("WritableTypeIdentifiers") || + member.EndsWith ("WritableTypeIdentifiersForItemProvider") || + member.EndsWith ("get_Progress") || + member.EndsWith ("EncodeTo")) { + return true; + } + // Generator Limitation - Conditional Abstract + switch (member) { + case "PassKit.PKPaymentAuthorizationControllerDelegate_Extensions.GetPresentationWindow": + case "PassKit.IPKPaymentAuthorizationControllerDelegate.GetPresentationWindow": + return true; + } + return false; + } + + static string GetMemberLookupKey (IMemberDefinition member) + { + // Members of xkit and other places conditionally inline and include members in one of two namespaces + // based upon platform assembly. Cludge them to the same key, so we don't mistakenly think members are missing + // from some platforms + return $"{member.DeclaringType.FullName}.{member.Name}".Replace("AppKit", "Kit").Replace("UIKit", "Kit"); + } + + IEnumerable GetAllTypeMembers (TypeDefinition type) + { + foreach (var method in type.Methods.Where (m => m.IsPublic)) { + yield return method; + } + foreach (var field in type.Fields.Where (f => f.IsPublic)) { + yield return field; + } + foreach (var prop in type.Properties.Where (p => p.GetMethod?.IsPublic == true || p.SetMethod?.IsPublic == true)) { + yield return prop; + } + foreach (var e in type.Events) { + yield return e; } } @@ -153,8 +464,7 @@ void CheckAllPlatformsOnParent (ICustomAttributeProvider item, string fullName, // } // // When run against mac, this fails as Extension does not include a mac supported of any kind attribute - // XXX - This test is disabled until generator work is complete, as there are too many false positives - // [TestCaseSource (typeof (Helper), "NetPlatformAssemblies")] + [TestCaseSource (typeof (Helper), "NetPlatformAssemblies")] public void AllAttributedItemsMustIncludeCurrentPlatform (string assemblyPath) { var assembly = Helper.GetAssembly (assemblyPath); @@ -163,36 +473,31 @@ public void AllAttributedItemsMustIncludeCurrentPlatform (string assemblyPath) return; } -#if DEBUG - Console.WriteLine(assemblyPath); -#endif + if (!assemblyPath.Contains("Xamarin.Mac.dll")) { + return; + } string platformName = AssemblyToAttributeName (assemblyPath); HashSet found = new HashSet (); - foreach (var type in Helper.FilterTypes (assembly, a => HasAnyAvailabilityAttribute (a, includeUnsupported: true))) { + foreach (var type in Helper.FilterTypes (assembly, a => HasAnyAvailabilityAttribute (a))) { CheckCurrentPlatformIncludedIfAny (type, platformName, type.FullName, type.DeclaringType, found); } - foreach (var prop in Helper.FilterProperties (assembly, a => HasAnyAvailabilityAttribute (a, includeUnsupported: true))) { + foreach (var prop in Helper.FilterProperties (assembly, a => HasAnyAvailabilityAttribute (a))) { CheckCurrentPlatformIncludedIfAny (prop, platformName, prop.FullName, prop.DeclaringType, found); } - foreach (var meth in Helper.FilterMethods (assembly, a => HasAnyAvailabilityAttribute (a, includeUnsupported: true))) { + foreach (var meth in Helper.FilterMethods (assembly, a => HasAnyAvailabilityAttribute (a))) { CheckCurrentPlatformIncludedIfAny (meth, platformName, meth.FullName, meth.DeclaringType, found); } - foreach (var field in Helper.FilterFields (assembly, a => HasAnyAvailabilityAttribute (a, includeUnsupported: true))) { + foreach (var field in Helper.FilterFields (assembly, a => HasAnyAvailabilityAttribute (a))) { CheckCurrentPlatformIncludedIfAny (field, platformName, field.FullName, field.DeclaringType, found); } - - Assert.That (found, Is.Empty); + Assert.That (found, Is.Empty, $"{found.Count} issues found"); } void CheckCurrentPlatformIncludedIfAny (ICustomAttributeProvider item, string platformName, string fullName, TypeDefinition parent, HashSet found) { - if (Ignore (fullName)) { - return; - } - - if (HasAnyAvailabilityAttribute (item, true)) { + if (HasAnyAvailabilityAttribute (item)) { var supportedAttributes = item.CustomAttributes.Where (a => IsSupportedAttribute (a)); if (!supportedAttributes.Any (a => FindAvailabilityKind (a) == platformName)) { #if DEBUG @@ -226,78 +531,22 @@ void DebugPrint (string fullName, IEnumerable parentAvailability, IEnume Console.WriteLine (); } - bool Ignore (string fullName) - { - string ns; - if (fullName.Split (' ').Length < 2) { - ns = fullName.Split ('.').First (); - } - else { - // Skip the return type, then split namespace off - ns = fullName.Split (' ') [1].Split ('.').First (); - } - switch (ns) { - case "Security": - case "CoreMedia": - case "CoreText": - return true; - } - switch (fullName) { - // Generated code DictionaryContainer - case "System.String StoreKit.StoreProductParameters::ProductIdentifier()": - case "System.Nullable`1 AVFoundation.AVAssetDownloadOptions::MediaSelectionPrefersMultichannel()": - case "System.Nullable`1 AVFoundation.AVAssetDownloadOptions::PrefersHdr()": - case "System.Nullable`1 AVFoundation.AVAssetDownloadOptions::MinimumRequiredPresentationSize()": - case "Foundation.NSData VideoToolbox.VTCompressionProperties::ContentLightLevelInfo()": - case "Foundation.NSData VideoToolbox.VTCompressionProperties::MasteringDisplayColorVolume()": - case "Foundation.NSUuid StoreKit.StoreProductParameters::AdNetworkNonce()": - case "System.Nullable`1 CoreImage.CIImageInitializationOptions::ApplyOrientationProperty()": - case "System.Nullable`1 CoreImage.CIImageInitializationOptions::AuxiliaryDepth()": - case "System.Nullable`1 CoreImage.CIImageInitializationOptions::AuxiliaryDisparity()": - case "System.Nullable`1 CoreImage.CIImageInitializationOptions::AuxiliaryPortraitEffectsMatte()": - case "System.Nullable`1 CoreImage.CIImageInitializationOptions::AuxiliarySemanticSegmentationGlassesMatte()": - case "System.Nullable`1 CoreImage.CIImageInitializationOptions::AuxiliarySemanticSegmentationHairMatte()": - case "System.Nullable`1 CoreImage.CIImageInitializationOptions::AuxiliarySemanticSegmentationSkinMatte()": - case "System.Nullable`1 CoreImage.CIImageInitializationOptions::AuxiliarySemanticSegmentationTeethMatte()": - case "System.Nullable`1 CoreImage.CIImageInitializationOptions::NearestSampling()": - case "System.Nullable`1 CoreImage.CIImageInitializationOptions::ToneMapHdrToSdr()": - case "System.Nullable`1 SceneKit.SCNSceneLoadingOptions::ConvertToYUp()": - case "System.Nullable`1 VideoToolbox.VTCompressionProperties::AllowOpenGop()": - case "System.Nullable`1 VideoToolbox.VTCompressionProperties::MaximizePowerEfficiency()": - case "System.Nullable`1 VideoToolbox.VTDecompressionProperties::MaximizePowerEfficiency()": - case "System.Nullable`1 VideoToolbox.VTPixelTransferProperties::RealTime()": - case "System.Nullable`1 VideoToolbox.VTCompressionProperties::BaseLayerFrameRate()": - case "System.Nullable`1 VideoToolbox.VTCompressionProperties::GammaLevel()": - case "System.Nullable`1 VideoToolbox.VTDecompressionProperties::TemporalLevelLimit()": - case "System.Nullable`1 SceneKit.SCNSceneLoadingOptions::ConvertUnitsToMeters()": - case "System.Nullable`1 VideoToolbox.VTCompressionProperties::TargetQualityForAlpha()": - case "System.Nullable`1 StoreKit.StoreProductParameters::AdNetworkCampaignIdentifier()": - case "System.Nullable`1 StoreKit.StoreProductParameters::AdNetworkTimestamp()": - case "System.Nullable`1 VideoToolbox.VTCompressionProperties::UsingGpuRegistryId()": - case "System.Nullable`1 VideoToolbox.VTDecompressionProperties::UsingGpuRegistryId()": - case "System.String StoreKit.StoreProductParameters::AdNetworkAttributionSignature()": - case "System.String StoreKit.StoreProductParameters::AdNetworkIdentifier()": - case "System.String StoreKit.StoreProductParameters::AdNetworkSourceAppStoreIdentifier()": - case "System.String StoreKit.StoreProductParameters::AdNetworkVersion()": - case "System.String VideoToolbox.VTCompressionProperties::EncoderId()": - return true; - default: - return false; - } - } - bool FirstContainsAllOfSecond (IEnumerable first, IEnumerable second) { var firstSet = new HashSet (first); return second.All (s => firstSet.Contains (s)); } - IEnumerable GetAvailabilityAttributes (ICustomAttributeProvider provider, bool includeUnsupported) => GetAvailabilityAttributes (provider.CustomAttributes, includeUnsupported); + IEnumerable GetAvailabilityAttributes (ICustomAttributeProvider provider) => GetAvailabilityAttributes (provider.CustomAttributes); + IEnumerable GetAvailabilityAttributes (IEnumerable attributes) => GetAvailabilityAttributesCore (attributes, IsAvailabilityAttribute); + + IEnumerable GetSupportedAvailabilityAttributes (ICustomAttributeProvider provider) => GetSupportedAvailabilityAttributes (provider.CustomAttributes); + IEnumerable GetSupportedAvailabilityAttributes (IEnumerable attributes) => GetAvailabilityAttributesCore (attributes, IsSupportedAttribute); - IEnumerable GetAvailabilityAttributes (IEnumerable attributes, bool includeUnsupported) + IEnumerable GetAvailabilityAttributesCore (IEnumerable attributes, Func filter) { - var availability = new List (); - foreach (var attribute in attributes.Where (a => IsAvailabilityAttribute (a, includeUnsupported))) { + var availability = new HashSet (); + foreach (var attribute in attributes.Where (a => filter (a))) { var kind = FindAvailabilityKind (attribute); if (kind is not null) { availability.Add (kind); @@ -306,18 +555,6 @@ IEnumerable GetAvailabilityAttributes (IEnumerable attr return availability; } - bool HasCodegenAttribute (ICustomAttributeProvider provider) - { - // get/set don't have BindingImpl directly, it is on the parent context - if (provider is MethodDefinition method) { - var property = method.DeclaringType.Properties.FirstOrDefault (v => method.Name.Length > 4 && v.Name == method.Name.Substring (4)); - if (property != null && property.CustomAttributes.Any (HasGeneratedCodeAttribute)) { - return true; - } - } - return provider.CustomAttributes.Any (HasGeneratedCodeAttribute); - } - string? FindAvailabilityKind (CustomAttribute attribute) { if (attribute.ConstructorArguments.Count == 1 && attribute.ConstructorArguments [0].Type.Name == "String") { @@ -325,13 +562,13 @@ bool HasCodegenAttribute (ICustomAttributeProvider provider) switch (full) { case string s when full.StartsWith ("ios", StringComparison.Ordinal): return "ios"; - case string s when full.StartsWith ("tvos"): + case string s when full.StartsWith ("tvos", StringComparison.Ordinal): return "tvos"; - case string s when full.StartsWith ("macos"): + case string s when full.StartsWith ("macos", StringComparison.Ordinal): return "macos"; - case string s when full.StartsWith ("maccatalyst"): + case string s when full.StartsWith ("maccatalyst", StringComparison.Ordinal): return "maccatalyst"; - case string s when full.StartsWith ("watchos"): + case string s when full.StartsWith ("watchos", StringComparison.Ordinal): return null; // WatchOS is ignored for comparision default: throw new System.NotImplementedException ($"Unknown platform kind: {full}"); @@ -340,25 +577,10 @@ bool HasCodegenAttribute (ICustomAttributeProvider provider) return null; } - bool HasAnyAvailabilityAttribute (ICustomAttributeProvider provider, bool includeUnsupported) - { - return provider.CustomAttributes.Any (a => IsAvailabilityAttribute (a, includeUnsupported)); - } - - bool IsAvailabilityAttribute (CustomAttribute attribute, bool includeUnsupported) - { - return IsSupportedAttribute (attribute) || - (includeUnsupported && attribute.AttributeType.Name == "UnsupportedOSPlatformAttribute"); - } - + bool HasAnyAvailabilityAttribute (ICustomAttributeProvider provider) => provider.CustomAttributes.Any (a => IsAvailabilityAttribute (a)); + bool HasAnySupportedAttribute (ICustomAttributeProvider provider) => provider.CustomAttributes.Any (a => IsSupportedAttribute (a)); + + bool IsAvailabilityAttribute (CustomAttribute attribute) => IsSupportedAttribute (attribute) || attribute.AttributeType.Name == "UnsupportedOSPlatformAttribute"; bool IsSupportedAttribute (CustomAttribute attribute) => attribute.AttributeType.Name == "SupportedOSPlatformAttribute"; - bool HasGeneratedCodeAttribute (CustomAttribute attribute) - { - // There is no one attribute that marks code as generate touched - // But these are a good coverage, and rarely if ever used - // in hand-written code. This is all temporary anyway. - return attribute.AttributeType.Name == "BindingImplAttribute" || - attribute.AttributeType.Name == "FieldAttribute"; - } } } From 871aada315e271077d8a498699d9e5ee2d3d31ac Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Tue, 19 Apr 2022 14:04:58 -0500 Subject: [PATCH 03/19] API corrections found by new test --- src/ARKit/ARSkeleton.cs | 2 + src/AVFoundation/AVTypes.cs | 6 - src/AVFoundation/AVVideoSettings.cs | 8 +- src/AVFoundation/Enums.cs | 1 + src/AppKit/NSAccessibility.cs | 5 - src/AudioUnit/AUParameter.cs | 9 - src/AudioUnit/AudioComponent.cs | 12 +- src/AudioUnit/AudioComponentDescription.cs | 14 +- src/AudioUnit/AudioUnit.cs | 10 +- src/CoreGraphics/CGImage.cs | 12 +- src/CoreGraphics/CGVector.cs | 8 +- src/CoreImage/CIContext.cs | 2 +- src/CoreLocation/CoreLocation.cs | 4 +- src/CoreMedia/CMMemoryPool.cs | 8 - src/CoreMedia/CMSampleBuffer.cs | 2 +- src/CoreSpotlight/CSEnums.cs | 1 - src/CoreText/CTFontManager.cs | 6 +- src/CoreVideo/CVImageBuffer.cs | 6 +- src/CoreVideo/CVMetalTextureCache.cs | 10 - src/CoreVideo/CVPixelBufferAttributes.cs | 2 +- src/CoreWlan/CWKeychain.cs | 67 ++-- src/Foundation/Enum.cs | 6 +- src/Foundation/NSAttributedString.iOS.cs | 2 +- src/Foundation/NSMetadataItem.cs | 306 +++++++++--------- src/GLKit/GLTextureLoader.cs | 4 +- src/HomeKit/HMCharacteristicMetadata.cs | 7 - src/HomeKit/HMEnums.cs | 1 + src/HomeKit/HMHome.cs | 7 - src/HomeKit/HMService.cs | 7 - src/ImageIO/CGImageSource.iOS.cs | 8 +- src/Metal/MTLDevice.cs | 28 +- src/Metal/MTLEnums.cs | 8 +- .../MTLRasterizationRateLayerDescriptor.cs | 6 +- src/Metal/MTLResourceStateCommandEncoder.cs | 2 +- src/ModelIO/MDLMesh.cs | 6 - src/Network/NWParameters.cs | 4 +- src/NetworkExtension/NEEnums.cs | 3 + src/NetworkExtension/NEVpnManager.cs | 4 +- src/OpenGLES/EAGLContext.cs | 4 +- src/PhotosUI/PHEnums.cs | 2 + src/SceneKit/SCNRenderingOptions.cs | 9 - src/Security/Certificate.cs | 16 +- src/Security/Items.cs | 7 +- src/StoreKit/NativeMethods.cs | 6 - src/VideoToolbox/VTUtilities.cs | 4 +- src/appkit.cs | 14 +- src/avfoundation.cs | 14 +- src/contactsui.cs | 56 ++-- src/coreanimation.cs | 3 +- src/coreaudiokit.cs | 4 + src/coreimage.cs | 5 +- src/corespotlight.cs | 2 +- src/foundation.cs | 2 + src/intents.cs | 54 ++-- src/metal.cs | 24 +- src/networkextension.cs | 5 +- src/opengles.cs | 1 + src/scenekit.cs | 3 + src/tvuikit.cs | 2 + src/uikit.cs | 13 +- src/usernotifications.cs | 2 +- src/xkit.cs | 50 ++- 62 files changed, 464 insertions(+), 442 deletions(-) diff --git a/src/ARKit/ARSkeleton.cs b/src/ARKit/ARSkeleton.cs index 8c1867a22506..5ba02edf12d2 100644 --- a/src/ARKit/ARSkeleton.cs +++ b/src/ARKit/ARSkeleton.cs @@ -12,6 +12,7 @@ public partial class ARSkeleton { #if NET [SupportedOSPlatform ("ios14.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [iOS (14,0)] #endif @@ -20,6 +21,7 @@ public partial class ARSkeleton { #if NET [SupportedOSPlatform ("ios14.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [iOS (14,0)] #endif diff --git a/src/AVFoundation/AVTypes.cs b/src/AVFoundation/AVTypes.cs index d5252f8d9f3a..40d8df4dc166 100644 --- a/src/AVFoundation/AVTypes.cs +++ b/src/AVFoundation/AVTypes.cs @@ -273,12 +273,6 @@ public override int GetHashCode () } } -#if NET - [SupportedOSPlatform ("ios8.0")] - [SupportedOSPlatform ("macos10.10")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] -#endif #if !COREBUILD public static partial class AVMetadataIdentifiers { } diff --git a/src/AVFoundation/AVVideoSettings.cs b/src/AVFoundation/AVVideoSettings.cs index 0138ab170eee..9567d0d2b419 100644 --- a/src/AVFoundation/AVVideoSettings.cs +++ b/src/AVFoundation/AVVideoSettings.cs @@ -241,7 +241,7 @@ public double? MaxKeyFrameIntervalDuration { [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] - [SupportedOSPlatform ("macos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (7,0)] #endif @@ -257,8 +257,8 @@ public bool? AllowFrameReordering { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (7,0)] #endif @@ -300,8 +300,8 @@ public AVVideoH264EntropyMode? EntropyEncoding { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (7,0)] #endif @@ -318,8 +318,8 @@ public float? ExpectedSourceFrameRate { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (7,0)] #endif diff --git a/src/AVFoundation/Enums.cs b/src/AVFoundation/Enums.cs index 0aad58873f95..2ff8cbd337c7 100644 --- a/src/AVFoundation/Enums.cs +++ b/src/AVFoundation/Enums.cs @@ -650,6 +650,7 @@ public enum AVCaptureAutoFocusSystem : long { [NoWatch] [iOS (9, 0)] [Native] + [NoMac] public enum AVCaptureSessionInterruptionReason : long { VideoDeviceNotAvailableInBackground = 1, AudioDeviceInUseByAnotherClient = 2, diff --git a/src/AppKit/NSAccessibility.cs b/src/AppKit/NSAccessibility.cs index f9228be4c09b..8c5383f24f0c 100644 --- a/src/AppKit/NSAccessibility.cs +++ b/src/AppKit/NSAccessibility.cs @@ -19,11 +19,6 @@ namespace AppKit { -#if NET - [SupportedOSPlatform ("macos10.10")] -#else - [Mac (10,10)] // protocol added in 10.10 -#endif public partial interface INSAccessibility {} #if NET diff --git a/src/AudioUnit/AUParameter.cs b/src/AudioUnit/AUParameter.cs index 7657702b0607..57ecfacd075f 100644 --- a/src/AudioUnit/AUParameter.cs +++ b/src/AudioUnit/AUParameter.cs @@ -6,15 +6,6 @@ namespace AudioUnit { -#if NET - [SupportedOSPlatform ("ios9.0")] - [SupportedOSPlatform ("macos10.11")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] -#else - [iOS (9,0)] - [Mac (10,11)] -#endif public partial class AUParameter { public string GetString (float? value) diff --git a/src/AudioUnit/AudioComponent.cs b/src/AudioUnit/AudioComponent.cs index c28d82c36328..13e772338da1 100644 --- a/src/AudioUnit/AudioComponent.cs +++ b/src/AudioUnit/AudioComponent.cs @@ -392,9 +392,9 @@ public Version? Version { #if !__MACCATALYST__ #if NET [SupportedOSPlatform ("ios7.0")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("tvos14.0")] [UnsupportedOSPlatform ("ios14.0")] #if TVOS @@ -412,9 +412,9 @@ public Version? Version { #if NET [SupportedOSPlatform ("ios7.0")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("tvos14.0")] [UnsupportedOSPlatform ("ios14.0")] #if TVOS @@ -436,11 +436,11 @@ public Version? Version { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst14.0")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("maccatalyst14.0")] [UnsupportedOSPlatform ("ios13.0")] + [UnsupportedOSPlatform ("macos")] #if TVOS [Obsolete ("Starting with tvos13.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif __MACCATALYST__ @@ -461,11 +461,11 @@ public Version? Version { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst14.0")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("maccatalyst14.0")] [UnsupportedOSPlatform ("ios13.0")] + [UnsupportedOSPlatform ("macos")] #if TVOS [Obsolete ("Starting with tvos13.0 use 'AudioUnit' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif __MACCATALYST__ diff --git a/src/AudioUnit/AudioComponentDescription.cs b/src/AudioUnit/AudioComponentDescription.cs index 9e17d63d9bbb..6c03eaa2047f 100644 --- a/src/AudioUnit/AudioComponentDescription.cs +++ b/src/AudioUnit/AudioComponentDescription.cs @@ -148,8 +148,8 @@ public enum AudioTypeConverter { // OSType in AudioComponentDescription #if NET [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] #if TVOS @@ -210,10 +210,10 @@ public enum AudioTypeEffect { // OSType in AudioComponentDescription #else #if NET [SupportedOSPlatform ("ios")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] + [UnsupportedOSPlatform ("macos")] #if TVOS [Obsolete ("Starting with tvos13.0 use 'AudioTypeEffect.GraphicEQ' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS @@ -248,10 +248,10 @@ public enum AudioTypeMixer { // OSType in AudioComponentDescription #if MONOMAC Stereo=0x736d7872, // 'smxr' #if NET - [SupportedOSPlatform ("ios")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("tvos")] [SupportedOSPlatform ("macos")] - [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("macos10.10")] #if MONOMAC [Obsolete ("Starting with macos10.10 use 'Spacial' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] @@ -262,7 +262,11 @@ public enum AudioTypeMixer { // OSType in AudioComponentDescription ThreeD=0x33646d78, // '3dmx' #else #if NET + [SupportedOSPlatform ("ios")] [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #if IOS [Obsolete ("Starting with ios8.0 use 'Spacial' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif diff --git a/src/AudioUnit/AudioUnit.cs b/src/AudioUnit/AudioUnit.cs index cae4d9fe11fa..85e8172ad8e6 100644 --- a/src/AudioUnit/AudioUnit.cs +++ b/src/AudioUnit/AudioUnit.cs @@ -436,9 +436,9 @@ public uint GetCurrentDevice (AudioUnitScopeType scope, uint audioUnitElement = #endif #if NET [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("tvos")] [SupportedOSPlatform ("macos")] - [SupportedOSPlatform ("tvos")] #else [MacCatalyst (15,0)] #endif @@ -748,11 +748,11 @@ static AudioUnitStatus InputCallbackImpl (IntPtr clientData, ref AudioUnitRender #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst14.0")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("maccatalyst14.0")] [UnsupportedOSPlatform ("ios13.0")] + [UnsupportedOSPlatform ("macos")] #if TVOS [Obsolete ("Starting with tvos13.0 use 'AudioUnit' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif __MACCATALYST__ @@ -784,11 +784,11 @@ public AudioComponentStatus AudioOutputUnitPublish (AudioComponentDescription de #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst14.0")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("maccatalyst14.0")] [UnsupportedOSPlatform ("ios13.0")] + [UnsupportedOSPlatform ("macos")] #if TVOS [Obsolete ("Starting with tvos13.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif __MACCATALYST__ @@ -809,11 +809,11 @@ public AudioComponentStatus AudioOutputUnitPublish (AudioComponentDescription de #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst14.0")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("maccatalyst14.0")] [UnsupportedOSPlatform ("ios13.0")] + [UnsupportedOSPlatform ("macos")] #if TVOS [Obsolete ("Starting with tvos13.0 use 'AudioUnit' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif __MACCATALYST__ diff --git a/src/CoreGraphics/CGImage.cs b/src/CoreGraphics/CGImage.cs index b9e026f607ca..0ae0894fc118 100644 --- a/src/CoreGraphics/CGImage.cs +++ b/src/CoreGraphics/CGImage.cs @@ -244,9 +244,9 @@ public CGImage (int width, int height, int bitsPerComponent, int bitsPerPixel, i #if MONOMAC || __MACCATALYST__ #if NET [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("ios")] [SupportedOSPlatform ("macos")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("tvos")] #else [MacCatalyst (15,0)] #endif @@ -255,9 +255,9 @@ public CGImage (int width, int height, int bitsPerComponent, int bitsPerPixel, i #if NET [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("ios")] [SupportedOSPlatform ("macos")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("tvos")] #else [MacCatalyst (15,0)] #endif @@ -268,9 +268,9 @@ public CGImage (int width, int height, int bitsPerComponent, int bitsPerPixel, i #if NET [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("ios")] [SupportedOSPlatform ("macos")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("tvos")] #else [MacCatalyst (15,0)] #endif diff --git a/src/CoreGraphics/CGVector.cs b/src/CoreGraphics/CGVector.cs index a19e17d7fcdb..08926cd44343 100644 --- a/src/CoreGraphics/CGVector.cs +++ b/src/CoreGraphics/CGVector.cs @@ -85,8 +85,8 @@ public override bool Equals (object other) #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (8,0)] #endif @@ -96,8 +96,8 @@ public override bool Equals (object other) #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (8,0)] #endif @@ -109,8 +109,8 @@ public override string ToString () #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (8,0)] #endif @@ -120,8 +120,8 @@ public override string ToString () #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (8,0)] #endif diff --git a/src/CoreImage/CIContext.cs b/src/CoreImage/CIContext.cs index f65a1ea96343..03dde980269d 100644 --- a/src/CoreImage/CIContext.cs +++ b/src/CoreImage/CIContext.cs @@ -239,7 +239,7 @@ public static CIContext FromMetalDevice (IMTLDevice device, CIContextOptions? op #if MONOMAC #if NET - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("macos10.11")] #if MONOMAC diff --git a/src/CoreLocation/CoreLocation.cs b/src/CoreLocation/CoreLocation.cs index e0f439473a6c..33b7b493795b 100644 --- a/src/CoreLocation/CoreLocation.cs +++ b/src/CoreLocation/CoreLocation.cs @@ -82,9 +82,9 @@ public override string ToString () public partial class CLPlacemark { #if NET [SupportedOSPlatform ("ios10.0")] - [SupportedOSPlatform ("macos11.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (10, 0)] [Mac (11,0)] diff --git a/src/CoreMedia/CMMemoryPool.cs b/src/CoreMedia/CMMemoryPool.cs index 3ff490d28414..b2bbb2fb7d59 100644 --- a/src/CoreMedia/CMMemoryPool.cs +++ b/src/CoreMedia/CMMemoryPool.cs @@ -17,14 +17,6 @@ namespace CoreMedia { -#if NET - [SupportedOSPlatform ("ios")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] - [SupportedOSPlatform ("tvos")] -#else - [Watch (6,0)] -#endif public partial class CMMemoryPool : NativeObject { [DllImport(Constants.CoreMediaLibrary)] diff --git a/src/CoreMedia/CMSampleBuffer.cs b/src/CoreMedia/CMSampleBuffer.cs index 68ecf178c99a..ea535461d40b 100644 --- a/src/CoreMedia/CMSampleBuffer.cs +++ b/src/CoreMedia/CMSampleBuffer.cs @@ -986,8 +986,8 @@ public string? DroppedFrameReason { #if NET [SupportedOSPlatform ("ios9.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (9,0)] #endif diff --git a/src/CoreSpotlight/CSEnums.cs b/src/CoreSpotlight/CSEnums.cs index f7f356d0b3a5..72d1371d3a19 100644 --- a/src/CoreSpotlight/CSEnums.cs +++ b/src/CoreSpotlight/CSEnums.cs @@ -15,7 +15,6 @@ namespace CoreSpotlight { // NSInteger -> CNContact.h [NoTV] // CS_TVOS_UNAVAILABLE [iOS (9,0), Mac (10,11)] - [Mac (10,13)] [Native] [ErrorDomain ("CSIndexErrorDomain")] public enum CSIndexErrorCode : long { diff --git a/src/CoreText/CTFontManager.cs b/src/CoreText/CTFontManager.cs index 402a1ffd60c4..441a74d9f4fd 100644 --- a/src/CoreText/CTFontManager.cs +++ b/src/CoreText/CTFontManager.cs @@ -98,14 +98,14 @@ public partial class CTFontManager { static extern bool CTFontManagerIsSupportedFont (IntPtr url); #if NET - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("ios")] [SupportedOSPlatform ("macos")] - [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("macos10.6")] #if MONOMAC [Obsolete ("Starting with macos10.6.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif - [UnsupportedOSPlatform ("ios")] #else [Deprecated (PlatformName.MacOSX, 10, 6)] [Unavailable (PlatformName.iOS)] diff --git a/src/CoreVideo/CVImageBuffer.cs b/src/CoreVideo/CVImageBuffer.cs index 0a8e2beda678..df6a5c3d290a 100644 --- a/src/CoreVideo/CVImageBuffer.cs +++ b/src/CoreVideo/CVImageBuffer.cs @@ -100,14 +100,14 @@ public bool IsFlipped { extern static /* CGColorSpaceRef */ IntPtr CVImageBufferGetColorSpace (/* CVImageBufferRef */ IntPtr imageBuffer); #if NET - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("ios")] [SupportedOSPlatform ("macos")] - [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("macos10.4")] #if MONOMAC [Obsolete ("Starting with macos10.4.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif - [UnsupportedOSPlatform ("ios")] #else [Deprecated (PlatformName.MacOSX, 10, 4)] [Unavailable (PlatformName.iOS)] diff --git a/src/CoreVideo/CVMetalTextureCache.cs b/src/CoreVideo/CVMetalTextureCache.cs index 5f04d42492a7..9e2992935f22 100644 --- a/src/CoreVideo/CVMetalTextureCache.cs +++ b/src/CoreVideo/CVMetalTextureCache.cs @@ -25,16 +25,6 @@ namespace CoreVideo { -#if NET - [SupportedOSPlatform ("ios8.0")] - [SupportedOSPlatform ("macos10.15")] - [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("tvos")] -#else - [iOS (8,0)] - [Mac (10,15)] - [MacCatalyst (15,0)] -#endif public partial class CVMetalTextureCache : NativeObject { [DllImport (Constants.CoreVideoLibrary)] extern static int /* CVReturn = int32_t */ CVMetalTextureCacheCreate ( diff --git a/src/CoreVideo/CVPixelBufferAttributes.cs b/src/CoreVideo/CVPixelBufferAttributes.cs index a3c778fcdd5e..77c6d65e5ab4 100644 --- a/src/CoreVideo/CVPixelBufferAttributes.cs +++ b/src/CoreVideo/CVPixelBufferAttributes.cs @@ -210,8 +210,8 @@ public bool? OpenGLESCompatibility { #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (8,0)] #endif diff --git a/src/CoreWlan/CWKeychain.cs b/src/CoreWlan/CWKeychain.cs index b915c7eb9deb..b7ac401f09d2 100644 --- a/src/CoreWlan/CWKeychain.cs +++ b/src/CoreWlan/CWKeychain.cs @@ -18,16 +18,13 @@ namespace CoreWlan { #if NET - [SupportedOSPlatform ("maccatalyst15.0")] [SupportedOSPlatform ("macos")] -#else - [MacCatalyst (15,0)] #endif public static partial class CWKeychain { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -36,7 +33,7 @@ public static partial class CWKeychain { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -54,7 +51,7 @@ public static bool TryFindWiFiEAPIdentity (CWKeychainDomain domain, NSData ssid, #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -63,7 +60,7 @@ public static bool TryFindWiFiEAPIdentity (CWKeychainDomain domain, NSData ssid, #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -72,7 +69,7 @@ public static bool TryFindWiFiEAPIdentity (CWKeychainDomain domain, NSData ssid, #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -84,7 +81,7 @@ public static bool TryDeleteWiFiEAPUsernameAndPassword (CWKeychainDomain domain, #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -93,7 +90,7 @@ public static bool TryDeleteWiFiEAPUsernameAndPassword (CWKeychainDomain domain, #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -102,7 +99,7 @@ public static bool TryDeleteWiFiEAPUsernameAndPassword (CWKeychainDomain domain, #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -114,7 +111,7 @@ public static bool TryDeleteWiFiPassword (CWKeychainDomain domain, NSData ssid, #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -123,7 +120,7 @@ public static bool TryDeleteWiFiPassword (CWKeychainDomain domain, NSData ssid) #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -132,7 +129,7 @@ public static bool TryDeleteWiFiPassword (CWKeychainDomain domain, NSData ssid) #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -154,7 +151,7 @@ public static bool TryFindWiFiEAPUsernameAndPassword (CWKeychainDomain domain, N #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -163,7 +160,7 @@ public static bool TryFindWiFiEAPUsernameAndPassword (CWKeychainDomain domain, N #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -177,7 +174,7 @@ public static bool TryFindWiFiEAPUsernameAndPassword (CWKeychainDomain domain, N #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -186,7 +183,7 @@ public static bool TryFindWiFiEAPUsernameAndPassword (CWKeychainDomain domain, N #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -195,7 +192,7 @@ public static bool TryFindWiFiEAPUsernameAndPassword (CWKeychainDomain domain, N #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -212,7 +209,7 @@ public static bool TryFindWiFiPassword (CWKeychainDomain domain, NSData ssid, ou #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -221,7 +218,7 @@ public static bool TryFindWiFiPassword (CWKeychainDomain domain, NSData ssid, ou #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -234,7 +231,7 @@ public static bool TryFindWiFiPassword (CWKeychainDomain domain, NSData ssid, ou #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -243,7 +240,7 @@ public static bool TryFindWiFiPassword (CWKeychainDomain domain, NSData ssid, ou #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -252,7 +249,7 @@ public static bool TryFindWiFiPassword (CWKeychainDomain domain, NSData ssid, ou #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -264,7 +261,7 @@ public static bool TrySetWiFiEAPIdentity (CWKeychainDomain domain, NSData ssid, #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -273,7 +270,7 @@ public static bool TrySetWiFiEAPIdentity (CWKeychainDomain domain, NSData ssid, #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -282,7 +279,7 @@ public static bool TrySetWiFiEAPIdentity (CWKeychainDomain domain, NSData ssid, #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -294,7 +291,7 @@ public static bool TrySetWiFiEAPUsernameAndPassword (CWKeychainDomain domain, NS #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -303,7 +300,7 @@ public static bool TrySetWiFiEAPUsernameAndPassword (CWKeychainDomain domain, NS #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10, 9)] #endif @@ -319,7 +316,7 @@ public static bool TrySetWiFiEAPUsernameAndPassword (CWKeychainDomain domain, NS #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10, 9)] #endif @@ -328,7 +325,7 @@ public static bool TrySetWiFiEAPUsernameAndPassword (CWKeychainDomain domain, NS #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -337,7 +334,7 @@ public static bool TrySetWiFiEAPUsernameAndPassword (CWKeychainDomain domain, NS #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -349,7 +346,7 @@ public static bool TrySetWiFiPassword (CWKeychainDomain domain, NSData ssid, NSS #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -358,7 +355,7 @@ public static bool TrySetWiFiPassword (CWKeychainDomain domain, NSData ssid, NSS #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif @@ -372,7 +369,7 @@ public static bool TrySetWiFiPassword (CWKeychainDomain domain, NSData ssid, str #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,9)] #endif diff --git a/src/Foundation/Enum.cs b/src/Foundation/Enum.cs index 52119a78cb99..042afae5b8bb 100644 --- a/src/Foundation/Enum.cs +++ b/src/Foundation/Enum.cs @@ -77,6 +77,7 @@ public enum NSUrlCredentialPersistence : ulong { #if MONOMAC || !XAMCORE_3_0 + [NoiOS][NoTV][NoMacCatalyst] #if !NET [Native] public enum NSBundleExecutableArchitecture : long { @@ -87,7 +88,10 @@ public enum NSBundleExecutableArchitecture { PPC = 0x00000012, X86_64 = 0x01000007, PPC64 = 0x01000012, - [Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)] + [Mac (11,0)] +#if !XAMCORE_3_0 + [Watch (7,0), TV (14,0), iOS (14,0)] +#endif ARM64 = 0x0100000c, } #endif diff --git a/src/Foundation/NSAttributedString.iOS.cs b/src/Foundation/NSAttributedString.iOS.cs index c686d74b80ac..b1523f1db53d 100644 --- a/src/Foundation/NSAttributedString.iOS.cs +++ b/src/Foundation/NSAttributedString.iOS.cs @@ -285,7 +285,7 @@ public NSDictionary WeakDefaultAttributes { [SupportedOSPlatform ("macos10.15")] [SupportedOSPlatform ("ios13.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("tvos")] #else [Mac (10, 15)] [iOS (13, 0)] diff --git a/src/Foundation/NSMetadataItem.cs b/src/Foundation/NSMetadataItem.cs index 516a44c79c30..fedc292a9f21 100644 --- a/src/Foundation/NSMetadataItem.cs +++ b/src/Foundation/NSMetadataItem.cs @@ -93,7 +93,7 @@ public NSDate? FileSystemContentChangeDate { #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] #else [iOS (8,0)] @@ -108,7 +108,7 @@ public NSString? ContentType { #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] #else [iOS (8,0)] @@ -152,7 +152,7 @@ public bool UbiquitousItemHasUnresolvedConflicts { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] #else [iOS (7,0)] @@ -241,7 +241,7 @@ public double UbiquitousItemPercentUploaded { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] #else [iOS (7,0)] @@ -256,7 +256,7 @@ public NSError? UbiquitousItemDownloadingError { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] #else [iOS (7,0)] @@ -271,7 +271,7 @@ public NSError? UbiquitousItemUploadingError { #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("macos10.10")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] #else [iOS (8,0)] @@ -294,7 +294,7 @@ public bool UbiquitousItemDownloadRequested { #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("macos10.10")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] #else [iOS (8,0)] @@ -317,7 +317,7 @@ public bool UbiquitousItemIsExternalDocument { #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] #else [iOS (8,0)] @@ -332,7 +332,7 @@ public NSString? UbiquitousItemContainerDisplayName { #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] #else [iOS (8,0)] @@ -347,7 +347,7 @@ public NSUrl? UbiquitousItemUrlInLocalContainer { #if MONOMAC #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -364,7 +364,7 @@ public string? []? Keywords { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -381,7 +381,7 @@ public string? Title { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -398,7 +398,7 @@ public string? []? Authors { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -415,7 +415,7 @@ public string? []? Editors { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -432,7 +432,7 @@ public string? []? Participants { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -449,7 +449,7 @@ public string? []? Projects { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -466,7 +466,7 @@ public NSDate? DownloadedDate { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -483,7 +483,7 @@ public string? []? WhereFroms { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -500,7 +500,7 @@ public string? Comment { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -517,7 +517,7 @@ public string? Copyright { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -534,7 +534,7 @@ public NSDate? LastUsedDate { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -551,7 +551,7 @@ public NSDate? ContentCreationDate { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -568,7 +568,7 @@ public NSDate? ContentModificationDate { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -585,7 +585,7 @@ public NSDate? DateAdded { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -602,7 +602,7 @@ public double? DurationSeconds { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -619,7 +619,7 @@ public string? []? ContactKeywords { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -636,7 +636,7 @@ public string? Version { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -653,7 +653,7 @@ public nint? PixelHeight { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -670,7 +670,7 @@ public nint? PixelWidth { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -687,7 +687,7 @@ public nint? PixelCount { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -704,7 +704,7 @@ public string? ColorSpace { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -721,7 +721,7 @@ public nint? BitsPerSample { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -738,7 +738,7 @@ public bool? FlashOnOff { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -755,7 +755,7 @@ public double? FocalLength { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -772,7 +772,7 @@ public string? AcquisitionMake { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -789,7 +789,7 @@ public string? AcquisitionModel { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -806,7 +806,7 @@ public double? IsoSpeed { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -823,7 +823,7 @@ public nint? Orientation { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -840,7 +840,7 @@ public string? []? LayerNames { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -857,7 +857,7 @@ public double? WhiteBalance { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -874,7 +874,7 @@ public double? Aperture { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -891,7 +891,7 @@ public string? ProfileName { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -908,7 +908,7 @@ public nint? ResolutionWidthDpi { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -925,7 +925,7 @@ public nint? ResolutionHeightDpi { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -942,7 +942,7 @@ public nint? ExposureMode { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -959,7 +959,7 @@ public double? ExposureTimeSeconds { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -976,7 +976,7 @@ public string? ExifVersion { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -993,7 +993,7 @@ public string? CameraOwner { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1010,7 +1010,7 @@ public nint? FocalLength35mm { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1027,7 +1027,7 @@ public string? LensModel { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1044,7 +1044,7 @@ public string? ExifGpsVersion { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1061,7 +1061,7 @@ public double? Altitude { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1078,7 +1078,7 @@ public double? Latitude { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1095,7 +1095,7 @@ public double? Longitude { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1112,7 +1112,7 @@ public double? Speed { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1129,7 +1129,7 @@ public NSDate? Timestamp { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1146,7 +1146,7 @@ public double? GpsTrack { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1163,7 +1163,7 @@ public double? ImageDirection { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1180,7 +1180,7 @@ public string? NamedLocation { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1197,7 +1197,7 @@ public string? GpsStatus { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1214,7 +1214,7 @@ public string? GpsMeasureMode { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1231,7 +1231,7 @@ public double? GpsDop { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1248,7 +1248,7 @@ public string? GpsMapDatum { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1265,7 +1265,7 @@ public double? GpsDestLatitude { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1282,7 +1282,7 @@ public double? GpsDestLongitude { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1299,7 +1299,7 @@ public double? GpsDestBearing { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1316,7 +1316,7 @@ public double? GpsDestDistance { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1333,7 +1333,7 @@ public string? GpsProcessingMethod { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1350,7 +1350,7 @@ public string? GpsAreaInformation { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1367,7 +1367,7 @@ public NSDate? GpsDateStamp { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1384,7 +1384,7 @@ public double? GpsDifferental { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1401,7 +1401,7 @@ public string? []? Codecs { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1418,7 +1418,7 @@ public string? []? MediaTypes { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1435,7 +1435,7 @@ public bool? Streamable { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1452,7 +1452,7 @@ public nint? TotalBitRate { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1469,7 +1469,7 @@ public nint? VideoBitRate { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1486,7 +1486,7 @@ public nint? AudioBitRate { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1503,7 +1503,7 @@ public string? DeliveryType { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1520,7 +1520,7 @@ public string? Album { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1537,7 +1537,7 @@ public bool? HasAlphaChannel { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1554,7 +1554,7 @@ public bool? RedEyeOnOff { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1571,7 +1571,7 @@ public string? MeteringMode { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1588,7 +1588,7 @@ public double? MaxAperture { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1605,7 +1605,7 @@ public nint? FNumber { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1622,7 +1622,7 @@ public string? ExposureProgram { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1639,7 +1639,7 @@ public string? ExposureTimeString { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1656,7 +1656,7 @@ public string? Headline { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1673,7 +1673,7 @@ public string? Instructions { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1690,7 +1690,7 @@ public string? City { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1707,7 +1707,7 @@ public string? StateOrProvince { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1724,7 +1724,7 @@ public string? Country { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1741,7 +1741,7 @@ public string? TextContent { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1758,7 +1758,7 @@ public nint? AudioSampleRate { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1775,7 +1775,7 @@ public nint? AudioChannelCount { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1792,7 +1792,7 @@ public double? Tempo { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1809,7 +1809,7 @@ public string? KeySignature { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1826,7 +1826,7 @@ public string? TimeSignature { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1843,7 +1843,7 @@ public string? AudioEncodingApplication { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1860,7 +1860,7 @@ public string? Composer { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1877,7 +1877,7 @@ public string? Lyricist { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1894,7 +1894,7 @@ public nint? AudioTrackNumber { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1911,7 +1911,7 @@ public NSDate? RecordingDate { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1928,7 +1928,7 @@ public string? MusicalGenre { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1945,7 +1945,7 @@ public bool? IsGeneralMidiSequence { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1962,7 +1962,7 @@ public nint? RecordingYear { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1979,7 +1979,7 @@ public string? []? Organizations { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -1996,7 +1996,7 @@ public string? []? Languages { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2013,7 +2013,7 @@ public string? Rights { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2030,7 +2030,7 @@ public string? []? Publishers { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2047,7 +2047,7 @@ public string? []? Contributors { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2064,7 +2064,7 @@ public string? []? Coverage { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2081,7 +2081,7 @@ public string? Subject { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2098,7 +2098,7 @@ public string? Theme { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2115,7 +2115,7 @@ public string? Description { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2132,7 +2132,7 @@ public string? Identifier { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2149,7 +2149,7 @@ public string? []? Audiences { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2166,7 +2166,7 @@ public nint? NumberOfPages { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2183,7 +2183,7 @@ public double? PageWidth { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2200,7 +2200,7 @@ public double? PageHeight { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2217,7 +2217,7 @@ public string? SecurityMethod { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2234,7 +2234,7 @@ public string? Creator { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2251,7 +2251,7 @@ public string? []? EncodingApplications { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2268,7 +2268,7 @@ public NSDate? DueDate { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2285,7 +2285,7 @@ public double? StarRating { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2302,7 +2302,7 @@ public string? []? PhoneNumbers { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2319,7 +2319,7 @@ public string? []? EmailAddresses { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2336,7 +2336,7 @@ public string? []? InstantMessageAddresses { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2353,7 +2353,7 @@ public string? Kind { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2370,7 +2370,7 @@ public string? []? Recipients { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2387,7 +2387,7 @@ public string? FinderComment { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2404,7 +2404,7 @@ public string? []? Fonts { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2421,7 +2421,7 @@ public string? AppleLoopsRoot { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2438,7 +2438,7 @@ public string? AppleLoopsKeyFilterType { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2455,7 +2455,7 @@ public string? AppleLoopsLoopMode { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2472,7 +2472,7 @@ public string? []? AppleLoopDescriptors { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2489,7 +2489,7 @@ public string? MusicalInstrumentCategory { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2506,7 +2506,7 @@ public string? MusicalInstrumentName { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2523,7 +2523,7 @@ public string? CFBundleIdentifier { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2540,7 +2540,7 @@ public string? Information { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2557,7 +2557,7 @@ public string? Director { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2574,7 +2574,7 @@ public string? Producer { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2591,7 +2591,7 @@ public string? Genre { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2608,7 +2608,7 @@ public string? []? Performers { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2625,7 +2625,7 @@ public string? OriginalFormat { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2642,7 +2642,7 @@ public string? OriginalSource { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2659,7 +2659,7 @@ public string? []? AuthorEmailAddresses { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2676,7 +2676,7 @@ public string? []? RecipientEmailAddresses { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2693,7 +2693,7 @@ public string? []? AuthorAddresses { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2710,7 +2710,7 @@ public string? []? RecipientAddresses { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2727,7 +2727,7 @@ public bool? IsLikelyJunk { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2744,7 +2744,7 @@ public string? []? ExecutableArchitectures { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2761,7 +2761,7 @@ public string? ExecutablePlatform { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -2778,7 +2778,7 @@ public string? []? ApplicationCategories { #if NET [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else diff --git a/src/GLKit/GLTextureLoader.cs b/src/GLKit/GLTextureLoader.cs index 65ee494d83b4..9ea7b82ca59f 100644 --- a/src/GLKit/GLTextureLoader.cs +++ b/src/GLKit/GLTextureLoader.cs @@ -152,9 +152,9 @@ public void BeginLoadCubeMap (NSUrl filePath, GLKTextureOperations? textureOpera #if NET [SupportedOSPlatform ("ios")] - [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos12.0")] [UnsupportedOSPlatform ("macos10.14")] [UnsupportedOSPlatform ("ios12.0")] @@ -213,9 +213,9 @@ public bool? GrayscaleAsAlpha { #if NET [SupportedOSPlatform ("ios7.0")] - [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos12.0")] [UnsupportedOSPlatform ("macos10.14")] [UnsupportedOSPlatform ("ios12.0")] diff --git a/src/HomeKit/HMCharacteristicMetadata.cs b/src/HomeKit/HMCharacteristicMetadata.cs index ff5cc80cf02a..1c78e66c6d66 100644 --- a/src/HomeKit/HMCharacteristicMetadata.cs +++ b/src/HomeKit/HMCharacteristicMetadata.cs @@ -5,13 +5,6 @@ namespace HomeKit { -#if NET - [SupportedOSPlatform ("tvos10.0")] - [SupportedOSPlatform ("ios8.0")] -#else - [TV (10,0)] - [iOS (8,0)] -#endif public partial class HMCharacteristicMetadata { public HMCharacteristicMetadataUnits Units { diff --git a/src/HomeKit/HMEnums.cs b/src/HomeKit/HMEnums.cs index e4c722f585e1..09df05e46802 100644 --- a/src/HomeKit/HMEnums.cs +++ b/src/HomeKit/HMEnums.cs @@ -1072,6 +1072,7 @@ public enum HMAccessoryCategoryType { #if !WATCH && !TVOS [Obsolete ("Use 'GarageDoorOpener' instead.")] + [NoTV] DoorOpener = GarageDoorOpener, #endif diff --git a/src/HomeKit/HMHome.cs b/src/HomeKit/HMHome.cs index a8e44e515f70..e7d6db38ce65 100644 --- a/src/HomeKit/HMHome.cs +++ b/src/HomeKit/HMHome.cs @@ -6,13 +6,6 @@ namespace HomeKit { -#if NET - [SupportedOSPlatform ("ios8.0")] - [SupportedOSPlatform ("tvos10.0")] -#else - [iOS (8,0)] - [TV (10,0)] -#endif public partial class HMHome { public HMService [] GetServices (HMServiceType serviceTypes) diff --git a/src/HomeKit/HMService.cs b/src/HomeKit/HMService.cs index f4d2e4c56d45..c9c9df59a7fd 100644 --- a/src/HomeKit/HMService.cs +++ b/src/HomeKit/HMService.cs @@ -6,13 +6,6 @@ namespace HomeKit { -#if NET - [SupportedOSPlatform ("tvos10.0")] - [SupportedOSPlatform ("ios8.0")] -#else - [TV (10,0)] - [iOS (8,0)] -#endif public partial class HMService { #if !WATCH && !TVOS diff --git a/src/ImageIO/CGImageSource.iOS.cs b/src/ImageIO/CGImageSource.iOS.cs index 1c2f9619115b..90883a85ff53 100644 --- a/src/ImageIO/CGImageSource.iOS.cs +++ b/src/ImageIO/CGImageSource.iOS.cs @@ -29,8 +29,8 @@ public partial class CGImageSource { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (7,0)] #endif @@ -44,8 +44,8 @@ public partial class CGImageSource { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (7,0)] #endif @@ -59,8 +59,8 @@ public partial class CGImageSource { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (7,0)] #endif @@ -71,8 +71,8 @@ extern static void CGImageSourceRemoveCacheAtIndex (/* CGImageSourceRef __nonnul #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (7,0)] #endif diff --git a/src/Metal/MTLDevice.cs b/src/Metal/MTLDevice.cs index 617511057517..d0d76d36b1fb 100644 --- a/src/Metal/MTLDevice.cs +++ b/src/Metal/MTLDevice.cs @@ -64,9 +64,9 @@ public static IMTLDevice? SystemDefault { #if NET [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("macos10.11")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("tvos")] #else [MacCatalyst (15,0)] #endif @@ -75,9 +75,9 @@ public static IMTLDevice? SystemDefault { #if NET [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("macos10.11")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("tvos")] #else [MacCatalyst (15,0)] #endif @@ -95,9 +95,9 @@ public static IMTLDevice [] GetAllDevices () #if NET [SupportedOSPlatform ("macos10.13")] - [SupportedOSPlatform ("ios8.0")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10, 13)] #endif @@ -106,9 +106,9 @@ public static IMTLDevice [] GetAllDevices () #if NET [SupportedOSPlatform ("macos10.13")] - [SupportedOSPlatform ("ios8.0")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10, 13)] #endif @@ -155,9 +155,9 @@ public static unsafe void TrampolineNotificationHandler (IntPtr block, IntPtr de #if NET [SupportedOSPlatform ("macos10.13")] - [SupportedOSPlatform ("ios8.0")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10, 13)] #endif @@ -166,9 +166,9 @@ public static unsafe void TrampolineNotificationHandler (IntPtr block, IntPtr de #if NET [SupportedOSPlatform ("macos10.13")] - [SupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("ios")] [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10, 13)] [NoiOS] diff --git a/src/Metal/MTLEnums.cs b/src/Metal/MTLEnums.cs index dfb73d211eb2..7d7a74f0fed6 100644 --- a/src/Metal/MTLEnums.cs +++ b/src/Metal/MTLEnums.cs @@ -1283,7 +1283,7 @@ public enum MTLAccelerationStructureUsage : ulong { None = 0x0, Refit = (1uL << 0), PreferFastBuild = (1uL << 1), - [iOS (15,0), TV (15,0), MacCatalyst (15,0), Mac (12,0), NoWatch] + [iOS (15,0), MacCatalyst (15,0), Mac (12,0), NoWatch] ExtendedLimits = (1uL << 2), } @@ -1359,11 +1359,11 @@ public enum MTLIntersectionFunctionSignature : ulong { Instancing = (1uL << 0), TriangleData = (1uL << 1), WorldSpaceData = (1uL << 2), - [Mac (12,0), iOS (15,0), TV (15,0), MacCatalyst (15,0), NoWatch] + [Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoWatch] InstanceMotion = (1uL << 3), - [Mac (12,0), iOS (15,0), TV (15,0), MacCatalyst (15,0), NoWatch] + [Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoWatch] PrimitiveMotion = (1uL << 4), - [Mac (12,0), iOS (15,0), TV (15,0), MacCatalyst (15,0), NoWatch] + [Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoWatch] ExtendedLimits = (1uL << 5), } diff --git a/src/Metal/MTLRasterizationRateLayerDescriptor.cs b/src/Metal/MTLRasterizationRateLayerDescriptor.cs index e7635613ad26..2dddd2475c93 100644 --- a/src/Metal/MTLRasterizationRateLayerDescriptor.cs +++ b/src/Metal/MTLRasterizationRateLayerDescriptor.cs @@ -13,8 +13,8 @@ public partial class MTLRasterizationRateLayerDescriptor { #if NET [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("macos10.15.4")] [SupportedOSPlatform ("ios13.0")] + [UnsupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("tvos")] #else [MacCatalyst (15,0)] @@ -30,9 +30,9 @@ public double[] HorizontalSampleStorage { #if NET [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("macos10.15.4")] [SupportedOSPlatform ("ios13.0")] [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -47,9 +47,9 @@ public double[] VerticalSampleStorage { #if NET [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("macos10.15.4")] [SupportedOSPlatform ("ios13.0")] [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif diff --git a/src/Metal/MTLResourceStateCommandEncoder.cs b/src/Metal/MTLResourceStateCommandEncoder.cs index f359c1c5a5f2..9bf92db39258 100644 --- a/src/Metal/MTLResourceStateCommandEncoder.cs +++ b/src/Metal/MTLResourceStateCommandEncoder.cs @@ -19,7 +19,7 @@ namespace Metal { #if NET [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] + [UnsupportedOSPlatform ("macos")] #endif public static partial class MTLResourceStateCommandEncoder_Extensions { diff --git a/src/ModelIO/MDLMesh.cs b/src/ModelIO/MDLMesh.cs index 8a50fe951d88..5ce1335c009e 100644 --- a/src/ModelIO/MDLMesh.cs +++ b/src/ModelIO/MDLMesh.cs @@ -27,12 +27,6 @@ namespace ModelIO { -#if NET - [SupportedOSPlatform ("ios9.0")] - [SupportedOSPlatform ("macos10.11")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] -#endif partial class MDLMesh { public enum MDLMeshVectorType { diff --git a/src/Network/NWParameters.cs b/src/Network/NWParameters.cs index bc5041c958c9..50409d21e4e0 100644 --- a/src/Network/NWParameters.cs +++ b/src/Network/NWParameters.cs @@ -199,7 +199,7 @@ public unsafe static NWParameters CreateUdp (Action? configur #if MONOMAC #if NET [SupportedOSPlatform ("macos10.15")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -213,7 +213,7 @@ public unsafe static NWParameters CreateUdp (Action? configur #if NET [SupportedOSPlatform ("macos10.15")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else diff --git a/src/NetworkExtension/NEEnums.cs b/src/NetworkExtension/NEEnums.cs index ca0e8b4297ff..9e26df576bea 100644 --- a/src/NetworkExtension/NEEnums.cs +++ b/src/NetworkExtension/NEEnums.cs @@ -234,6 +234,7 @@ public enum NETunnelProviderRoutingMethod : long { } #if !MONOMAC + [NoMac] [iOS (9,0)] [Native] public enum NEHotspotHelperCommandType : long { @@ -246,6 +247,7 @@ public enum NEHotspotHelperCommandType : long { Logoff = 6 } + [NoMac] [iOS (9,0)] [Native] public enum NEHotspotHelperConfidence : long { @@ -254,6 +256,7 @@ public enum NEHotspotHelperConfidence : long { High = 2 } + [NoMac] [iOS (9,0)] [Native] public enum NEHotspotHelperResult : long { diff --git a/src/NetworkExtension/NEVpnManager.cs b/src/NetworkExtension/NEVpnManager.cs index c45ce4f8acbe..1e118f8b332e 100644 --- a/src/NetworkExtension/NEVpnManager.cs +++ b/src/NetworkExtension/NEVpnManager.cs @@ -20,8 +20,8 @@ public partial class NEVpnManager { #if NET [SupportedOSPlatform ("macos10.11")] - [SupportedOSPlatform ("ios8.0")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("maccatalyst")] #else [Mac (10,11)] #endif diff --git a/src/OpenGLES/EAGLContext.cs b/src/OpenGLES/EAGLContext.cs index 47df971a8b7c..986437292b57 100644 --- a/src/OpenGLES/EAGLContext.cs +++ b/src/OpenGLES/EAGLContext.cs @@ -24,7 +24,7 @@ public EAGLContext () #if NET [SupportedOSPlatform ("ios10.0")] [SupportedOSPlatform ("tvos10.0")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos12.0")] [UnsupportedOSPlatform ("ios12.0")] #if TVOS @@ -44,7 +44,7 @@ public virtual bool PresentRenderBuffer (nuint target, double presentationTime) #if NET [SupportedOSPlatform ("ios10.3")] [SupportedOSPlatform ("tvos10.2")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos12.0")] [UnsupportedOSPlatform ("ios12.0")] #if TVOS diff --git a/src/PhotosUI/PHEnums.cs b/src/PhotosUI/PHEnums.cs index f8da54d2d034..99691865c3ff 100644 --- a/src/PhotosUI/PHEnums.cs +++ b/src/PhotosUI/PHEnums.cs @@ -16,6 +16,7 @@ public enum PHLivePhotoViewPlaybackStyle : long } #if MONOMAC + [NoiOS][NoTV][NoMacCatalyst] [Mac (10,12)] [Native] public enum PHLivePhotoViewContentMode : long { @@ -23,6 +24,7 @@ public enum PHLivePhotoViewContentMode : long { AspectFill, } #else + [NoMac] [TV (10,0)] [iOS (9,1)] [Native] diff --git a/src/SceneKit/SCNRenderingOptions.cs b/src/SceneKit/SCNRenderingOptions.cs index c962deca7374..eec7162cba6a 100644 --- a/src/SceneKit/SCNRenderingOptions.cs +++ b/src/SceneKit/SCNRenderingOptions.cs @@ -7,15 +7,6 @@ namespace SceneKit { -#if NET - [SupportedOSPlatform ("ios9.0")] - [SupportedOSPlatform ("macos10.11")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] -#else - [iOS (9,0)] - [Mac (10,11)] -#endif public partial class SCNRenderingOptions { public SCNRenderingApi? RenderingApi { get { diff --git a/src/Security/Certificate.cs b/src/Security/Certificate.cs index b056cea711b5..81208e0f5232 100644 --- a/src/Security/Certificate.cs +++ b/src/Security/Certificate.cs @@ -227,11 +227,11 @@ internal static bool Equals (SecCertificate first, SecCertificate second) extern static /* CFDictionaryRef */ IntPtr SecCertificateCopyValues (/* SecCertificateRef */ IntPtr certificate, /* CFArrayRef */ IntPtr keys, /* CFErrorRef _Nullable * */ IntPtr error); #if NET - [SupportedOSPlatform ("ios")] - [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] - [SupportedOSPlatform ("tvos")] - [UnsupportedOSPlatform ("macos10.14")] + [UnsupportedOSPlatform ("ios")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] + [UnsupportedOSPlatform ("maccatalyst")] #if MONOMAC [Obsolete ("Starting with macos10.14 use 'GetKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif @@ -261,8 +261,8 @@ internal static bool Equals (SecCertificate first, SecCertificate second) #if NET [SupportedOSPlatform ("ios10.3")] [SupportedOSPlatform ("tvos10.3")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("tvos12.0")] [UnsupportedOSPlatform ("ios12.0")] #if TVOS @@ -283,8 +283,8 @@ internal static bool Equals (SecCertificate first, SecCertificate second) #if NET [SupportedOSPlatform ("ios10.3")] [SupportedOSPlatform ("tvos10.3")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("tvos12.0")] [UnsupportedOSPlatform ("ios12.0")] #if TVOS diff --git a/src/Security/Items.cs b/src/Security/Items.cs index e1156304d7fa..a34393d04609 100644 --- a/src/Security/Items.cs +++ b/src/Security/Items.cs @@ -846,6 +846,7 @@ public bool SynchronizableAny { [SupportedOSPlatform ("ios9.0")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("macos")] #else [iOS (9,0)] #endif @@ -861,7 +862,7 @@ public string? SyncViewHint { #if NET [SupportedOSPlatform ("ios9.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] + [UnsupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] #else [iOS (9,0)] @@ -1004,7 +1005,7 @@ public string? UseOperationPrompt { #if NET [SupportedOSPlatform ("ios8.0")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] + [UnsupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios9.0")] #if IOS @@ -1047,7 +1048,7 @@ public SecAuthenticationUI AuthenticationUI { [SupportedOSPlatform ("ios9.0")] [SupportedOSPlatform ("macos10.11")] [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("tvos")] #else [iOS (9, 0)] [Mac (10, 11)] diff --git a/src/StoreKit/NativeMethods.cs b/src/StoreKit/NativeMethods.cs index 6bea45c85c27..e4b66a76d312 100644 --- a/src/StoreKit/NativeMethods.cs +++ b/src/StoreKit/NativeMethods.cs @@ -4,12 +4,6 @@ namespace StoreKit { -#if NET - [SupportedOSPlatform ("ios7.0")] - [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("tvos")] -#endif partial class SKReceiptRefreshRequest { #if NET [SupportedOSPlatform ("ios7.1")] diff --git a/src/VideoToolbox/VTUtilities.cs b/src/VideoToolbox/VTUtilities.cs index e975bb6d0714..d5e40106e3b0 100644 --- a/src/VideoToolbox/VTUtilities.cs +++ b/src/VideoToolbox/VTUtilities.cs @@ -57,7 +57,7 @@ public static VTStatus ToCGImage (this CVPixelBuffer pixelBuffer, out CGImage? i #if NET [SupportedOSPlatform ("macos11.0")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else @@ -71,7 +71,7 @@ public static VTStatus ToCGImage (this CVPixelBuffer pixelBuffer, out CGImage? i #if NET [SupportedOSPlatform ("macos11.0")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("ios")] #else diff --git a/src/appkit.cs b/src/appkit.cs index a62839b99c17..5ad69cfaf8b6 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -251,6 +251,7 @@ interface NSAnimation : NSCoding, NSCopying { NSString TriggerOrderOut { get; } } + [NoiOS] [NoMacCatalyst] [BaseType (typeof (NSObject))] [Model] @@ -8615,6 +8616,7 @@ partial interface NSMenu : NSCoding, NSCopying, NSAccessibility, NSAccessibility interface INSMenuDelegate { } + [NoiOS] [NoMacCatalyst] [BaseType (typeof (NSObject))] [Model] @@ -11586,7 +11588,7 @@ partial interface NSPasteboard // NSPasteboard does _not_ implement NSPasteboard nint PrepareForNewContents (NSPasteboardContentsOptions options); } - [NoMacCatalyst] + [NoiOS][NoTV][NoMacCatalyst] #if !NET // A class that implements only NSPasteboardWriting does not make sense, it's // used to add pasteboard support to existing classes. @@ -11661,7 +11663,7 @@ interface NSPasteboardItemDataProvider { interface INSPasteboardReading {} interface INSPasteboardWriting {} - [NoMacCatalyst] + [NoMacCatalyst][NoTV][NoiOS] #if !NET [BaseType (typeof (NSObject))] // A class that implements only NSPasteboardReading does not make sense, it's @@ -19846,6 +19848,7 @@ interface NSTextInputClient bool DrawsVertically (nuint charIndex); } + [NoiOS] [NoMacCatalyst] [BaseType (typeof (NSTextDelegate))] [Model] @@ -24189,7 +24192,7 @@ public enum NSAccessibilityPriorityLevel : long // 10.9 for fields/notification but 10.10 for protocol // attributes added to both cases in NSAccessibility.cs - [NoMacCatalyst] + [NoMacCatalyst][NoiOS][NoTV] [Protocol] interface NSAccessibility { @@ -26099,7 +26102,7 @@ interface NSAccessibilityActions { } [Mac (10,10)] - [NoMacCatalyst] + [NoMacCatalyst][NoiOS][NoTV] [Protocol (Name = "NSAccessibilityElement")] // exists both as a type and a protocol in ObjC, Swift uses NSAccessibilityElementProtocol interface NSAccessibilityElementProtocol { [Abstract] @@ -26125,6 +26128,8 @@ interface NSAccessibilityGroup : NSAccessibilityElementProtocol { [Mac (10,10)] [NoMacCatalyst] + [NoiOS] + [NoTV] [Protocol] interface NSAccessibilityButton : NSAccessibilityElementProtocol { [Abstract] @@ -26604,6 +26609,7 @@ interface INSUserInterfaceValidations {} [Protocol] [Mac (10,11)] [NoMacCatalyst] + [NoiOS] interface NSUserInterfaceValidations { [Abstract] diff --git a/src/avfoundation.cs b/src/avfoundation.cs index b4928af53e71..b570ce6dc3c6 100644 --- a/src/avfoundation.cs +++ b/src/avfoundation.cs @@ -7596,17 +7596,17 @@ interface AVFragmentedMovie_AVFragmentedMovieTrackInspection AVFragmentedMovieTrack[] GetTracks (AVMediaCharacteristics mediaCharacteristic); [Async] - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Watch (8,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] [Export ("loadTrackWithTrackID:completionHandler:")] void LoadTrack (int trackId, Action completionHandler); [Async] - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Watch (8,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] [Export ("loadTracksWithMediaType:completionHandler:")] void LoadTracksWithMediaType (string mediaType, Action, NSError> completionHandler); [Async] - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Watch (8,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] [Export ("loadTracksWithMediaCharacteristic:completionHandler:")] void LoadTracksWithMediaCharacteristic (string mediaCharacteristic, Action, NSError> completionHandler); } @@ -9166,11 +9166,11 @@ interface AVCaptureConnection { [Export ("videoFieldMode")] AVVideoFieldMode VideoFieldMode { get; set; } - [iOS (11, 0), NoMac, TV (11, 0), NoWatch] + [iOS (11, 0), NoMac, NoWatch] [Export ("cameraIntrinsicMatrixDeliverySupported")] bool CameraIntrinsicMatrixDeliverySupported { [Bind ("isCameraIntrinsicMatrixDeliverySupported")] get; } - [iOS (11, 0), NoMac, TV (11, 0), NoWatch] + [iOS (11, 0), NoMac, NoWatch] [Export ("cameraIntrinsicMatrixDeliveryEnabled")] bool CameraIntrinsicMatrixDeliveryEnabled { [Bind ("isCameraIntrinsicMatrixDeliveryEnabled")] get; set; } @@ -13842,12 +13842,12 @@ interface AVAssetDownloadUrlSession { [return: NullAllowed] AVAssetDownloadTask GetAssetDownloadTask (AVUrlAsset urlAsset, string title, [NullAllowed] NSData artworkData, AVAssetDownloadOptions options); - [Mac (12,0), NoTV, NoWatch, iOS (11,0)] + [Mac (12,0), NoWatch, iOS (11,0)] [Export ("aggregateAssetDownloadTaskWithURLAsset:mediaSelections:assetTitle:assetArtworkData:options:")] [return: NullAllowed] AVAggregateAssetDownloadTask GetAssetDownloadTask (AVUrlAsset URLAsset, AVMediaSelection[] mediaSelections, string title, [NullAllowed] NSData artworkData, [NullAllowed] NSDictionary options); - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Watch (8,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] [Export ("assetDownloadTaskWithConfiguration:")] AVAssetDownloadTask GetAssetDownloadTask (AVAssetDownloadConfiguration downloadConfiguration); } diff --git a/src/contactsui.cs b/src/contactsui.cs index 8bf3b08edfaf..1dc158a36037 100644 --- a/src/contactsui.cs +++ b/src/contactsui.cs @@ -16,6 +16,8 @@ using AppKit; #else using UIKit; +using NSView = UIKit.UIView; +using NSRectEdge = Foundation.NSObject; #endif #if !NET @@ -25,7 +27,7 @@ namespace ContactsUI { #if !MONOMAC - [iOS (9,0)] + [iOS (9,0)][NoMac] [BaseType (typeof (UIViewController))] interface CNContactPickerViewController { [Export ("initWithNibName:bundle:")] @@ -56,6 +58,7 @@ interface CNContactPickerViewController { interface ICNContactPickerDelegate {} #if MONOMAC + [NoiOS][NoMacCatalyst][NoTV] [Mac (10,11)] [Protocol, Model] [BaseType (typeof(NSObject))] @@ -74,6 +77,7 @@ interface CNContactPickerDelegate void DidClose (CNContactPicker picker); } #else + [NoMac] [iOS (9,0)] [Protocol, Model] [BaseType (typeof (NSObject))] @@ -96,88 +100,97 @@ interface CNContactPickerDelegate { } #endif // MONOMAC -#if MONOMAC [Mac (10,11)] - [BaseType (typeof(NSViewController))] - interface CNContactViewController - { - [Export ("initWithNibName:bundle:")] - NativeHandle Constructor ([NullAllowed] string nibName, [NullAllowed] NSBundle bundle); - - [Static] - [Export ("descriptorForRequiredKeys")] - ICNKeyDescriptor DescriptorForRequiredKeys { get; } - - [NullAllowed, Export ("contact", ArgumentSemantic.Copy)] - CNContact Contact { get; set; } - } -#else [iOS (9,0)] +#if MONOMAC + [BaseType (typeof (NSViewController))] +#else [BaseType (typeof (UIViewController))] +#endif interface CNContactViewController { [Export ("initWithNibName:bundle:")] +#if !MONOMAC [PostGet ("NibBundle")] +#endif NativeHandle Constructor ([NullAllowed] string nibName, [NullAllowed] NSBundle bundle); [Static] [Export ("descriptorForRequiredKeys")] ICNKeyDescriptor DescriptorForRequiredKeys { get; } +#if MONOMAC + [NullAllowed, Export ("contact", ArgumentSemantic.Copy)] + CNContact Contact { get; [NoiOS]set; } +#else + [Export ("contact", ArgumentSemantic.Strong)] + CNContact Contact { get; } +#endif + + [NoMac] [Static] [Export ("viewControllerForContact:")] CNContactViewController FromContact (CNContact contact); + [NoMac] [Static] [Export ("viewControllerForUnknownContact:")] CNContactViewController FromUnknownContact (CNContact contact); + [NoMac] [Static] [Export ("viewControllerForNewContact:")] CNContactViewController FromNewContact ([NullAllowed] CNContact contact); - [Export ("contact", ArgumentSemantic.Strong)] - CNContact Contact { get; } - + [NoMac] [NullAllowed] // TODO: Maybe we can Strongify this puppy [Export ("displayedPropertyKeys")] NSString [] DisplayedPropertyKeys { get; set; } + [NoMac] [Export ("delegate", ArgumentSemantic.Weak)][NullAllowed] ICNContactViewControllerDelegate Delegate { get; set; } + [NoMac] [NullAllowed] [Export ("contactStore", ArgumentSemantic.Strong)] CNContactStore ContactStore { get; set; } + [NoMac] [NullAllowed] [Export ("parentGroup", ArgumentSemantic.Strong)] CNGroup ParentGroup { get; set; } + [NoMac] [NullAllowed] [Export ("parentContainer", ArgumentSemantic.Strong)] CNContainer ParentContainer { get; set; } + [NoMac] [NullAllowed] [Export ("alternateName")] string AlternateName { get; set; } + [NoMac] [NullAllowed] [Export ("message")] string Message { get; set; } + [NoMac] [Export ("allowsEditing", ArgumentSemantic.Assign)] bool AllowsEditing { get; set; } + [NoMac] [Export ("allowsActions", ArgumentSemantic.Assign)] bool AllowsActions { get; set; } + [NoMac] [Export ("shouldShowLinkedContacts", ArgumentSemantic.Assign)] bool ShouldShowLinkedContacts { get; set; } + [NoMac] [Export ("highlightPropertyWithKey:identifier:")] //TODO: Maybe we can mNullallowedake a strongly type version void HighlightProperty (NSString key, [NullAllowed] string identifier); } -#endif interface ICNContactViewControllerDelegate {} @@ -194,8 +207,8 @@ interface CNContactViewControllerDelegate { void DidComplete (CNContactViewController viewController, [NullAllowed] CNContact contact); } -#if MONOMAC [Mac (10,11)] + [NoiOS][NoTV][NoMacCatalyst] [BaseType (typeof (NSObject))] interface CNContactPicker { @@ -212,5 +225,4 @@ interface CNContactPicker [Export ("close")] void Close (); } -#endif // MONOMAC } diff --git a/src/coreanimation.cs b/src/coreanimation.cs index 9144db3d3e4d..3a6bc6a24a8f 100644 --- a/src/coreanimation.cs +++ b/src/coreanimation.cs @@ -187,7 +187,7 @@ interface CADisplayLink { [Export ("preferredFramesPerSecond")] nint PreferredFramesPerSecond { get; set; } - [Watch (8, 0), TV (15, 0), iOS (15, 0), MacCatalyst (15,0), Mac (12,0)] + [Watch (8, 0), TV (15, 0), iOS (15, 0), MacCatalyst (15,0)] [Export ("preferredFrameRateRange", ArgumentSemantic.Assign)] CAFrameRateRange PreferredFrameRateRange { get; set; } } @@ -1014,6 +1014,7 @@ interface CALayerDelegate { } #if HAS_OPENGLES + [NoMac][NoMacCatalyst] [Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'CAMetalLayer' instead.")] [Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'CAMetalLayer' instead.")] [Deprecated (PlatformName.iOS, 12, 0, message: "Use 'CAMetalLayer' instead.")] diff --git a/src/coreaudiokit.cs b/src/coreaudiokit.cs index ce6dd6206c6a..904d2d387efe 100644 --- a/src/coreaudiokit.cs +++ b/src/coreaudiokit.cs @@ -154,6 +154,7 @@ interface CANetworkBrowserWindowController { #if !MONOMAC [iOS (8,0)] + [NoMac] // in iOS 8.3 (Xcode 6.3 SDK) the base type was changed from UIViewController to UITableViewController [BaseType (typeof (UITableViewController), Name="CABTMIDICentralViewController")] interface CABTMidiCentralViewController { @@ -167,6 +168,7 @@ interface CABTMidiCentralViewController { } [iOS (8,0)] + [NoMac] [BaseType (typeof (UIViewController), Name="CABTMIDILocalPeripheralViewController")] interface CABTMidiLocalPeripheralViewController { [Export ("initWithNibName:bundle:")] @@ -175,6 +177,7 @@ interface CABTMidiLocalPeripheralViewController { } [iOS (8,0)] + [NoMac] [Deprecated (PlatformName.iOS, 13,0, message: "Use 'AudioUnit' instead.")] [NoMacCatalyst] [BaseType (typeof (UIView))] @@ -193,6 +196,7 @@ interface CAInterAppAudioSwitcherView { } [iOS (8,0)] + [NoMac] [Deprecated (PlatformName.iOS, 13,0, message: "Use 'AudioUnit' instead.")] [NoMacCatalyst] [BaseType (typeof (UIView))] diff --git a/src/coreimage.cs b/src/coreimage.cs index 398446a0e884..fc6662cecf87 100644 --- a/src/coreimage.cs +++ b/src/coreimage.cs @@ -254,11 +254,13 @@ interface CIContext { CIContext Create (); #if HAS_OPENGLES + [NoMac][NoMacCatalyst] [Deprecated (PlatformName.iOS, 12, 0)] [Static] [Export ("contextWithEAGLContext:")] CIContext FromContext (EAGLContext eaglContext); + [NoMac][NoMacCatalyst] [Deprecated (PlatformName.iOS, 12, 0)] [Static] [Export ("contextWithEAGLContext:options:")] @@ -3219,10 +3221,9 @@ interface CIAreaHistogram : CIAreaHistogramProtocol { [CoreImageFilterProperty ("outputImageNonMPS")] CIImage OutputImageNonMps { get; } -#if MONOMAC + [Mac (10, 5)] [CoreImageFilterProperty ("outputImageMPS")] CIImage OutputImageMps { get; } -#endif [CoreImageFilterProperty ("outputData")] NSData OutputData { get; } diff --git a/src/corespotlight.cs b/src/corespotlight.cs index 277aefaac862..026500e38f80 100644 --- a/src/corespotlight.cs +++ b/src/corespotlight.cs @@ -264,7 +264,7 @@ interface CSSearchableItemAttributeSet : NSCopying, NSSecureCoding { [Export ("initWithItemContentType:")] NativeHandle Constructor (string itemContentType); - [iOS (14,0)][TV (14,0)][Mac (11,0)] + [iOS (14,0)][Mac (11,0)] [MacCatalyst (14,0)] [Export ("initWithContentType:")] NativeHandle Constructor (UTType contentType); diff --git a/src/foundation.cs b/src/foundation.cs index 8568efccce18..0ffb996238b2 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -6810,6 +6810,7 @@ interface NSUrlConnection : #if HAS_NEWSSTANDKIT // Extension from iOS5, NewsstandKit [Deprecated (PlatformName.iOS, 13,0, message: "Use Background Remote Notifications instead.")] + [NoTV][NoMac][NoMacCatalyst] [NullAllowed] [Export ("newsstandAssetDownload", ArgumentSemantic.Weak)] NewsstandKit.NKAssetDownload NewsstandAssetDownload { get; } @@ -10255,6 +10256,7 @@ partial interface NSItemProvider : NSCopying { CGSize PreferredPresentationSize { get; #if !MONOMAC + [NoMac] set; #endif } diff --git a/src/intents.cs b/src/intents.cs index 06959b4a23ce..78ccfadd83fb 100644 --- a/src/intents.cs +++ b/src/intents.cs @@ -4152,12 +4152,12 @@ interface INMessage : NSCopying, NSSecureCoding { [DesignatedInitializer] NativeHandle Constructor (string identifier, [NullAllowed] string conversationIdentifier, [NullAllowed] string content, [NullAllowed] NSDate dateSent, [NullAllowed] INPerson sender, [NullAllowed] INPerson[] recipients, [NullAllowed] INSpeakableString groupName, INMessageType messageType, [NullAllowed] string serviceName); - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:messageType:")] [DesignatedInitializer] NativeHandle Constructor (string identifier, [NullAllowed] string conversationIdentifier, [NullAllowed] string content, [NullAllowed] NSDate dateSent, [NullAllowed] INPerson sender, [NullAllowed] INPerson [] recipients, [NullAllowed] INSpeakableString groupName, INMessageType messageType); - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:messageType:")] NativeHandle Constructor (string identifier, [NullAllowed] string conversationIdentifier, [NullAllowed] string content, [NullAllowed] NSDate dateSent, [NullAllowed] INPerson sender, [NullAllowed] INPerson [] recipients, INMessageType messageType); @@ -4167,7 +4167,7 @@ interface INMessage : NSCopying, NSSecureCoding { [Export ("identifier")] string Identifier { get; } - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [NullAllowed, Export ("conversationIdentifier")] string ConversationIdentifier { get; } @@ -4183,11 +4183,11 @@ interface INMessage : NSCopying, NSSecureCoding { [NullAllowed, Export ("recipients", ArgumentSemantic.Copy)] INPerson [] Recipients { get; } - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [NullAllowed, Export ("groupName", ArgumentSemantic.Copy)] INSpeakableString GroupName { get; } - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("messageType")] INMessageType MessageType { get; } @@ -5780,22 +5780,20 @@ interface INSaveProfileInCarIntentResponse { [BaseType (typeof (INIntent))] interface INSearchCallHistoryIntent { - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("initWithDateCreated:recipient:callCapabilities:callTypes:unseen:")] [DesignatedInitializer] NativeHandle Constructor ([NullAllowed] INDateComponentsRange dateCreated, [NullAllowed] INPerson recipient, INCallCapabilityOptions callCapabilities, INCallRecordTypeOptions callTypes, [NullAllowed] NSNumber unseen); - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Wrap ("this (dateCreated, recipient, callCapabilities, callTypes, new NSNumber (unseen))")] NativeHandle Constructor ([NullAllowed] INDateComponentsRange dateCreated, [NullAllowed] INPerson recipient, INCallCapabilityOptions callCapabilities, INCallRecordTypeOptions callTypes, bool unseen); - [Deprecated (PlatformName.MacOSX, 10, 13, message: "Use '.ctor (INDateComponentsRange, INPerson, INCallCapabilityOptions, INCallRecordTypeOptions, NSNumber)' instead.")] [Deprecated (PlatformName.WatchOS, 4, 0, message: "Use '.ctor (INDateComponentsRange, INPerson, INCallCapabilityOptions, INCallRecordTypeOptions, NSNumber)' instead.")] [Deprecated (PlatformName.iOS, 11, 0, message: "Use '.ctor (INDateComponentsRange, INPerson, INCallCapabilityOptions, INCallRecordTypeOptions, NSNumber)' instead.")] [Export ("initWithCallType:dateCreated:recipient:callCapabilities:")] NativeHandle Constructor (INCallRecordType callType, [NullAllowed] INDateComponentsRange dateCreated, [NullAllowed] INPerson recipient, INCallCapabilityOptions callCapabilities); - [Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'CallTypes' instead.")] [Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'CallTypes' instead.")] [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'CallTypes' instead.")] [Export ("callType", ArgumentSemantic.Assign)] @@ -5810,12 +5808,12 @@ interface INSearchCallHistoryIntent { [Export ("callCapabilities", ArgumentSemantic.Assign)] INCallCapabilityOptions CallCapabilities { get; } - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("callTypes", ArgumentSemantic.Assign)] INCallRecordTypeOptions CallTypes { get; } [Protected] - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [NullAllowed, Export ("unseen", ArgumentSemantic.Copy)] NSNumber WeakUnseen { get; } } @@ -5858,11 +5856,11 @@ interface INSearchCallHistoryIntentHandling { [Export ("resolveRecipientForSearchCallHistory:withCompletion:")] void ResolveRecipient (INSearchCallHistoryIntent intent, Action completion); - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("resolveCallTypesForSearchCallHistory:withCompletion:")] void ResolveCallTypes (INSearchCallHistoryIntent intent, Action completion); - [Watch (4,0), NoMac, iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("resolveUnseenForSearchCallHistory:withCompletion:")] void ResolveUnseen (INSearchCallHistoryIntent intent, Action completion); } @@ -5888,7 +5886,7 @@ interface INSearchCallHistoryIntentResponse { [Export ("code")] INSearchCallHistoryIntentResponseCode Code { get; } - [Mac (10,13), iOS (11,0), Watch (4,0)] + [iOS (11,0), Watch (4,0)] [NullAllowed, Export ("callRecords", ArgumentSemantic.Copy)] INCallRecord [] CallRecords { get; set; } } @@ -5907,11 +5905,11 @@ interface INSearchForMessagesIntent { [Deprecated (PlatformName.MacOSX, 10,14, message: "Use the overload that takes 'conversationIdentifiers' instead.")] [Deprecated (PlatformName.WatchOS, 5,0, message: "Use the overload that takes 'conversationIdentifiers' instead.")] [Deprecated (PlatformName.iOS, 12,0, message: "Use the overload that takes 'conversationIdentifiers' instead.")] - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("initWithRecipients:senders:searchTerms:attributes:dateTimeRange:identifiers:notificationIdentifiers:speakableGroupNames:")] NativeHandle Constructor ([NullAllowed] INPerson [] recipients, [NullAllowed] INPerson [] senders, [NullAllowed] string [] searchTerms, INMessageAttributeOptions attributes, [NullAllowed] INDateComponentsRange dateTimeRange, [NullAllowed] string [] identifiers, [NullAllowed] string [] notificationIdentifiers, [NullAllowed] INSpeakableString [] speakableGroupNames); - [Watch (5,0), Mac (10,14), iOS (12,0)] + [Watch (5,0), iOS (12,0)] [Export ("initWithRecipients:senders:searchTerms:attributes:dateTimeRange:identifiers:notificationIdentifiers:speakableGroupNames:conversationIdentifiers:")] [DesignatedInitializer] NativeHandle Constructor ([NullAllowed] INPerson [] recipients, [NullAllowed] INPerson [] senders, [NullAllowed] string [] searchTerms, INMessageAttributeOptions attributes, [NullAllowed] INDateComponentsRange dateTimeRange, [NullAllowed] string [] identifiers, [NullAllowed] string [] notificationIdentifiers, [NullAllowed] INSpeakableString [] speakableGroupNames, [NullAllowed] string [] conversationIdentifiers); @@ -5970,19 +5968,19 @@ interface INSearchForMessagesIntent { [Export ("groupNamesOperator", ArgumentSemantic.Assign)] INConditionalOperator GroupNamesOperator { get; } - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [NullAllowed, Export ("speakableGroupNames", ArgumentSemantic.Copy)] INSpeakableString [] SpeakableGroupNames { get; } - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("speakableGroupNamesOperator", ArgumentSemantic.Assign)] INConditionalOperator SpeakableGroupNamesOperator { get; } - [Watch (5,0), Mac (10,14), iOS (12,0)] + [Watch (5,0), iOS (12,0)] [NullAllowed, Export ("conversationIdentifiers", ArgumentSemantic.Copy)] string [] ConversationIdentifiers { get; } - [Watch (5,0), Mac (10,14), iOS (12,0)] + [Watch (5,0), iOS (12,0)] [Export ("conversationIdentifiersOperator", ArgumentSemantic.Assign)] INConditionalOperator ConversationIdentifiersOperator { get; } } @@ -6029,7 +6027,10 @@ interface INSearchForMessagesIntentHandling { [Export ("resolveGroupNamesForSearchForMessages:withCompletion:")] void ResolveGroupNames (INSearchForMessagesIntent intent, Action completion); - [Watch (4,0), Mac (10,13), iOS (11,0)] +#if !NET + [Mac (10,13)] +#endif + [Watch (4,0), iOS (11,0)] [Export ("resolveSpeakableGroupNamesForSearchForMessages:withCompletion:")] void ResolveSpeakableGroupNames (INSearchForMessagesIntent intent, Action completion); } @@ -7222,12 +7223,12 @@ interface INStartAudioCallIntent { [Export ("initWithContacts:")] NativeHandle Constructor ([NullAllowed] INPerson [] contacts); - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("initWithDestinationType:contacts:")] [DesignatedInitializer] NativeHandle Constructor (INCallDestinationType destinationType, [NullAllowed] INPerson [] contacts); - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] [Export ("destinationType", ArgumentSemantic.Assign)] INCallDestinationType DestinationType { get; } @@ -10105,7 +10106,10 @@ interface INSearchForNotebookItemsIntent { [Export ("initWithTitle:content:itemType:status:location:locationSearchType:dateTime:dateSearchType:notebookItemIdentifier:")] NativeHandle Constructor ([NullAllowed] INSpeakableString title, [NullAllowed] string content, INNotebookItemType itemType, INTaskStatus status, [NullAllowed] CLPlacemark location, INLocationSearchType locationSearchType, [NullAllowed] INDateComponentsRange dateTime, INDateSearchType dateSearchType, [NullAllowed] string notebookItemIdentifier); - [Watch (6,0), Mac (10,15), iOS (13,0)] +#if !NET + [Mac (10,15)] +#endif + [Watch (6,0), iOS (13,0)] [Export ("initWithTitle:content:itemType:status:location:locationSearchType:dateTime:dateSearchType:temporalEventTriggerTypes:taskPriority:notebookItemIdentifier:")] [DesignatedInitializer] NativeHandle Constructor ([NullAllowed] INSpeakableString title, [NullAllowed] string content, INNotebookItemType itemType, INTaskStatus status, [NullAllowed] CLPlacemark location, INLocationSearchType locationSearchType, [NullAllowed] INDateComponentsRange dateTime, INDateSearchType dateSearchType, INTemporalEventTriggerTypeOptions temporalEventTriggerTypes, INTaskPriority taskPriority, [NullAllowed] string notebookItemIdentifier); @@ -11102,7 +11106,7 @@ interface INObject : INSpeakable, NSCopying, NSSecureCoding { [DisableDefaultCtor] interface INPlayMediaIntent { - [Watch (6,0), Mac (10,15), iOS (13,0)] + [Watch (6,0), iOS (13,0)] [Export ("initWithMediaItems:mediaContainer:playShuffled:playbackRepeatMode:resumePlayback:playbackQueueLocation:playbackSpeed:mediaSearch:")] [DesignatedInitializer] NativeHandle Constructor ([NullAllowed] INMediaItem [] mediaItems, [NullAllowed] INMediaItem mediaContainer, [NullAllowed, BindAs (typeof (bool?))] NSNumber playShuffled, INPlaybackRepeatMode playbackRepeatMode, [NullAllowed, BindAs (typeof (bool?))] NSNumber resumePlayback, INPlaybackQueueLocation playbackQueueLocation, [NullAllowed, BindAs (typeof (double?))] NSNumber playbackSpeed, [NullAllowed] INMediaSearch mediaSearch); diff --git a/src/metal.cs b/src/metal.cs index 5ce02b0e16b5..435b197e0c14 100644 --- a/src/metal.cs +++ b/src/metal.cs @@ -3861,7 +3861,7 @@ interface MTLHeap interface IMTLResource {} interface IMTLHeap {} - [iOS (8,0)][Mac (10,11)] + [iOS (8,0)][Mac (10,11)][TV (9,0)][MacCatalyst (13,1)] [Protocol] // From Apple Docs: Your app does not define classes that implement this protocol. Model is not needed partial interface MTLResource { @@ -4677,19 +4677,19 @@ interface MTLRasterizationRateMapDescriptor : NSCopying { [Export ("setLayer:atIndex:")] void SetLayer ([NullAllowed] MTLRasterizationRateLayerDescriptor layer, nuint layerIndex); - [iOS (15,0), TV (15,0), MacCatalyst (15,0), Mac (12,0), NoWatch] + [iOS (15,0), MacCatalyst (15,0), Mac (12,0), NoWatch] [Export ("layers")] MTLRasterizationRateLayerArray Layers { get; } - [iOS (15,0), TV (15,0), MacCatalyst (15,0), Mac (12,0), NoWatch] + [iOS (15,0), MacCatalyst (15,0), Mac (12,0), NoWatch] [Export ("screenSize", ArgumentSemantic.Assign)] MTLSize ScreenSize { get; set; } - [iOS (15,0), TV (15,0), MacCatalyst (15,0), Mac (12,0), NoWatch] + [iOS (15,0), MacCatalyst (15,0), Mac (12,0), NoWatch] [NullAllowed, Export ("label")] string Label { get; set; } - [iOS (15,0), TV (15,0), MacCatalyst (15,0), Mac (12,0), NoWatch] + [iOS (15,0), MacCatalyst (15,0), Mac (12,0), NoWatch] [Export ("layerCount")] nuint LayerCount { get; } } @@ -4726,11 +4726,11 @@ interface MTLRasterizationRateLayerDescriptor : NSCopying { [Export ("vertical")] MTLRasterizationRateSampleArray Vertical { get; } - [Mac (12, 0), iOS (15, 0), TV (15,0), MacCatalyst(15,0), NoWatch] + [Mac (12, 0), iOS (15, 0), MacCatalyst(15,0), NoWatch] [Export ("maxSampleCount")] MTLSize MaxSampleCount { get; } - [Mac (12, 0), iOS (15, 0), TV (15,0), MacCatalyst(15,0), NoWatch] + [Mac (12, 0), iOS (15, 0), MacCatalyst(15,0), NoWatch] [Export ("sampleCount", ArgumentSemantic.Assign)] MTLSize SampleCount { get; set; } } @@ -5022,7 +5022,7 @@ interface MTLAccelerationStructureGeometryDescriptor : NSCopying { [Export ("allowDuplicateIntersectionFunctionInvocation")] bool AllowDuplicateIntersectionFunctionInvocation { get; set; } - [Mac (12, 0), iOS (15, 0), TV (15,0), NoWatch, MacCatalyst (15,0)] + [Mac (12, 0), iOS (15, 0), NoWatch, MacCatalyst (15,0)] [NullAllowed, Export ("label")] string Label { get; set; } } @@ -5212,15 +5212,15 @@ interface MTLInstanceAccelerationStructureDescriptor { [Export ("instanceDescriptorType", ArgumentSemantic.Assign)] MTLAccelerationStructureInstanceDescriptorType InstanceDescriptorType { get; set; } - [Mac (12, 0), iOS (15, 0), TV (15,0), NoWatch, MacCatalyst (15,0)] + [Mac (12, 0), iOS (15, 0), NoWatch, MacCatalyst (15,0)] [NullAllowed, Export ("motionTransformBuffer", ArgumentSemantic.Retain)] IMTLBuffer MotionTransformBuffer { get; set; } - [Mac (12, 0), iOS (15, 0), TV (15,0), NoWatch, MacCatalyst (15,0)] + [Mac (12, 0), iOS (15, 0), NoWatch, MacCatalyst (15,0)] [Export ("motionTransformBufferOffset")] nuint MotionTransformBufferOffset { get; set; } - [Mac (12, 0), iOS (15, 0), TV (15,0), NoWatch, MacCatalyst (15,0)] + [Mac (12, 0), iOS (15, 0), NoWatch, MacCatalyst (15,0)] [Export ("motionTransformCount")] nuint MotionTransformCount { get; set; } } @@ -5481,7 +5481,7 @@ interface MTLAccelerationStructureCommandEncoder : MTLCommandEncoder { #if NET [Abstract] #endif - [Mac (12,0), iOS (15,0), TV (15,0), MacCatalyst (15,0), NoWatch] + [Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoWatch] [Export ("writeCompactedAccelerationStructureSize:toBuffer:offset:sizeDataType:")] void WriteCompactedAccelerationStructureSize (IMTLAccelerationStructure accelerationStructure, IMTLBuffer buffer, nuint offset, MTLDataType sizeDataType); } diff --git a/src/networkextension.cs b/src/networkextension.cs index 55b50757f964..ac5e75fc1111 100644 --- a/src/networkextension.cs +++ b/src/networkextension.cs @@ -310,10 +310,13 @@ interface NEAppProxyUdpFlow [DisableDefaultCtor] interface NEAppRule : NSSecureCoding, NSCopying { + [iOS (9, 0)][MacCatalyst (13, 1)] + [NoTV][NoMac][NoWatch] [Export ("initWithSigningIdentifier:")] NativeHandle Constructor (string signingIdentifier); - [NoiOS, NoTV, NoWatch, MacCatalyst (15,0)] + [NoiOS, NoTV, NoWatch, NoMacCatalyst] + [Mac (10, 11)] [Export ("initWithSigningIdentifier:designatedRequirement:")] NativeHandle Constructor (string signingIdentifier, string designatedRequirement); diff --git a/src/opengles.cs b/src/opengles.cs index 54ddf13d52f5..b7b2fb1fad00 100644 --- a/src/opengles.cs +++ b/src/opengles.cs @@ -94,6 +94,7 @@ interface EAGLContext { bool TexImage (IOSurface.IOSurface ioSurface, nuint target, nuint internalFormat, uint width, uint height, nuint format, nuint type, uint plane); } + [NoMac][NoMacCatalyst] [Deprecated (PlatformName.iOS, 12,0, message: "Use 'Metal' instead.")] [Deprecated (PlatformName.TvOS, 12,0, message: "Use 'Metal' instead.")] [Protocol] diff --git a/src/scenekit.cs b/src/scenekit.cs index 0bef5bbafcda..daf75c84489c 100644 --- a/src/scenekit.cs +++ b/src/scenekit.cs @@ -3010,6 +3010,9 @@ interface ISCNSceneRenderer {} [Watch (3,0)] [iOS (8,0)] + [MacCatalyst (13, 0)] + [TV (9, 0)] + [Mac (10, 8)] [Protocol, Model] [BaseType (typeof (NSObject))] interface SCNSceneRenderer { diff --git a/src/tvuikit.cs b/src/tvuikit.cs index dfb4fc7148fa..539b72f24bad 100644 --- a/src/tvuikit.cs +++ b/src/tvuikit.cs @@ -405,6 +405,7 @@ interface TVMediaItemContentBadgeProperties : NSCopying, NSSecureCoding { TVMediaItemContentTextTransform Transform { get; set; } } + [NoiOS][NoMacCatalyst] [TV (15,0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] @@ -433,6 +434,7 @@ interface TVMonogramContentConfiguration : UIContentConfiguration, NSSecureCodin NSPersonNameComponents PersonNameComponents { get; set; } } + [NoiOS][NoMacCatalyst] [TV (15,0)] [BaseType (typeof (UIView))] [DisableDefaultCtor] diff --git a/src/uikit.cs b/src/uikit.cs index 9878bd1b4e16..018e6a331293 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -1256,7 +1256,7 @@ interface UIAccessibilityLocationDescriptor { } [NoWatch] - [TV (11,0), iOS (11,0)] + [TV (11,0), iOS (11,0)][NoMac] [Protocol] interface UIAccessibilityContentSizeCategoryImageAdjusting { [Abstract] @@ -2979,6 +2979,7 @@ interface UICoordinateSpace { [BaseType (typeof (NSObject))] [Model] + [NoMac] [Protocol] interface UIApplicationDelegate { @@ -6253,6 +6254,7 @@ [Internal] [Sealed] } [NoWatch] + [NoMac] [BaseType (typeof(NSObject))] [Model] [Protocol] @@ -11374,6 +11376,7 @@ UIEdgeInsets ScrollIndicatorInsets { UIRefreshControl RefreshControl { get; set; } } + [NoMac] [BaseType (typeof (NSObject))] [Model] [Protocol] @@ -14149,6 +14152,7 @@ NSDictionary TypingAttributes { } [BaseType (typeof(UIScrollViewDelegate))] + [NoMac] [Model] [Protocol] interface UITextViewDelegate { @@ -18512,6 +18516,7 @@ interface UIFocusMovementHint : NSCopying interface IUIFocusItem {} [iOS (10,0)] + [NoMac] [Protocol] interface UIFocusItem : UIFocusEnvironment { @@ -18770,6 +18775,7 @@ public enum UIFocusSoundIdentifier { interface IUIFocusEnvironment {} [NoWatch] + [NoMac] [iOS (9,0)] [Protocol] interface UIFocusEnvironment { @@ -20404,7 +20410,7 @@ interface UIScene { interface IUISceneDelegate { } - [iOS (13,0), TV (13,0), NoWatch] + [iOS (13,0), TV (13,0), NoWatch, NoMac] #if NET [Protocol, Model] #else @@ -22595,6 +22601,7 @@ interface IUIContentConfiguration {} [NoWatch, TV (14,0), iOS (14,0)] [MacCatalyst (14,0)] + [NoMac] [Protocol] interface UIContentConfiguration : NSCopying { @@ -22609,7 +22616,7 @@ interface UIContentConfiguration : NSCopying { interface IUIContentView {} - [NoWatch, TV (14,0), iOS (14,0)] + [NoWatch, TV (14,0), iOS (14,0)][NoMac] [MacCatalyst (14,0)] [Protocol] interface UIContentView { diff --git a/src/usernotifications.cs b/src/usernotifications.cs index 3ebeeeaae07a..0f572db0849d 100644 --- a/src/usernotifications.cs +++ b/src/usernotifications.cs @@ -569,7 +569,7 @@ interface UNNotificationResponse : NSCopying, NSSecureCoding { [Wrap ("!IsDefaultAction && !IsDismissAction")] bool IsCustomAction { get; } - [iOS (13,0), TV (13,0), NoWatch, NoMac] + [iOS (13,0), NoWatch, NoMac] [NullAllowed, Export ("targetScene")] UIScene TargetScene { get; } } diff --git a/src/xkit.cs b/src/xkit.cs index a33297e102f6..856945eddd67 100644 --- a/src/xkit.cs +++ b/src/xkit.cs @@ -150,6 +150,9 @@ public enum NSGlyphProperty : long { // NSInteger -> NSLayoutConstraint.h [Native] [NoWatch] + [iOS (6,0)] + [Mac (10,7)] + [TV (9,0)] [MacCatalyst (13,0)] public enum NSLayoutAttribute : long { NoAttribute = 0, @@ -200,6 +203,9 @@ public enum NSLayoutAttribute : long { [Flags] [NoWatch] [MacCatalyst (13,0)] + [iOS (6,0)] + [Mac (10,7)] + [TV (9,0)] public enum NSLayoutFormatOptions : ulong { None = 0, @@ -305,6 +311,8 @@ public enum NSTextStorageEditActions : ulong { [MacCatalyst (13,1)] [NoWatch] // Header is not present in watchOS SDK. [iOS (7,0)] + [TV (9,0)] + [Mac (10,7)] [DesignatedDefaultCtor] [BaseType (typeof (NSObject))] partial interface NSLayoutManager : NSSecureCoding { @@ -1392,6 +1400,9 @@ interface INSLayoutManagerDelegate {} [BaseType (typeof (NSObject))] [Model] [Protocol] + [Mac (10,0)] + [TV (9,0)] + [MacCatalyst (13,1)] interface NSLayoutManagerDelegate { [Export ("layoutManagerDidInvalidateLayout:")] #if MONOMAC && !NET @@ -1594,6 +1605,10 @@ interface NSDiffableDataSourceSnapshot Date: Tue, 19 Apr 2022 14:05:42 -0500 Subject: [PATCH 04/19] Attribute corrections found due to test --- src/AudioUnit/AUEnums.cs | 17 +++++++++++-- src/Contacts/CNEnums.cs | 2 ++ src/SceneKit/Defs.cs | 7 +++++- src/intents.cs | 52 +++++++++++++++++++++------------------- 4 files changed, 50 insertions(+), 28 deletions(-) diff --git a/src/AudioUnit/AUEnums.cs b/src/AudioUnit/AUEnums.cs index eb0536c05d3f..f0cd675e4ae6 100644 --- a/src/AudioUnit/AUEnums.cs +++ b/src/AudioUnit/AUEnums.cs @@ -189,12 +189,20 @@ public enum AudioObjectPropertySelector : uint TranslateUIDToBox = 1969841250, // 'uidb' ClockDeviceList = 1668049699, //'clk#' TranslateUidToClockDevice = 1969841251, // 'uidc', +#if XAMCORE_3_0 + [NoiOS][NoTV] +#endif [Deprecated (PlatformName.iOS, 15,0, message : "Use the 'ProcessIsMain' element instead.")] [Deprecated (PlatformName.MacCatalyst, 15,0, message : "Use the 'ProcessIsMain' element instead.")] [Deprecated (PlatformName.MacOSX, 12,0, message : "Use the 'ProcessIsMain' element instead.")] [Obsolete ("Use the 'ProcessIsMain' element instead.")] ProcessIsMaster = 1835103092, // 'mast' - [iOS (15,0), MacCatalyst (15,0), Mac (12,0), NoTV, NoWatch] +#if !XAMCORE_3_0 + [iOS (15,0)] +#else + [NoiOS] +#endif + [MacCatalyst (15,0), Mac (12,0), NoTV, NoWatch] ProcessIsMain = 1835100526, // 'main' IsInitingOrExiting = 1768845172, // 'inot' UserIDChanged = 1702193508, // 'euid' @@ -208,7 +216,12 @@ public enum AudioObjectPropertySelector : uint ActualSampleRate = 1634955892,// 'asrt', ClockDevice = 1634755428, // 'apcd', IOThreadOSWorkgroup = 1869838183, // 'oswg' - [iOS (15,0), MacCatalyst (15,0), Mac (12,0), NoTV, NoWatch] +#if !XAMCORE_3_0 + [iOS (15,0)] +#else + [NoiOS] +#endif + [MacCatalyst (15,0), Mac (12,0), NoTV, NoWatch] ProcessMute = 1634758765, // 'appm' } diff --git a/src/Contacts/CNEnums.cs b/src/Contacts/CNEnums.cs index 1d2607b90444..ed4813867cfa 100644 --- a/src/Contacts/CNEnums.cs +++ b/src/Contacts/CNEnums.cs @@ -131,10 +131,12 @@ public enum CNContactOptions : long { NonGregorianBirthday = 1 << 8, Note = 1 << 9, #if !MONOMAC + [NoMac] ImageData = 1 << 10, #endif ThumbnailImageData = 1 << 11, #if !MONOMAC + [NoMac] ImageDataAvailable = 1 << 12, #endif Type = 1 << 13, diff --git a/src/SceneKit/Defs.cs b/src/SceneKit/Defs.cs index 5040c8b449a3..50641d574138 100644 --- a/src/SceneKit/Defs.cs +++ b/src/SceneKit/Defs.cs @@ -281,7 +281,9 @@ public enum SCNAntialiasingMode : ulong { Multisampling2X, Multisampling4X, #if MONOMAC || __MACCATALYST__ + [NoiOS][NoTV] Multisampling8X, + [NoiOS][NoTV] Multisampling16X, #endif } @@ -360,11 +362,14 @@ public enum SCNRenderingApi : ulong { Metal, #if !MONOMAC - [Unavailable (PlatformName.MacCatalyst)] + [Unavailable (PlatformName.MacCatalyst)][NoMac] OpenGLES2, #else + [NoiOS][NoTV][NoMacCatalyst] OpenGLLegacy, + [NoiOS][NoTV][NoMacCatalyst] OpenGLCore32, + [NoiOS][NoTV][NoMacCatalyst] OpenGLCore41 #endif } diff --git a/src/intents.cs b/src/intents.cs index 78ccfadd83fb..90cd01181873 100644 --- a/src/intents.cs +++ b/src/intents.cs @@ -369,7 +369,12 @@ public enum INMessageAttribute : long { Unread, Flagged, Unflagged, - [iOS (11,0), Mac (10,13), Watch (4,0)] +#if NET + [NoMac] +#else + [Mac (10,13)] +#endif + [iOS (11,0), Watch (4,0)] Played, } @@ -388,7 +393,12 @@ public enum INMessageAttributeOptions : ulong { Unread = (1 << 1), Flagged = (1 << 2), Unflagged = (1 << 3), - [iOS (11,0), Mac (10,13), Watch (4,0)] +#if NET + [NoMac] +#else + [Mac (10,13)] +#endif + [iOS (11,0), Watch (4,0)] Played = (1UL << 4), } @@ -554,9 +564,9 @@ public enum INRequestPaymentIntentResponseCode : long { FailurePaymentsAmountAboveMaximum, FailurePaymentsCurrencyUnsupported, FailureNoBankAccount, - [iOS (11,0), Watch (4,0)] + [iOS (11,0), Watch (4,0)][NoMac] FailureNotEligible, - [iOS (11,1), Watch (4,1)] + [iOS (11,1), Watch (4,1)][NoMac] FailureTermsAndConditionsAcceptanceRequired, } @@ -660,11 +670,10 @@ public enum INSearchCallHistoryIntentResponseCode : long { Failure, FailureRequiringAppLaunch, [iOS (10, 2)] - [Mac (10, 12, 2)] FailureAppConfigurationRequired, - [iOS (11,0), Mac (10,13), Watch (4,0)] + [iOS (11,0), Watch (4,0)] InProgress, - [iOS (11,0), Mac (10,13), Watch (4,0)] + [iOS (11,0), Watch (4,0)] Success, } @@ -685,7 +694,7 @@ public enum INSearchForMessagesIntentResponseCode : long { Failure, FailureRequiringAppLaunch, FailureMessageServiceNotAvailable, - [iOS (11,0), Mac (10,13), Watch (4,0)] + [iOS (11,0), Watch (4,0)] FailureMessageTooManyResults, } @@ -703,7 +712,6 @@ public enum INSearchForPhotosIntentResponseCode : long { Failure, FailureRequiringAppLaunch, [iOS (10, 2)] - [Mac (10, 12, 2)] FailureAppConfigurationRequired, } @@ -740,9 +748,7 @@ public enum INSendPaymentIntentResponseCode : long { FailurePaymentsCurrencyUnsupported, FailureInsufficientFunds, FailureNoBankAccount, - [iOS (11, 0)] - [Mac (10, 13, 0)] - [Watch (4, 0)] + [iOS (11, 0)][Watch (4, 0)] FailureNotEligible, [iOS (11,1), Watch (4,1)] FailureTermsAndConditionsAcceptanceRequired, @@ -888,14 +894,12 @@ public enum INStartAudioCallIntentResponseCode : long { Failure, FailureRequiringAppLaunch, [iOS (10, 2)] - [Mac (10, 12, 2)] FailureAppConfigurationRequired, [iOS (10, 2)] - [Mac (10, 12, 2)] FailureCallingServiceNotAvailable, - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] FailureContactNotSupportedByApp, - [Watch (4,0), Mac (10,13), iOS (11,0)] + [Watch (4,0), iOS (11,0)] FailureNoValidNumber, } @@ -934,10 +938,8 @@ public enum INStartVideoCallIntentResponseCode : long { Failure, FailureRequiringAppLaunch, [iOS (10, 2)] - [Mac (10, 12, 2)] FailureAppConfigurationRequired, [iOS (10, 2)] - [Mac (10, 12, 2)] FailureCallingServiceNotAvailable, [Watch (4,0), iOS (11,0)] FailureContactNotSupportedByApp, @@ -1374,19 +1376,19 @@ public enum INMessageType : long { MediaVideo, MediaPass, MediaAudio, - [Watch (5,0), Mac (10,14), iOS (12,0)] + [Watch (5,0), iOS (12,0)] PaymentSent, - [Watch (5,0), Mac (10,14), iOS (12,0)] + [Watch (5,0), iOS (12,0)] PaymentRequest, - [Watch (5,0), Mac (10,14), iOS (12,0)] + [Watch (5,0), iOS (12,0)] PaymentNote, - [Watch (5,0), Mac (10,14), iOS (12,0)] + [Watch (5,0), iOS (12,0)] Animoji, - [Watch (5,0), Mac (10,14), iOS (12,0)] + [Watch (5,0), iOS (12,0)] ActivitySnippet, - [Watch (5,0), Mac (10,14), iOS (12,0)] + [Watch (5,0), iOS (12,0)] File, - [Watch (5,0), Mac (10,14), iOS (12,0)] + [Watch (5,0), iOS (12,0)] Link, } From 3f79c6c713fb6b3fc5dfb508f17cd65c71806cf1 Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Tue, 19 Apr 2022 14:07:13 -0500 Subject: [PATCH 05/19] Xtro todo removals due to better attributes --- .../MacCatalyst-FileProvider.todo | 2 -- .../MacCatalyst-Foundation.todo | 1 - .../MacCatalyst-Metal.todo | 24 ------------------- .../MacCatalyst-NetworkExtension.todo | 2 -- .../MacCatalyst-UIKit.todo | 5 ---- 5 files changed, 34 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.todo diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.todo deleted file mode 100644 index 94b0db5c3d16..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-FileProvider.todo +++ /dev/null @@ -1,2 +0,0 @@ -!extra-enum-value! Managed value 128 for NSFileProviderItemCapabilities.ExcludingFromSync is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 64 for NSFileProviderItemCapabilities.Evicting is available for the current platform while the value in the native header is not diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Foundation.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Foundation.todo index fdf7bb1c2b28..daea82a1857f 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Foundation.todo +++ b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Foundation.todo @@ -151,4 +151,3 @@ !missing-type! NSOrderedCollectionDifference not bound !missing-type! NSPresentationIntent not bound !extra-enum-value! Managed value 2 for NSItemProviderRepresentationVisibility.Group is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 23 for NSSearchPathDirectory.ApplicationScriptsDirectory is available for the current platform while the value in the native header is not diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Metal.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Metal.todo index c7b95e735bbc..4dc5421d375b 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Metal.todo +++ b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Metal.todo @@ -1,30 +1,6 @@ !extra-enum-value! Managed value 0 for MTLFeatureSet.iOS_GPUFamily1_v1 is available for the current platform while the value in the native header is not !extra-enum-value! Managed value 1 for MTLFeatureSet.iOS_GPUFamily2_v1 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 10 for MTLFeatureSet.iOS_GPUFamily3_v3 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 10000 for MTLFeatureSet.macOS_GPUFamily1_v1 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 10001 for MTLFeatureSet.macOS_GPUFamily1_v2 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 10002 for MTLFeatureSet.macOS_ReadWriteTextureTier2 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 10003 for MTLFeatureSet.macOS_GPUFamily1_v3 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 10004 for MTLFeatureSet.macOS_GPUFamily1_v4 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 10005 for MTLFeatureSet.macOS_GPUFamily2_v1 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 11 for MTLFeatureSet.iOS_GPUFamily4_v1 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 12 for MTLFeatureSet.iOS_GPUFamily1_v5 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 13 for MTLFeatureSet.iOS_GPUFamily2_v5 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 14 for MTLFeatureSet.iOS_GPUFamily3_v4 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 15 for MTLFeatureSet.iOS_GPUFamily4_v2 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 16 for MTLFeatureSet.iOS_GPUFamily5_v1 is available for the current platform while the value in the native header is not !extra-enum-value! Managed value 2 for MTLFeatureSet.iOS_GPUFamily1_v2 is available for the current platform while the value in the native header is not !extra-enum-value! Managed value 3 for MTLFeatureSet.iOS_GPUFamily2_v2 is available for the current platform while the value in the native header is not !extra-enum-value! Managed value 30000 for MTLFeatureSet.tvOS_GPUFamily1_v1 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 30001 for MTLFeatureSet.tvOS_GPUFamily1_v2 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 30002 for MTLFeatureSet.tvOS_GPUFamily1_v3 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 30003 for MTLFeatureSet.tvOS_GPUFamily2_v1 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 30004 for MTLFeatureSet.tvOS_GPUFamily1_v4 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 30005 for MTLFeatureSet.tvOS_GPUFamily2_v2 is available for the current platform while the value in the native header is not !extra-enum-value! Managed value 4 for MTLFeatureSet.iOS_GPUFamily3_v1 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 5 for MTLFeatureSet.iOS_GPUFamily1_v3 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 6 for MTLFeatureSet.iOS_GPUFamily2_v3 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 65536 for MTLLanguageVersion.v1_0 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 7 for MTLFeatureSet.iOS_GPUFamily3_v2 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 8 for MTLFeatureSet.iOS_GPUFamily1_v4 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 9 for MTLFeatureSet.iOS_GPUFamily2_v4 is available for the current platform while the value in the native header is not diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NetworkExtension.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NetworkExtension.todo index f39c3b721147..065cd2317827 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NetworkExtension.todo +++ b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NetworkExtension.todo @@ -1,3 +1 @@ !extra-enum-value! Managed value 1 for NEOnDemandRuleInterfaceType.Ethernet is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 3 for NETunnelProviderRoutingMethod.NetworkRule is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 4 for NEFilterReportEvent.Statistics is available for the current platform while the value in the native header is not diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.todo index f309a39c55b0..7ac313bed27b 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.todo +++ b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-UIKit.todo @@ -395,9 +395,4 @@ !missing-selector! UITabBarItemAppearance::copy not bound !missing-selector! UIToolbar::setTintColor: not bound !missing-selector! UIToolbar::tintColor not bound -!extra-enum-value! Managed value 1 for UITextFieldDidEndEditingReason.Cancelled is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 3 for UIBlurEffectStyle.ExtraDark is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 30 for UIPressType.PageUp is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 31 for UIPressType.PageDown is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 6 for UIButtonType.Plain is available for the current platform while the value in the native header is not !extra-enum-value! Managed value 8 for UIModalPresentationStyle.BlurOverFullScreen is available for the current platform while the value in the native header is not From b5dcc63ccc304792cd1de4ae32101df26f47f53c Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Tue, 19 Apr 2022 14:27:57 -0500 Subject: [PATCH 06/19] Correct defines to include GetCurrentInputDevice on Catalyst - This is an actual API inclusion, not just attribute change. - All of the other defines, and attributes imply that GetCurrentInputDevice() was expected to be on catalyst, but the define on 433 did not include it --- src/AudioUnit/AudioUnit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AudioUnit/AudioUnit.cs b/src/AudioUnit/AudioUnit.cs index 85e8172ad8e6..ddcde887405f 100644 --- a/src/AudioUnit/AudioUnit.cs +++ b/src/AudioUnit/AudioUnit.cs @@ -430,7 +430,7 @@ public uint GetCurrentDevice (AudioUnitScopeType scope, uint audioUnitElement = return device; } -#if !XAMCORE_3_0 || MONOMAC +#if !XAMCORE_3_0 || MONOMAC || __MACCATALYST__ #if !MONOMAC [Obsolete ("This API is not available on iOS.")] #endif From 234e862b65f349bd5ea09e8fb39a01d55ac6737f Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Tue, 19 Apr 2022 16:00:45 -0500 Subject: [PATCH 07/19] Fix API breaks --- src/AudioUnit/AudioUnit.cs | 2 +- src/Foundation/Enum.cs | 2 +- src/coreimage.cs | 1 + src/intents.cs | 5 ++++- src/networkextension.cs | 6 ++++-- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/AudioUnit/AudioUnit.cs b/src/AudioUnit/AudioUnit.cs index ddcde887405f..36ef16237c4b 100644 --- a/src/AudioUnit/AudioUnit.cs +++ b/src/AudioUnit/AudioUnit.cs @@ -431,7 +431,7 @@ public uint GetCurrentDevice (AudioUnitScopeType scope, uint audioUnitElement = } #if !XAMCORE_3_0 || MONOMAC || __MACCATALYST__ -#if !MONOMAC +#if !MONOMAC && !__MACCATALYST__ [Obsolete ("This API is not available on iOS.")] #endif #if NET diff --git a/src/Foundation/Enum.cs b/src/Foundation/Enum.cs index 042afae5b8bb..1794854f1fc0 100644 --- a/src/Foundation/Enum.cs +++ b/src/Foundation/Enum.cs @@ -77,11 +77,11 @@ public enum NSUrlCredentialPersistence : ulong { #if MONOMAC || !XAMCORE_3_0 - [NoiOS][NoTV][NoMacCatalyst] #if !NET [Native] public enum NSBundleExecutableArchitecture : long { #else + [NoiOS][NoTV][NoMacCatalyst] public enum NSBundleExecutableArchitecture { #endif I386 = 0x00000007, diff --git a/src/coreimage.cs b/src/coreimage.cs index fc6662cecf87..661452ce59a9 100644 --- a/src/coreimage.cs +++ b/src/coreimage.cs @@ -3222,6 +3222,7 @@ interface CIAreaHistogram : CIAreaHistogramProtocol { CIImage OutputImageNonMps { get; } [Mac (10, 5)] + [NoiOS][NoTV][NoWatch][NoMacCatalyst] [CoreImageFilterProperty ("outputImageMPS")] CIImage OutputImageMps { get; } diff --git a/src/intents.cs b/src/intents.cs index 90cd01181873..5a27ffbe2755 100644 --- a/src/intents.cs +++ b/src/intents.cs @@ -5858,11 +5858,14 @@ interface INSearchCallHistoryIntentHandling { [Export ("resolveRecipientForSearchCallHistory:withCompletion:")] void ResolveRecipient (INSearchCallHistoryIntent intent, Action completion); +#if !NET + [Mac (10,13)] +#endif [Watch (4,0), iOS (11,0)] [Export ("resolveCallTypesForSearchCallHistory:withCompletion:")] void ResolveCallTypes (INSearchCallHistoryIntent intent, Action completion); - [Watch (4,0), iOS (11,0)] + [Watch (4,0), NoMac, iOS (11,0)] [Export ("resolveUnseenForSearchCallHistory:withCompletion:")] void ResolveUnseen (INSearchCallHistoryIntent intent, Action completion); } diff --git a/src/networkextension.cs b/src/networkextension.cs index ac5e75fc1111..d407b3681b13 100644 --- a/src/networkextension.cs +++ b/src/networkextension.cs @@ -310,8 +310,10 @@ interface NEAppProxyUdpFlow [DisableDefaultCtor] interface NEAppRule : NSSecureCoding, NSCopying { - [iOS (9, 0)][MacCatalyst (13, 1)] - [NoTV][NoMac][NoWatch] + [iOS (9, 0)][MacCatalyst (13, 1)][NoTV][NoWatch] +#if NET + [NoMac] +#endif [Export ("initWithSigningIdentifier:")] NativeHandle Constructor (string signingIdentifier); From e53dcfd49090a6b8ed3e7fb1e90ad420a6be45ae Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Wed, 20 Apr 2022 09:27:50 -0500 Subject: [PATCH 08/19] Apply suggestions from code review Co-authored-by: Rolf Bjarne Kvinge --- src/generator.cs | 4 ++-- tests/cecil-tests/AttributeTest.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generator.cs b/src/generator.cs index f1e050cbd89e..232339bdff5d 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3598,7 +3598,7 @@ static bool ConvertKindToMatchKind (AvailabilityKind kind) static PropertyInfo GetProperyFromGetSetMethod (MethodInfo method) { string name = method.Name; - if (name.StartsWith ("get_") || name.StartsWith ("set_")) { + if (name.StartsWith ("get_", StringComparison.Ordinal) || name.StartsWith ("set_", StringComparison.Ordinal)) { return method.DeclaringType.GetProperty (name.Substring(4)); } return null; @@ -3621,7 +3621,7 @@ static MemberInfo FindContainingContext (MemberInfo mi) return FindContainingContext (mi.DeclaringType); } - // We need to collect all of the availabilty attriutes walking up the chain of context. + // We need to collect all of the availability attributes walking up the chain of context. // Example: A get_Foo inside of a property Foo which is inside of a class Klass. // The Foo property and the Klass both could have unique or duplicate attributes // We collect them all, starting with the inner most first in the list. diff --git a/tests/cecil-tests/AttributeTest.cs b/tests/cecil-tests/AttributeTest.cs index 2599bf24a364..bc8eade0afd7 100644 --- a/tests/cecil-tests/AttributeTest.cs +++ b/tests/cecil-tests/AttributeTest.cs @@ -464,7 +464,7 @@ IEnumerable GetAllTypeMembers (TypeDefinition type) // } // // When run against mac, this fails as Extension does not include a mac supported of any kind attribute - [TestCaseSource (typeof (Helper), "NetPlatformAssemblies")] + [TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformAssemblies))] public void AllAttributedItemsMustIncludeCurrentPlatform (string assemblyPath) { var assembly = Helper.GetAssembly (assemblyPath); From 334e12f348d4d26a39c6c64951c35081cbe3d5bc Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Wed, 20 Apr 2022 09:29:35 -0500 Subject: [PATCH 09/19] Update src/generator.cs Co-authored-by: Rolf Bjarne Kvinge --- src/generator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generator.cs b/src/generator.cs index 232339bdff5d..03a6aa40508d 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3502,7 +3502,7 @@ static string FindNamespace (MemberInfo item) IEnumerable AddUnlistedAvailability (MemberInfo containingClass, List availability) { // If there are literally no attributes for a platform on a type, for non-catalyst platforms - // add a minimum supported introdced since it was "unlisted" + // add a minimum supported introduced since it was "unlisted" foreach (var platform in new [] { PlatformName.iOS, PlatformName.TvOS, PlatformName.MacOSX }) { var list = GetFrameworkListForPlatform (platform); if (!availability.Any (v => v.Platform == platform)) { From ad0d1b721657021880f17bc8a26c2637925b2147 Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Wed, 20 Apr 2022 10:32:16 -0500 Subject: [PATCH 10/19] Remove hack that was disabling a test and fix test failures that it covered up --- .../AVCaptureVideoPreviewLayer.cs | 2 + src/AVFoundation/AVTypes.cs | 1 + src/AddressBook/ABPerson.cs | 2 + src/AddressBook/ABSource.cs | 1 + src/AppKit/Defs.cs | 1 + src/CFNetwork/CFHTTPMessage.cs | 1 + src/CoreFoundation/Dispatch.cs | 6 +++ src/CoreGraphics/CGDisplay.cs | 1 + src/CoreGraphics/CGEvent.cs | 1 + src/CoreGraphics/CGEventTypes.cs | 13 ++++++ src/CoreGraphics/CGImage.cs | 2 + src/CoreText/CTFont.cs | 8 ++++ src/EventKitUI/EKUIBundle.cs | 1 + .../GCExtendedGamepadSnapshot.cs | 18 ++++---- src/GameController/GCMotion.cs | 2 + src/HealthKit/HKAppleWalkingSteadiness.cs | 1 + src/HomeKit/HMCharacteristicProperties.cs | 1 + src/Security/Authorization.cs | 2 + src/SensorKit/SRAmbientLightChromaticity.cs | 1 + src/SystemConfiguration/CaptiveNetwork.cs | 16 ++++++++ .../NetworkReachability.cs | 3 ++ src/UIKit/UIEventButtonMaskExtensions.cs | 1 + src/UIKit/UITypes.cs | 2 + src/XKit/Types.cs | 2 + src/appkit.cs | 1 + src/generator.cs | 20 ++++++--- tests/cecil-tests/AttributeTest.cs | 41 ++++++++++++++++--- 27 files changed, 132 insertions(+), 19 deletions(-) diff --git a/src/AVFoundation/AVCaptureVideoPreviewLayer.cs b/src/AVFoundation/AVCaptureVideoPreviewLayer.cs index 016b79ff1dcf..d984a3cdcf31 100644 --- a/src/AVFoundation/AVCaptureVideoPreviewLayer.cs +++ b/src/AVFoundation/AVCaptureVideoPreviewLayer.cs @@ -16,6 +16,8 @@ public enum InitMode { WithConnection, #if NET [SupportedOSPlatform ("ios8.0")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("maccatalyst")] #else [iOS (8,0)] #endif diff --git a/src/AVFoundation/AVTypes.cs b/src/AVFoundation/AVTypes.cs index 40d8df4dc166..2d930efa958a 100644 --- a/src/AVFoundation/AVTypes.cs +++ b/src/AVFoundation/AVTypes.cs @@ -413,6 +413,7 @@ public struct AVSampleCursorChunkInfo { #if NET [SupportedOSPlatform ("macos10.15")] + [SupportedOSPlatform ("maccatalyst15.0")] #else [Mac (10,15)] #endif diff --git a/src/AddressBook/ABPerson.cs b/src/AddressBook/ABPerson.cs index dfd0f150e01e..48903a0ed22d 100644 --- a/src/AddressBook/ABPerson.cs +++ b/src/AddressBook/ABPerson.cs @@ -48,6 +48,7 @@ namespace AddressBook { #if NET [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if IOS [Obsolete ("Starting with ios9.0 use the 'Contacts' API instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif @@ -251,6 +252,7 @@ internal static void Init () #if NET [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if IOS [Obsolete ("Starting with ios9.0 use the 'Contacts' API instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif diff --git a/src/AddressBook/ABSource.cs b/src/AddressBook/ABSource.cs index 5f530d0a985e..f48feabb76a7 100644 --- a/src/AddressBook/ABSource.cs +++ b/src/AddressBook/ABSource.cs @@ -85,6 +85,7 @@ public ABSourceType SourceType { #if NET [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if IOS [Obsolete ("Starting with ios9.0 use the 'Contacts' API instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif diff --git a/src/AppKit/Defs.cs b/src/AppKit/Defs.cs index a456088a3725..309507c281e6 100644 --- a/src/AppKit/Defs.cs +++ b/src/AppKit/Defs.cs @@ -29,6 +29,7 @@ namespace AppKit { #if NET [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("maccatalyst")] #endif [StructLayout (LayoutKind.Sequential)] public struct NSEdgeInsets { diff --git a/src/CFNetwork/CFHTTPMessage.cs b/src/CFNetwork/CFHTTPMessage.cs index 4d91b34bbce7..b9f76a118f51 100644 --- a/src/CFNetwork/CFHTTPMessage.cs +++ b/src/CFNetwork/CFHTTPMessage.cs @@ -294,6 +294,7 @@ public enum AuthenticationScheme { [UnsupportedOSPlatform ("tvos12.0")] [UnsupportedOSPlatform ("macos10.14")] [UnsupportedOSPlatform ("ios12.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if TVOS [Obsolete ("Starting with tvos12.0 not available anymore.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif MONOMAC diff --git a/src/CoreFoundation/Dispatch.cs b/src/CoreFoundation/Dispatch.cs index c25530426212..182e49ac660b 100644 --- a/src/CoreFoundation/Dispatch.cs +++ b/src/CoreFoundation/Dispatch.cs @@ -709,6 +709,7 @@ public class Attributes #if NET [SupportedOSPlatform ("macos10.12")] + [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("ios10.0")] [SupportedOSPlatform ("tvos10.0")] #else @@ -721,6 +722,7 @@ public class Attributes #if NET [SupportedOSPlatform ("macos10.12")] + [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("ios10.0")] [SupportedOSPlatform ("tvos10.0")] #else @@ -734,6 +736,8 @@ public class Attributes #if NET [SupportedOSPlatform ("macos10.10")] [SupportedOSPlatform ("ios8.0")] + [SupportedOSPlatform ("tvos")] + [SupportedOSPlatform ("maccatalyst")] #else [Mac (10,10)] [iOS (8,0)] @@ -743,6 +747,8 @@ public class Attributes #if NET [SupportedOSPlatform ("macos10.10")] [SupportedOSPlatform ("ios8.0")] + [SupportedOSPlatform ("tvos")] + [SupportedOSPlatform ("maccatalyst")] #else [Mac (10,10)] [iOS (8,0)] diff --git a/src/CoreGraphics/CGDisplay.cs b/src/CoreGraphics/CGDisplay.cs index 4750051e63d2..efab6398e36b 100644 --- a/src/CoreGraphics/CGDisplay.cs +++ b/src/CoreGraphics/CGDisplay.cs @@ -9,6 +9,7 @@ namespace CoreGraphics #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif diff --git a/src/CoreGraphics/CGEvent.cs b/src/CoreGraphics/CGEvent.cs index d58223be8f4f..6236322f48aa 100644 --- a/src/CoreGraphics/CGEvent.cs +++ b/src/CoreGraphics/CGEvent.cs @@ -472,6 +472,7 @@ public static void PostToPSN (CGEvent evt, IntPtr processSerialNumber) #if NET [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("maccatalyst")] #endif public struct CGEventTapInformation { public uint /* uint32_t */ EventTapID; diff --git a/src/CoreGraphics/CGEventTypes.cs b/src/CoreGraphics/CGEventTypes.cs index 7870a3729ea6..24fbef11952d 100644 --- a/src/CoreGraphics/CGEventTypes.cs +++ b/src/CoreGraphics/CGEventTypes.cs @@ -24,6 +24,7 @@ namespace CoreGraphics { // CGEventTypes.h:typedef uint32_t CGEventTapLocation; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -36,6 +37,7 @@ public enum CGEventTapLocation : int { // CGEventTypes.h:typedef uint32_t CGEventTapPlacement; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -47,6 +49,7 @@ public enum CGEventTapPlacement : uint { // CGEventTypes.h:typedef uint32_t CGEventTapOptions; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -58,6 +61,7 @@ public enum CGEventTapOptions : uint { // CGEventTypes.h:typedef uint32_t CGMouseButton; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -68,6 +72,7 @@ public enum CGMouseButton : uint { // CGEventTypes.h:typedef uint32_t CGScrollEventUnit; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -78,6 +83,7 @@ public enum CGScrollEventUnit : uint { // CGEventTypes.h:typedef uint64_t CGEventMask; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -105,6 +111,7 @@ public enum CGEventMask : ulong { // CGEventTypes.h:typedef uint64_t CGEventFlags; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -124,6 +131,7 @@ public enum CGEventFlags : ulong { // CGEventTypes.h:typedef uint32_t CGEventField; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -193,6 +201,7 @@ internal enum CGEventField : int { // CGEventTypes.h:typedef uint32_t CGEventType; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -221,6 +230,7 @@ public enum CGEventType : uint { // CGEventTypes.h:typedef uint32_t CGEventMouseSubtype; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -231,6 +241,7 @@ public enum CGEventMouseSubtype : uint { // CGEventTypes.h:typedef uint32_t CGEventSourceStateID; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -241,6 +252,7 @@ public enum CGEventSourceStateID : int { // CGRemoteOperation.h:typedef uint32_t CGEventFilterMask; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -254,6 +266,7 @@ public enum CGEventFilterMask : uint { // CGRemoteOperation.h:typedef uint32_t CGEventSuppressionState; #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif diff --git a/src/CoreGraphics/CGImage.cs b/src/CoreGraphics/CGImage.cs index 0ae0894fc118..c582b2cd7ff0 100644 --- a/src/CoreGraphics/CGImage.cs +++ b/src/CoreGraphics/CGImage.cs @@ -45,6 +45,7 @@ namespace CoreGraphics { // uint32_t -> CGWindow.h (OSX SDK only) #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -61,6 +62,7 @@ public enum CGWindowImageOption : uint { // uint32_t -> CGWindow.h (OSX SDK only) #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif diff --git a/src/CoreText/CTFont.cs b/src/CoreText/CTFont.cs index eaad25e30441..3d239b17eae1 100644 --- a/src/CoreText/CTFont.cs +++ b/src/CoreText/CTFont.cs @@ -1251,6 +1251,8 @@ public enum Selector #if NET [UnsupportedOSPlatform ("macos10.8")] [UnsupportedOSPlatform ("ios5.1")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] #if MONOMAC [Obsolete ("Starting with macos10.8.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS @@ -1264,6 +1266,8 @@ public enum Selector #if NET [UnsupportedOSPlatform ("macos10.8")] [UnsupportedOSPlatform ("ios5.1")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] #if MONOMAC [Obsolete ("Starting with macos10.8.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS @@ -1389,6 +1393,8 @@ public enum Selector #if NET [UnsupportedOSPlatform ("macos10.8")] [UnsupportedOSPlatform ("ios5.1")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] #if MONOMAC [Obsolete ("Starting with macos10.8.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS @@ -1402,6 +1408,8 @@ public enum Selector #if NET [UnsupportedOSPlatform ("macos10.8")] [UnsupportedOSPlatform ("ios5.1")] + [UnsupportedOSPlatform ("tvos")] + [UnsupportedOSPlatform ("maccatalyst")] #if MONOMAC [Obsolete ("Starting with macos10.8.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS diff --git a/src/EventKitUI/EKUIBundle.cs b/src/EventKitUI/EKUIBundle.cs index ba02a7b7050f..ceefb16b4d48 100644 --- a/src/EventKitUI/EKUIBundle.cs +++ b/src/EventKitUI/EKUIBundle.cs @@ -17,6 +17,7 @@ namespace EventKitUI { #if NET [SupportedOSPlatform ("ios11.0")] + [SupportedOSPlatform ("maccatalyst13.0")] #else [iOS (11,0)] #endif diff --git a/src/GameController/GCExtendedGamepadSnapshot.cs b/src/GameController/GCExtendedGamepadSnapshot.cs index 818d5d09dad5..4c8fa5c941d9 100644 --- a/src/GameController/GCExtendedGamepadSnapshot.cs +++ b/src/GameController/GCExtendedGamepadSnapshot.cs @@ -25,6 +25,7 @@ namespace GameController { [UnsupportedOSPlatform ("macos10.14.4")] [UnsupportedOSPlatform ("tvos12.2")] [UnsupportedOSPlatform ("ios12.2")] + [UnsupportedOSPlatform ("maccatalyst")] #if MONOMAC [Obsolete ("Starting with macos10.14.4 use 'GCExtendedGamepadSnapshotData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS @@ -79,11 +80,11 @@ public struct GCExtendedGamepadSnapShotDataV100 { #if NET [SupportedOSPlatform ("ios7.0")] [SupportedOSPlatform ("macos10.9")] - [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if MONOMAC [Obsolete ("Starting with macos10.15 use 'GCController.GetExtendedGamepadController()' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS @@ -111,6 +112,7 @@ public struct GCExtendedGamepadSnapShotDataV100 { [UnsupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if MONOMAC [Obsolete ("Starting with macos10.15 use 'GCController.GetExtendedGamepadController()' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS @@ -158,7 +160,7 @@ public struct GCExtendedGamepadSnapshotData { [SupportedOSPlatform ("ios12.2")] [SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("tvos12.2")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] @@ -181,7 +183,7 @@ public struct GCExtendedGamepadSnapshotData { [SupportedOSPlatform ("tvos12.2")] [SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("ios12.2")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] @@ -204,7 +206,7 @@ public struct GCExtendedGamepadSnapshotData { [SupportedOSPlatform ("tvos12.2")] [SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("ios12.2")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] @@ -227,7 +229,7 @@ public struct GCExtendedGamepadSnapshotData { [SupportedOSPlatform ("tvos12.2")] [SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("ios12.2")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] @@ -251,7 +253,7 @@ public struct GCExtendedGamepadSnapshotData { [SupportedOSPlatform ("tvos12.2")] [SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("ios12.2")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] @@ -287,7 +289,7 @@ static extern bool GCExtendedGamepadSnapShotDataV100FromNSData ( [SupportedOSPlatform ("tvos12.2")] [SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("ios12.2")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] @@ -318,7 +320,7 @@ public static bool TryGetSnapShotData (NSData? data, out GCExtendedGamepadSnapSh [SupportedOSPlatform ("tvos12.2")] [SupportedOSPlatform ("macos10.14.4")] [SupportedOSPlatform ("ios12.2")] - [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("macos10.15")] [UnsupportedOSPlatform ("tvos13.0")] [UnsupportedOSPlatform ("ios13.0")] diff --git a/src/GameController/GCMotion.cs b/src/GameController/GCMotion.cs index 816626faf740..6018f9ba9fcb 100644 --- a/src/GameController/GCMotion.cs +++ b/src/GameController/GCMotion.cs @@ -67,6 +67,7 @@ public struct GCQuaternion { #if NET [SupportedOSPlatform ("ios15.4")] + [SupportedOSPlatform ("maccatalyst15.4")] [SupportedOSPlatform ("macos12.3")] [SupportedOSPlatform ("tvos15.4")] #else @@ -94,6 +95,7 @@ public GCDualSenseAdaptiveTriggerPositionalAmplitudes (float [] values) #if NET [SupportedOSPlatform ("ios15.4")] + [SupportedOSPlatform ("maccatalyst15.4")] [SupportedOSPlatform ("macos12.3")] [SupportedOSPlatform ("tvos15.4")] #else diff --git a/src/HealthKit/HKAppleWalkingSteadiness.cs b/src/HealthKit/HKAppleWalkingSteadiness.cs index 68b9f459e75a..55fb3c6d32b7 100644 --- a/src/HealthKit/HKAppleWalkingSteadiness.cs +++ b/src/HealthKit/HKAppleWalkingSteadiness.cs @@ -11,6 +11,7 @@ namespace HealthKit { #if NET [SupportedOSPlatform ("ios15.0")] + [SupportedOSPlatform ("maccatalyst15.0")] #else [Watch (8,0)] [iOS (15,0)] diff --git a/src/HomeKit/HMCharacteristicProperties.cs b/src/HomeKit/HMCharacteristicProperties.cs index 998f339adacb..0478bbe31ebc 100644 --- a/src/HomeKit/HMCharacteristicProperties.cs +++ b/src/HomeKit/HMCharacteristicProperties.cs @@ -7,6 +7,7 @@ namespace HomeKit { #if NET [SupportedOSPlatform ("ios8.0")] + [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos10.0")] #else [iOS (8,0)] diff --git a/src/Security/Authorization.cs b/src/Security/Authorization.cs index 04d9b69acbb8..9aa735c13524 100644 --- a/src/Security/Authorization.cs +++ b/src/Security/Authorization.cs @@ -42,6 +42,7 @@ namespace Security { #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif @@ -66,6 +67,7 @@ public enum AuthorizationStatus { #if NET [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos")] #else [MacCatalyst (15,0)] #endif diff --git a/src/SensorKit/SRAmbientLightChromaticity.cs b/src/SensorKit/SRAmbientLightChromaticity.cs index b27eebf98e45..a4328d1aa827 100644 --- a/src/SensorKit/SRAmbientLightChromaticity.cs +++ b/src/SensorKit/SRAmbientLightChromaticity.cs @@ -8,6 +8,7 @@ namespace SensorKit { #if NET [SupportedOSPlatform ("ios14.0")] + [SupportedOSPlatform ("maccatalyst14.0")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("macos")] #else diff --git a/src/SystemConfiguration/CaptiveNetwork.cs b/src/SystemConfiguration/CaptiveNetwork.cs index 25ca80b2c9dd..048141b8e189 100644 --- a/src/SystemConfiguration/CaptiveNetwork.cs +++ b/src/SystemConfiguration/CaptiveNetwork.cs @@ -74,6 +74,7 @@ public static partial class CaptiveNetwork { #if NET [UnsupportedOSPlatform ("ios14.0")] + [UnsupportedOSPlatform ("maccatalyst14.0")] #if IOS [Obsolete ("Starting with ios14.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif @@ -102,7 +103,10 @@ static public StatusCode TryCopyCurrentNetworkInfo (string interfaceName, out NS extern static IntPtr /* CFArrayRef __nullable */ CNCopySupportedInterfaces (); #if NET + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("ios")] [UnsupportedOSPlatform ("ios14.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if IOS [Obsolete ("Starting with ios14.0 use 'NEHotspotNetwork.FetchCurrent' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif @@ -123,7 +127,9 @@ static public StatusCode TryGetSupportedInterfaces (out string[] supportedInterf } #if NET + [SupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if IOS [Obsolete ("Starting with ios9.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif @@ -135,7 +141,9 @@ static public StatusCode TryGetSupportedInterfaces (out string[] supportedInterf extern static bool CNMarkPortalOffline (IntPtr /* CFStringRef __nonnull */ interfaceName); #if NET + [SupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if IOS [Obsolete ("Starting with ios9.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif @@ -147,7 +155,9 @@ static public StatusCode TryGetSupportedInterfaces (out string[] supportedInterf extern static bool CNMarkPortalOnline (IntPtr /* CFStringRef __nonnull */ interfaceName); #if NET + [SupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if IOS [Obsolete ("Starting with ios9.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif @@ -162,7 +172,9 @@ static public bool MarkPortalOnline (string iface) } #if NET + [SupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if IOS [Obsolete ("Starting with ios9.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif @@ -177,7 +189,9 @@ static public bool MarkPortalOffline (string iface) } #if NET + [SupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if IOS [Obsolete ("Starting with ios9.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif @@ -189,7 +203,9 @@ static public bool MarkPortalOffline (string iface) extern static bool CNSetSupportedSSIDs (IntPtr /* CFArrayRef __nonnull */ ssidArray); #if NET + [SupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("maccatalyst")] #if IOS [Obsolete ("Starting with ios9.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif diff --git a/src/SystemConfiguration/NetworkReachability.cs b/src/SystemConfiguration/NetworkReachability.cs index 7d1dbcf20714..f986fe4698e2 100644 --- a/src/SystemConfiguration/NetworkReachability.cs +++ b/src/SystemConfiguration/NetworkReachability.cs @@ -34,6 +34,9 @@ public enum NetworkReachabilityFlags { IsDirect = 1<<17, #if NET [UnsupportedOSPlatform ("macos")] + [SupportedOSPlatform ("maccatalyst")] + [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("tvos")] #else [Unavailable (PlatformName.MacOSX)] #endif diff --git a/src/UIKit/UIEventButtonMaskExtensions.cs b/src/UIKit/UIEventButtonMaskExtensions.cs index b24a760ab188..f24415b331b0 100644 --- a/src/UIKit/UIEventButtonMaskExtensions.cs +++ b/src/UIKit/UIEventButtonMaskExtensions.cs @@ -15,6 +15,7 @@ namespace UIKit { #if NET [SupportedOSPlatform ("ios13.4")] + [SupportedOSPlatform ("maccatalyst13.4")] #else [Introduced (PlatformName.iOS, 13,4, PlatformArchitecture.All)] #endif diff --git a/src/UIKit/UITypes.cs b/src/UIKit/UITypes.cs index 117a2624e38d..506d2cd81a90 100644 --- a/src/UIKit/UITypes.cs +++ b/src/UIKit/UITypes.cs @@ -105,6 +105,8 @@ public override string ToString () #if !WATCH #if NET [SupportedOSPlatform ("ios9.0")] + [SupportedOSPlatform ("tvos9.0")] + [SupportedOSPlatform ("maccatalyst13.0")] #else [iOS (9,0)] #endif diff --git a/src/XKit/Types.cs b/src/XKit/Types.cs index 148466c710fe..510f291bcff6 100644 --- a/src/XKit/Types.cs +++ b/src/XKit/Types.cs @@ -36,6 +36,8 @@ namespace UIKit { #if NET [SupportedOSPlatform ("tvos11.0")] [SupportedOSPlatform ("ios11.0")] + [SupportedOSPlatform ("maccatalyst13.1")] + [SupportedOSPlatform ("macos10.15")] #else [Watch (4,0)] [TV (11,0)] diff --git a/src/appkit.cs b/src/appkit.cs index 5ad69cfaf8b6..483a1412eb0a 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -20447,6 +20447,7 @@ interface NSTouchBarItem : NSCoding } [Mac (10,12,2)] + [MacCatalyst (13,1)] public enum NSTouchBarItemIdentifier { [MacCatalyst (13, 0)] diff --git a/src/generator.cs b/src/generator.cs index 03a6aa40508d..ee15e7a53e23 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -44,6 +44,7 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics; +using System.Globalization; using System.IO; using System.Text; using System.ComponentModel; @@ -3470,19 +3471,26 @@ static AvailabilityBaseAttribute CreateUnsupportedAttribute (PlatformName platfo HashSet GetFrameworkListForPlatform (PlatformName platform) { + HashSet frameworkList = null; switch (platform) { case PlatformName.iOS: - return Frameworks.iosframeworks; + frameworkList = Frameworks.iosframeworks; + break; case PlatformName.TvOS: - return Frameworks.tvosframeworks; + frameworkList = Frameworks.tvosframeworks; + break; case PlatformName.MacOSX: - return Frameworks.macosframeworks; + frameworkList = Frameworks.macosframeworks; + break; case PlatformName.MacCatalyst: - return Frameworks.maccatalystframeworks; + frameworkList = Frameworks.maccatalystframeworks; + break; default: - return new HashSet(); + frameworkList = new HashSet(); + break; } + return new HashSet(frameworkList.Select(x => x.ToLower (CultureInfo.InvariantCulture))); } static string FindNamespace (MemberInfo item) @@ -3507,7 +3515,7 @@ IEnumerable AddUnlistedAvailability (MemberInfo conta var list = GetFrameworkListForPlatform (platform); if (!availability.Any (v => v.Platform == platform)) { string ns = FindNamespace (containingClass); - if (list.Contains(ns)) { + if (list.Contains(ns.ToLower (CultureInfo.InvariantCulture))) { yield return CreateMinSupportedAttribute (platform); } } diff --git a/tests/cecil-tests/AttributeTest.cs b/tests/cecil-tests/AttributeTest.cs index bc8eade0afd7..f2c05be9aad1 100644 --- a/tests/cecil-tests/AttributeTest.cs +++ b/tests/cecil-tests/AttributeTest.cs @@ -60,6 +60,19 @@ public void ChildElementsListAvailabilityForAllPlatformsOnParent (string assembl Assert.That (found, Is.Empty, $"{found.Count} issues found"); } + bool IgnoreAllPlatformsOnParent (string fullName) + { + switch (fullName) { + // Generator Bug - Obsolete does not imply introduced but prevents unlisted from created one + case "AudioUnit.AudioUnitParameterType AudioUnit.AudioUnitParameterType::AUDCFilterDecayTime": + case "AppKit.NSBoxType AppKit.NSBoxType::NSBoxSecondary": + case "AppKit.NSBoxType AppKit.NSBoxType::NSBoxOldStyle": + return true; + default: + return false; + } + } + // Look for classes/struct that have double attributes, either because of partial classes or binding errors // Example: // TestType.cs @@ -116,6 +129,10 @@ public void DoubleAttributedElements (string assemblyPath) void CheckAllPlatformsOnParent (ICustomAttributeProvider item, string fullName, TypeDefinition parent, HashSet found) { + if (IgnoreAllPlatformsOnParent (fullName)) { + return; + } + var parentAvailability = GetAvailabilityAttributes (parent).ToList (); var myAvailability = GetAvailabilityAttributes (item); @@ -473,10 +490,6 @@ public void AllAttributedItemsMustIncludeCurrentPlatform (string assemblyPath) return; } - if (!assemblyPath.Contains("Xamarin.Mac.dll")) { - return; - } - string platformName = AssemblyToAttributeName (assemblyPath); HashSet found = new HashSet (); @@ -498,16 +511,34 @@ public void AllAttributedItemsMustIncludeCurrentPlatform (string assemblyPath) void CheckCurrentPlatformIncludedIfAny (ICustomAttributeProvider item, string platformName, string fullName, TypeDefinition parent, HashSet found) { if (HasAnyAvailabilityAttribute (item)) { - var supportedAttributes = item.CustomAttributes.Where (a => IsSupportedAttribute (a)); + if (IgnoreCurrentPlatform (fullName)) { + return; + } + var supportedAttributes = item.CustomAttributes.Where (a => IsAvailabilityAttribute (a)); if (!supportedAttributes.Any (a => FindAvailabilityKind (a) == platformName)) { #if DEBUG Console.WriteLine (fullName); + Console.WriteLine (String.Join(" ", supportedAttributes.Select (x => FindAvailabilityKind(x)))); + Console.WriteLine (platformName); #endif found.Add (fullName); } } } + bool IgnoreCurrentPlatform (string fullName) + { + switch (fullName) { + // Generator Bug - Obsolete does not imply introduced but prevents unlisted from created one + case "AudioUnit.AudioUnitParameterType AudioUnit.AudioUnitParameterType::AUDCFilterDecayTime": + case "AppKit.NSBoxType AppKit.NSBoxType::NSBoxSecondary": + case "AppKit.NSBoxType AppKit.NSBoxType::NSBoxOldStyle": + return true; + default: + return false; + } + } + string AssemblyToAttributeName (string assemblyPath) { var baseName = Path.GetFileName (assemblyPath); From 37ad4c0ff0db22c648d789826879a7289347f1d3 Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Thu, 21 Apr 2022 13:54:53 -0500 Subject: [PATCH 11/19] Hack around 'is decorated more than once with' in NET6 introspection tests for now --- tests/introspection/ApiAvailabilityTest.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/introspection/ApiAvailabilityTest.cs b/tests/introspection/ApiAvailabilityTest.cs index e7936be70f03..c56c0e3ef857 100644 --- a/tests/introspection/ApiAvailabilityTest.cs +++ b/tests/introspection/ApiAvailabilityTest.cs @@ -654,10 +654,12 @@ void CheckDupes (MemberInfo m, Type t, ISet type_level) if (type_level.Contains (s)) AddErrorLine ($"[FAIL] Both '{t}' and '{m}' are marked with `{s}`."); #endif +#if !NET // https://github.com/xamarin/xamarin-macios/issues/14802 if (member_level.Contains (s)) AddErrorLine ($"[FAIL] '{m}' is decorated more than once with `{s}`."); else member_level.Add (s); +#endif } } } From ea6fae9eed0d8df93fa5e3670aaa749744f2222d Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Thu, 21 Apr 2022 15:53:27 -0500 Subject: [PATCH 12/19] Correct invalid attributes caused by incorrect namespace check (we were lower cased in one place but not another) --- src/generator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generator.cs b/src/generator.cs index ee15e7a53e23..bbfd6a9fbe68 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3511,10 +3511,10 @@ IEnumerable AddUnlistedAvailability (MemberInfo conta { // If there are literally no attributes for a platform on a type, for non-catalyst platforms // add a minimum supported introduced since it was "unlisted" + string ns = FindNamespace (containingClass); foreach (var platform in new [] { PlatformName.iOS, PlatformName.TvOS, PlatformName.MacOSX }) { var list = GetFrameworkListForPlatform (platform); if (!availability.Any (v => v.Platform == platform)) { - string ns = FindNamespace (containingClass); if (list.Contains(ns.ToLower (CultureInfo.InvariantCulture))) { yield return CreateMinSupportedAttribute (platform); } @@ -3541,13 +3541,13 @@ static void AddImpliedCatalyst (List memberAvailabili void StripIntroducedOnNamespaceNotIncluded (List memberAvailability, MemberInfo context) { if (context is TypeInfo containingClass) { + string ns = FindNamespace (containingClass); var droppedPlatforms = new HashSet(); // Walk all members and look for introduced that are nonsense for our containing class's platform foreach (var introduced in memberAvailability.Where (a => a.AvailabilityKind == AvailabilityKind.Introduced).ToList()) { var list = GetFrameworkListForPlatform (introduced.Platform); - string ns = (containingClass as TypeInfo)?.Namespace; - if (!list.Contains(ns)) { + if (!list.Contains(ns.ToLower (CultureInfo.InvariantCulture))) { memberAvailability.Remove (introduced); droppedPlatforms.Add (introduced.Platform); } From 61a9da423d61c958cd8a1802fb304e15d96a716a Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Thu, 21 Apr 2022 17:05:46 -0500 Subject: [PATCH 13/19] Add a hack in for webkit/wkwebkit --- src/generator.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/generator.cs b/src/generator.cs index bbfd6a9fbe68..97c347f41690 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3507,15 +3507,24 @@ static string FindNamespace (MemberInfo item) } } + bool IsInSupportedFramework (MemberInfo klass, PlatformName platform) + { + string ns = FindNamespace (klass); + var list = GetFrameworkListForPlatform (platform); + // The framework is named wkwebkit but the namespace is webkit + if (list.Contains ("wkwebkit")) { + list.Add ("webkit"); + } + return list.Contains(ns.ToLower (CultureInfo.InvariantCulture)); + } + IEnumerable AddUnlistedAvailability (MemberInfo containingClass, List availability) { // If there are literally no attributes for a platform on a type, for non-catalyst platforms // add a minimum supported introduced since it was "unlisted" - string ns = FindNamespace (containingClass); foreach (var platform in new [] { PlatformName.iOS, PlatformName.TvOS, PlatformName.MacOSX }) { - var list = GetFrameworkListForPlatform (platform); if (!availability.Any (v => v.Platform == platform)) { - if (list.Contains(ns.ToLower (CultureInfo.InvariantCulture))) { + if (IsInSupportedFramework (containingClass, platform)) { yield return CreateMinSupportedAttribute (platform); } } @@ -3541,13 +3550,11 @@ static void AddImpliedCatalyst (List memberAvailabili void StripIntroducedOnNamespaceNotIncluded (List memberAvailability, MemberInfo context) { if (context is TypeInfo containingClass) { - string ns = FindNamespace (containingClass); var droppedPlatforms = new HashSet(); // Walk all members and look for introduced that are nonsense for our containing class's platform foreach (var introduced in memberAvailability.Where (a => a.AvailabilityKind == AvailabilityKind.Introduced).ToList()) { - var list = GetFrameworkListForPlatform (introduced.Platform); - if (!list.Contains(ns.ToLower (CultureInfo.InvariantCulture))) { + if (!IsInSupportedFramework (containingClass, introduced.Platform)) { memberAvailability.Remove (introduced); droppedPlatforms.Add (introduced.Platform); } From 88e2fa7bf22ab3c3b41c1a669f249551085baba4 Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Fri, 22 Apr 2022 09:05:42 -0500 Subject: [PATCH 14/19] Actually add introspection test hacks --- tests/introspection/ApiAvailabilityTest.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/introspection/ApiAvailabilityTest.cs b/tests/introspection/ApiAvailabilityTest.cs index c56c0e3ef857..22f4b8a35b32 100644 --- a/tests/introspection/ApiAvailabilityTest.cs +++ b/tests/introspection/ApiAvailabilityTest.cs @@ -368,6 +368,12 @@ AvailabilityBaseAttribute GetAvailable (ICustomAttributeProvider cap, out Versio void CheckUnavailable (Type t, bool typeUnavailable, Version? typeUnavailableVersion, MemberInfo m) { +#if NET + switch (t.FullName) { + case "MediaPlayer.MPMoviePlayerController": + return; + } +#endif var ma = GetAvailable (m, out var availableVersion); if (typeUnavailable && (ma != null)) { if (typeUnavailableVersion is not null && availableVersion is not null) { @@ -384,6 +390,8 @@ void CheckUnavailable (Type t, bool typeUnavailable, Version? typeUnavailableVer // Apple is introducing and deprecating numerous APIs in the same Mac Catalyst version, // so specifically for Mac Catalyst, we do a simple 'greater than' version check, // instead of a 'greater than or equal' version like we do for the other platforms. +#if !NET // https://github.com/xamarin/xamarin-macios/issues/14802 + if (Platform == ApplePlatform.MacCatalyst) { if (availableVersion > unavailableVersion) AddErrorLine ($"[FAIL] {m} is marked both [Unavailable ({Platform})] and {ma}, and it's available in version {availableVersion} which is > than the unavailable version {unavailableVersion}"); @@ -391,6 +399,7 @@ void CheckUnavailable (Type t, bool typeUnavailable, Version? typeUnavailableVer if (availableVersion >= unavailableVersion) AddErrorLine ($"[FAIL] {m} is marked both [Unavailable ({Platform})] and {ma}, and it's available in version {availableVersion} which is >= than the unavailable version {unavailableVersion}"); } +#endif } else { // As documented in https://docs.microsoft.com/en-us/dotnet/standard/analyzers/platform-compat-analyzer#advanced-scenarios-for-attribute-combinations // it is valid, and required in places to declare a type both availabile and unavailable on a given platform. @@ -423,6 +432,7 @@ public void Unavailable () // Apple is introducing and deprecating numerous APIs in the same Mac Catalyst version, // so specifically for Mac Catalyst, we do a simple 'greater than' version check, // instead of a 'greater than or equal' version like we do for the other platforms. +#if !NET // https://github.com/xamarin/xamarin-macios/issues/14802 if (Platform == ApplePlatform.MacCatalyst) { if (availableVersion > unavailableVersion) AddErrorLine ($"[FAIL] {t.FullName} is marked both [Unavailable ({Platform})] and {ta}, and it's available in version {availableVersion} which is > than the unavailable version {unavailableVersion}"); @@ -431,6 +441,7 @@ public void Unavailable () if (availableVersion >= unavailableVersion) AddErrorLine ($"[FAIL] {t.FullName} is marked both [Unavailable ({Platform})] and {ta}, and it's available in version {availableVersion} which is >= than the unavailable version {unavailableVersion}"); } +#endif } else { // As documented in https://docs.microsoft.com/en-us/dotnet/standard/analyzers/platform-compat-analyzer#advanced-scenarios-for-attribute-combinations // it is valid, and required in places to declare a type both availabile and unavailable on a given platform. From 402cd4357b81c07f5a742b8db9e6ac696ae1be67 Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Fri, 22 Apr 2022 12:58:26 -0500 Subject: [PATCH 15/19] Change generated attributes and fix known test failures - Generate Obsolete/Advice and Unsupported pairs for Deprecated/Obsoleted instead of a single attribute - A number of generator improvements and test/binding fixes --- src/Foundation/AdviceAttribute.cs | 2 +- src/Security/Certificate.cs | 2 +- src/avfoundation.cs | 7 ++ src/gamekit.cs | 1 + src/generator-attributes.cs | 92 ++++++++++++++++------ src/generator-enums.cs | 2 +- src/generator.cs | 69 +++++++++------- src/homekit.cs | 2 +- tests/cecil-tests/AttributeTest.cs | 13 +++ tests/introspection/ApiAvailabilityTest.cs | 75 +++++++----------- 10 files changed, 161 insertions(+), 104 deletions(-) diff --git a/src/Foundation/AdviceAttribute.cs b/src/Foundation/AdviceAttribute.cs index 1724720f2400..18e0e3cf213d 100644 --- a/src/Foundation/AdviceAttribute.cs +++ b/src/Foundation/AdviceAttribute.cs @@ -36,7 +36,7 @@ namespace Foundation AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, - Inherited=false)] + Inherited=false, AllowMultiple = true)] public class AdviceAttribute : Attribute { public AdviceAttribute (string message) diff --git a/src/Security/Certificate.cs b/src/Security/Certificate.cs index 81208e0f5232..36b3274e2123 100644 --- a/src/Security/Certificate.cs +++ b/src/Security/Certificate.cs @@ -228,6 +228,7 @@ internal static bool Equals (SecCertificate first, SecCertificate second) #if NET [SupportedOSPlatform ("macos")] + [UnsupportedOSPlatform ("macos10.14")] [UnsupportedOSPlatform ("ios")] [UnsupportedOSPlatform ("tvos")] [UnsupportedOSPlatform ("macos")] @@ -463,7 +464,6 @@ internal static bool Equals (SecCertificate first, SecCertificate second) #if MONOMAC #if NET [SupportedOSPlatform ("maccatalyst")] - [SupportedOSPlatform ("macos")] [UnsupportedOSPlatform ("macos10.13")] #if MONOMAC [Obsolete ("Starting with macos10.13 use 'GetSerialNumber' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] diff --git a/src/avfoundation.cs b/src/avfoundation.cs index b570ce6dc3c6..482ab2f5b76e 100644 --- a/src/avfoundation.cs +++ b/src/avfoundation.cs @@ -10501,6 +10501,8 @@ interface AVCaptureMovieFileOutput { [NoTV] [NoWatch] + [MacCatalyst (13,1)] + [Deprecated (PlatformName.MacCatalyst, 13,1, message: "Use 'AVCapturePhotoOutput' instead.")] [Deprecated (PlatformName.iOS, 10,0, message: "Use 'AVCapturePhotoOutput' instead.")] [Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'AVCapturePhotoOutput' instead.")] [BaseType (typeof (AVCaptureOutput))] @@ -10529,24 +10531,28 @@ interface AVCaptureStillImageOutput { NSData JpegStillToNSData (CMSampleBuffer buffer); [Introduced (PlatformName.MacCatalyst, 14, 0)] + [Deprecated (PlatformName.MacCatalyst, 14, 0)] // 5.0 [Export ("capturingStillImage")] bool CapturingStillImage { [Bind ("isCapturingStillImage")] get; } [NoMac] [Introduced (PlatformName.MacCatalyst, 14, 0)] + [Deprecated (PlatformName.MacCatalyst, 14, 0)] [iOS (7,0)] [Export ("automaticallyEnablesStillImageStabilizationWhenAvailable")] bool AutomaticallyEnablesStillImageStabilizationWhenAvailable { get; set; } [NoMac] [Introduced (PlatformName.MacCatalyst, 14, 0)] + [Deprecated (PlatformName.MacCatalyst, 14, 0)] [iOS (7,0)] [Export ("stillImageStabilizationActive")] bool IsStillImageStabilizationActive { [Bind ("isStillImageStabilizationActive")] get; } [NoMac] [Introduced (PlatformName.MacCatalyst, 14, 0)] + [Deprecated (PlatformName.MacCatalyst, 14, 0)] [iOS (7,0)] [Export ("stillImageStabilizationSupported")] bool IsStillImageStabilizationSupported { [Bind ("isStillImageStabilizationSupported")] get; } @@ -10577,6 +10583,7 @@ interface AVCaptureStillImageOutput { bool LensStabilizationDuringBracketedCaptureEnabled { [Bind ("isLensStabilizationDuringBracketedCaptureEnabled")] get; set; } [Introduced (PlatformName.MacCatalyst, 14, 0)] + [Deprecated (PlatformName.MacCatalyst, 14, 0)] [iOS (8,0), Mac (10, 14)] [Export ("highResolutionStillImageOutputEnabled")] bool HighResolutionStillImageOutputEnabled { [Bind ("isHighResolutionStillImageOutputEnabled")] get; set; } diff --git a/src/gamekit.cs b/src/gamekit.cs index 38ba84c920f0..6f1c380efddf 100644 --- a/src/gamekit.cs +++ b/src/gamekit.cs @@ -1745,6 +1745,7 @@ interface GKDialogController { [BaseType (typeof (NSViewController), Events=new Type [] { typeof (GKFriendRequestComposeViewControllerDelegate)}, Delegates=new string[] {"WeakComposeViewDelegate"})] interface GKFriendRequestComposeViewController : GKViewController { [Export ("initWithNibName:bundle:")] + [NoiOS] NativeHandle Constructor ([NullAllowed] string nibNameOrNull, [NullAllowed] NSBundle nibBundleOrNull); #else [BaseType (typeof (UINavigationController), Events=new Type [] { typeof (GKFriendRequestComposeViewControllerDelegate)}, Delegates=new string[] {"WeakComposeViewDelegate"})] diff --git a/src/generator-attributes.cs b/src/generator-attributes.cs index 9d0a30b12b4f..c7d0c94dd317 100644 --- a/src/generator-attributes.cs +++ b/src/generator-attributes.cs @@ -909,15 +909,9 @@ internal AvailabilityBaseAttribute ( Message = message; } - public override string ToString () + void GeneratePlatformDefine (StringBuilder builder) { - var builder = new StringBuilder (); - switch (AvailabilityKind) { - case AvailabilityKind.Introduced: - builder.Append ("[SupportedOSPlatform (\""); - break; - case AvailabilityKind.Obsoleted: - switch (Platform) { + switch (Platform) { case PlatformName.iOS: builder.AppendLine ("#if __IOS__"); break; @@ -931,19 +925,61 @@ public override string ToString () builder.AppendLine ("#if __MACOS__"); break; case PlatformName.MacCatalyst: - builder.AppendLine ("#if __MACCATALYST__"); + builder.AppendLine ("#if __MACCATALYST__ && !__IOS__ && !__MACOS__"); break; default: throw new NotSupportedException ($"Unknown platform: {Platform}"); - } - builder.Append ("[Obsolete (\"Starting with "); - break; - case AvailabilityKind.Deprecated: - case AvailabilityKind.Unavailable: - builder.Append ("[UnsupportedOSPlatform (\""); - break; } + } + + void GenerateObsolete (StringBuilder builder) + { + GeneratePlatformDefine (builder); + builder.Append ("[Obsolete (\"Starting with "); + + GeneratePlatformNameAndVersion (builder); + + if (!String.IsNullOrEmpty (Message)) + builder.Append (' ').Append (Message); + else + builder.Append ('.'); // intro check messages to they end with a '.' + // TODO add a URL (wiki?) and DiagnosticId (one per platform?) for documentation + builder.AppendLine ("\", DiagnosticId = \"BI1234\", UrlFormat = \"https://github.com/xamarin/xamarin-macios/wiki/Obsolete\")]"); + builder.AppendLine ("#endif"); + } + + void GenerateAdvice (StringBuilder builder) + { + GeneratePlatformDefine (builder); + builder.Append ("[Advice (\"Starting with "); + + GeneratePlatformNameAndVersion (builder); + + if (!String.IsNullOrEmpty (Message)) + builder.Append (' ').Append (Message); + else + builder.Append ('.'); // intro check messages to they end with a '.' + // TODO add a URL (wiki?) and DiagnosticId (one per platform?) for documentation + builder.AppendLine ("\")]"); + builder.AppendLine ("#endif"); + } + void GenerateUnsupported (StringBuilder builder) + { + builder.Append ("[UnsupportedOSPlatform (\""); + GeneratePlatformNameAndVersion (builder); + builder.AppendLine ("\")]"); + } + + void GenerateSupported (StringBuilder builder) + { + builder.Append ("[SupportedOSPlatform (\""); + GeneratePlatformNameAndVersion (builder); + builder.AppendLine ("\")]"); + } + + void GeneratePlatformNameAndVersion (StringBuilder builder) + { switch (Platform) { case PlatformName.iOS: builder.Append ("ios"); @@ -966,21 +1002,25 @@ public override string ToString () if (Version != null) builder.Append (Version.ToString (Version.Build >= 0 ? 3 : 2)); + } + public override string ToString () + { + var builder = new StringBuilder (); switch (AvailabilityKind) { - case AvailabilityKind.Obsoleted: - if (!String.IsNullOrEmpty (Message)) - builder.Append (' ').Append (Message); - else - builder.Append ('.'); // intro check messages to they end with a '.' - // TODO add a URL (wiki?) and DiagnosticId (one per platform?) for documentation - builder.AppendLine ("\", DiagnosticId = \"BI1234\", UrlFormat = \"https://github.com/xamarin/xamarin-macios/wiki/Obsolete\")]"); - builder.Append ("#endif"); - break; case AvailabilityKind.Introduced: + GenerateSupported (builder); + break; case AvailabilityKind.Deprecated: + GenerateAdvice (builder); + GenerateUnsupported (builder); + break; + case AvailabilityKind.Obsoleted: + GenerateObsolete (builder); + GenerateUnsupported (builder); + break; case AvailabilityKind.Unavailable: - builder.Append ("\")]"); + GenerateUnsupported (builder); break; } return builder.ToString (); diff --git a/src/generator-enums.cs b/src/generator-enums.cs index c1e495c9230d..f989531ed9ba 100644 --- a/src/generator-enums.cs +++ b/src/generator-enums.cs @@ -92,7 +92,7 @@ void GenerateEnum (Type type) // skip value__ field if (f.IsSpecialName) continue; - PrintPlatformAttributes (f); + PrintPlatformAttributes (f, is_enum: true); CopyObsolete (f); print ("{0} = {1},", f.Name, f.GetRawConstantValue ()); var fa = AttributeManager.GetCustomAttribute (f); diff --git a/src/generator.cs b/src/generator.cs index 97c347f41690..6138a4ccf5f8 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3436,19 +3436,17 @@ static AvailabilityBaseAttribute CloneFromOtherPlatform (AvailabilityBaseAttribu } } - static AvailabilityBaseAttribute CreateMinSupportedAttribute (PlatformName platform) + static AvailabilityBaseAttribute CreateNoVersionSupportedAttribute (PlatformName platform) { switch (platform) { case PlatformName.iOS: - return new IntroducedAttribute(platform, Xamarin.SdkVersions.MiniOSVersion.Major, Xamarin.SdkVersions.MiniOSVersion.Minor); case PlatformName.TvOS: - return new IntroducedAttribute(platform, Xamarin.SdkVersions.MinTVOSVersion.Major, Xamarin.SdkVersions.MinTVOSVersion.Minor); case PlatformName.MacOSX: - return new IntroducedAttribute(platform, Xamarin.SdkVersions.MinOSXVersion.Major, Xamarin.SdkVersions.MinOSXVersion.Minor); + return new IntroducedAttribute(platform); case PlatformName.WatchOS: - throw new InvalidOperationException ("CreateMinSupportedAttribute for WatchOS never makes sense"); + throw new InvalidOperationException ("CreateNoVersionSupportedAttribute for WatchOS never makes sense"); case PlatformName.MacCatalyst: - throw new InvalidOperationException ("CreateMinSupportedAttribute for Catalyst never makes sense"); + throw new InvalidOperationException ("CreateNoVersionSupportedAttribute for Catalyst never makes sense"); default: throw new NotImplementedException (); } @@ -3511,38 +3509,43 @@ bool IsInSupportedFramework (MemberInfo klass, PlatformName platform) { string ns = FindNamespace (klass); var list = GetFrameworkListForPlatform (platform); - // The framework is named wkwebkit but the namespace is webkit - if (list.Contains ("wkwebkit")) { - list.Add ("webkit"); - } return list.Contains(ns.ToLower (CultureInfo.InvariantCulture)); } - IEnumerable AddUnlistedAvailability (MemberInfo containingClass, List availability) + void AddUnlistedAvailability (MemberInfo containingClass, List availability) { - // If there are literally no attributes for a platform on a type, for non-catalyst platforms - // add a minimum supported introduced since it was "unlisted" + // If there are no unavailable attributes for a platform on a type + // add a supported introduced (without version) since it was "unlisted" (for non-catalyst platforms) foreach (var platform in new [] { PlatformName.iOS, PlatformName.TvOS, PlatformName.MacOSX }) { - if (!availability.Any (v => v.Platform == platform)) { - if (IsInSupportedFramework (containingClass, platform)) { - yield return CreateMinSupportedAttribute (platform); - } + if (!PlatformMarkedUnavailabile (platform, availability) && IsInSupportedFramework (containingClass, platform)) { + availability.Add (CreateNoVersionSupportedAttribute (platform)); } } } static void AddImpliedCatalyst (List memberAvailability) { - foreach (var attr in memberAvailability.Where (v => v.Platform == PlatformName.iOS && v is not ObsoletedAttribute).ToList()) { - if (!memberAvailability.Any (v => (v.Platform == PlatformName.MacCatalyst) && ImpliedKindsMatch (v.AvailabilityKind, attr.AvailabilityKind))) { + if (!PlatformMarkedUnavailabile (PlatformName.MacCatalyst, memberAvailability) && + !PlatformHasIntroduced (PlatformName.MacCatalyst, memberAvailability)) { + foreach (var attr in memberAvailability.Where (v => v.Platform == PlatformName.iOS).ToList()) { var newAttribute = CloneFromOtherPlatform (attr, PlatformName.MacCatalyst); - if (IsValidToCopyTo (memberAvailability, newAttribute)) { + if (IsValidToCopyTo (memberAvailability, newAttribute, allowIntroducedOnUnavailable: true)) { memberAvailability.Add (newAttribute); } } } } + static bool PlatformHasIntroduced (PlatformName platform, List memberAvailability) + { + return memberAvailability.Any (v => (v.Platform == platform && v is IntroducedAttribute)); + } + + static bool PlatformMarkedUnavailabile (PlatformName platform, List memberAvailability) + { + return memberAvailability.Any (v => (v.Platform == platform && v is UnavailableAttribute)); + } + // Especially for TV and Catalyst some entire namespaces are removed via framework_sources. // However, almost all of those bindings are [iOS] which AddImpliedCatalyst and other places // happily turn into other platforms. @@ -3554,6 +3557,12 @@ void StripIntroducedOnNamespaceNotIncluded (List memb // Walk all members and look for introduced that are nonsense for our containing class's platform foreach (var introduced in memberAvailability.Where (a => a.AvailabilityKind == AvailabilityKind.Introduced).ToList()) { + // Hack - WebKit namespace has two distinct implementations with different types + // It can not be hacked in IsInSupportedFramework as AddUnlistedAvailability + // will add iOS implied to the mac version and so on. So hard code it here... + if (FindNamespace (containingClass) == "WebKit" && introduced.Platform != PlatformName.TvOS) { + continue; + } if (!IsInSupportedFramework (containingClass, introduced.Platform)) { memberAvailability.Remove (introduced); droppedPlatforms.Add (introduced.Platform); @@ -3569,13 +3578,13 @@ void StripIntroducedOnNamespaceNotIncluded (List memb } } - static bool IsValidToCopyTo (List dest, AvailabilityBaseAttribute addition) + static bool IsValidToCopyTo (List dest, AvailabilityBaseAttribute addition, bool allowIntroducedOnUnavailable = false) { // If we are duplicating an existing attribute if (dest.Any (d => d.Platform == addition.Platform && d.AvailabilityKind == addition.AvailabilityKind)) return false; // If we are introduced and there is already an Unavailable - if (addition is IntroducedAttribute && dest.Any (d => d.Platform == addition.Platform && d.AvailabilityKind == AvailabilityKind.Unavailable)) + if (!allowIntroducedOnUnavailable && (addition is IntroducedAttribute && dest.Any (d => d.Platform == addition.Platform && d.AvailabilityKind == AvailabilityKind.Unavailable))) return false; return true; } @@ -3684,17 +3693,17 @@ AvailabilityBaseAttribute [] GetPlatformAttributesToPrint (MemberInfo mi, Type t availabilityToConsider = availabilityToConsider.Where (x => x.Platform != PlatformName.WatchOS).ToList(); // Add any implied non-catalyst introduced (Catalyst will come later) - availabilityToConsider.AddRange (AddUnlistedAvailability (context, availabilityToConsider)); + AddUnlistedAvailability (context, availabilityToConsider); - // Copy down any unavailable from the parent before expanding, since a [NoMacCatalyst] on the type trumps [iOS] on a member - CopyValidAttributes (memberAvailability, availabilityToConsider.Where (attr => attr.AvailabilityKind != AvailabilityKind.Introduced).Select (attr => CloneFromOtherPlatform (attr, attr.Platform))); + // Copy down any unavailable from the parent before expanding, since a [NoMacCatalyst ] on the type trumps [iOS] on a member + CopyValidAttributes (memberAvailability, availabilityToConsider.Where (attr => attr.AvailabilityKind != AvailabilityKind.Introduced)); // Add implied catalyst from [iOS] _before_ copying down from parent if no catalyst attributes // As those take precedent. We will do this a second time later in a moment.. AddImpliedCatalyst (memberAvailability); // Now copy it down introduced from the parent - CopyValidAttributes (memberAvailability, availabilityToConsider.Where (attr => attr.AvailabilityKind == AvailabilityKind.Introduced).Select (attr => CloneFromOtherPlatform (attr, attr.Platform))); + CopyValidAttributes (memberAvailability, availabilityToConsider.Where (attr => attr.AvailabilityKind == AvailabilityKind.Introduced)); // Now expand the implied catalyst from [iOS] a second time // This is needed in some cases where the only iOS information is in the @@ -3715,7 +3724,7 @@ AvailabilityBaseAttribute [] GetPlatformAttributesToPrint (MemberInfo mi, Type t return memberAvailability.ToArray (); } - public bool PrintPlatformAttributes (MemberInfo mi, Type type = null) + public bool PrintPlatformAttributes (MemberInfo mi, Type type = null, bool is_enum = false) { bool printed = false; if (mi == null) @@ -3723,7 +3732,7 @@ public bool PrintPlatformAttributes (MemberInfo mi, Type type = null) AvailabilityBaseAttribute [] type_ca = null; - foreach (var availability in GetPlatformAttributesToPrint (mi, type, mi.DeclaringType)) { + foreach (var availability in GetPlatformAttributesToPrint (mi, is_enum ? mi.DeclaringType : type, is_enum ? null : mi.DeclaringType)) { var t = type ?? (mi as TypeInfo) ?? mi.DeclaringType; if (type_ca == null) { if (t != null) @@ -5288,7 +5297,9 @@ void GenerateProperty (Type type, PropertyInfo pi, List instance_fields_ use_underscore ? "_" : ""); indent++; if (pi.CanRead) { +#if !NET PrintAttributes (pi, platform:true); +#endif PrintAttributes (pi.GetGetMethod (), platform:true, preserve:true, advice:true); print ("get {"); indent++; @@ -5308,7 +5319,9 @@ void GenerateProperty (Type type, PropertyInfo pi, List instance_fields_ print ("}"); } if (pi.CanWrite) { +#if !NET PrintAttributes (pi, platform:true); +#endif PrintAttributes (pi.GetSetMethod (), platform:true, preserve:true, advice:true); print ("set {"); indent++; diff --git a/src/homekit.cs b/src/homekit.cs index 94c33eda27c5..fe50e6f5c0a2 100644 --- a/src/homekit.cs +++ b/src/homekit.cs @@ -635,7 +635,7 @@ partial interface HMHome { void UnblockAccessory (HMAccessory accessory, Action completion); [Deprecated (PlatformName.iOS, 15, 4, message: "Use 'HMAccessorySetupManager.PerformAccessorySetup' instead.")] - [NoWatch, NoTV, iOS (10,0)] + [NoWatch, NoTV, iOS (10,0)][NoMacCatalyst] [Async] [Export ("addAndSetupAccessoriesWithCompletionHandler:")] void AddAndSetupAccessories (Action completion); diff --git a/tests/cecil-tests/AttributeTest.cs b/tests/cecil-tests/AttributeTest.cs index f2c05be9aad1..dd0663049973 100644 --- a/tests/cecil-tests/AttributeTest.cs +++ b/tests/cecil-tests/AttributeTest.cs @@ -314,6 +314,19 @@ static bool IgnoreElementsThatDoNotExistInThatAssembly (string member) case "Intents.INPerson.get_VocabularyIdentifier": case "MetricKit.MXUnitSignalBars.get_Symbol": case "MetricKit.MXUnitAveragePixelLuminance.get_Symbol": + case "WebKit.DomNode.Copy": + case "WebKit.DomEventTarget.Copy": + case "WebKit.DomObject.Copy": + case "WebKit.WebArchive.Copy": + case "WebKit.WebHistoryItem.Copy": + case "CoreWlan.CWConfiguration.Copy": + case "CoreWlan.CWConfiguration.MutableCopy": + case "CoreWlan.CWChannel.Copy": + case "CoreWlan.CWMutableNetworkProfile.Copy": + case "CoreWlan.CWMutableNetworkProfile.MutableCopy": + case "CoreWlan.CWNetwork.Copy": + case "CoreWlan.CWNetworkProfile.Copy": + case "CoreWlan.CWNetworkProfile.MutableCopy": return true; } // Generator Bug/Limitation - Related to ^, Wrapper protocol get/set with attributes diff --git a/tests/introspection/ApiAvailabilityTest.cs b/tests/introspection/ApiAvailabilityTest.cs index 22f4b8a35b32..4a07dca5c5f2 100644 --- a/tests/introspection/ApiAvailabilityTest.cs +++ b/tests/introspection/ApiAvailabilityTest.cs @@ -368,18 +368,35 @@ AvailabilityBaseAttribute GetAvailable (ICustomAttributeProvider cap, out Versio void CheckUnavailable (Type t, bool typeUnavailable, Version? typeUnavailableVersion, MemberInfo m) { + // Turns out Version (13, 1, 0) > Version (13, 1) since undefined fields are -1 + // However, we consider them equal, so force a 0 Build if set to -1 + if (typeUnavailableVersion is not null && typeUnavailableVersion.Build == -1) { + typeUnavailableVersion = new Version (typeUnavailableVersion.Major, typeUnavailableVersion.Minor, 0); + } #if NET switch (t.FullName) { case "MediaPlayer.MPMoviePlayerController": + case "AppKit.NSDrawer": + case "ImageKit.IKImageBrowserView": return; } #endif var ma = GetAvailable (m, out var availableVersion); if (typeUnavailable && (ma != null)) { if (typeUnavailableVersion is not null && availableVersion is not null) { +#if NET + // Introduced and Deprecated in same version happens a lot in catalyst + if (availableVersion > typeUnavailableVersion) +#else if (availableVersion >= typeUnavailableVersion) +#endif AddErrorLine ($"[FAIL] {m} in {m.DeclaringType.FullName} is marked with {ma} in {availableVersion} but the type {t.FullName} is [Unavailable ({Platform})] in {typeUnavailableVersion}"); - } else { + } +#if NET + // Availabile with no version and unavailable is a common valid pattern in NET-land + else if (typeUnavailableVersion is not null && availableVersion is null) { } +#endif + else { AddErrorLine ($"[FAIL] {m} in {m.DeclaringType.FullName} is marked with {ma} but the type {t.FullName} is [Unavailable ({Platform})]"); } } @@ -533,6 +550,17 @@ protected virtual bool SkipUnavailable (Type type, string memberName) return true; } break; + // Apple itself is inconsistent in the availability of the type compared to these selectors + case "AVFoundation.AVCaptureStillImageOutput": + switch (memberName) { + case "AutomaticallyEnablesStillImageStabilizationWhenAvailable": + case "CapturingStillImage": + case "HighResolutionStillImageOutputEnabled": + case "IsStillImageStabilizationActive": + case "IsStillImageStabilizationSupported": + return true; + } + break; #endif case "CarPlay.CPApplicationDelegate": switch (memberName) { @@ -598,51 +626,6 @@ protected virtual bool SkipUnavailable (Type type, string memberName) break; } } -#if NET - // These are temporary ignores until the generator changes are in for NET6 attributes - switch (type.FullName) { - case "GLKit.GLKTextureOperations": { - switch (memberName) { - case "SRGB": - return true; - } - break; - } - case "MapKit.MKOverlayView": { - switch (memberName) { - case "MKRoadWidthAtZoomScale": - return true; - } - break; - } - case "MobileCoreServices.UTType": { - switch (memberName) { - case "Equals": - case "IsDynamic": - case "IsDeclared": - case "CopyAllTags": - return true; - } - break; - } - case "Security.SecSharedCredential": { - switch (memberName) { - case "RequestSharedWebCredential": - return true; - } - break; - } - case "Security.SslContext": { - switch (memberName) { - case "SetEncryptionCertificate": - case "SetSessionStrengthPolicy": - case "GetRequestedPeerName": - return true; - } - break; - } - } -#endif return false; } From 22ec8551c49703b0c8a33e3fe6d27bfba3d495aa Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Thu, 28 Apr 2022 14:05:38 -0500 Subject: [PATCH 16/19] More test fixes --- src/Metal/MTLEnums.cs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Metal/MTLEnums.cs b/src/Metal/MTLEnums.cs index 7d7a74f0fed6..5f8f472ff3ca 100644 --- a/src/Metal/MTLEnums.cs +++ b/src/Metal/MTLEnums.cs @@ -743,33 +743,33 @@ public enum MTLFeatureSet : ulong { iOS_GPUFamily2_v1 = 1, iOS_GPUFamily2_v2 = 3, iOS_GPUFamily3_v1 = 4, - [iOS (10,0), NoTV, NoWatch, NoMac] + [iOS (10,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily1_v3 = 5, - [iOS (10,0), NoTV, NoWatch, NoMac] + [iOS (10,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily2_v3 = 6, - [iOS (10,0), NoTV, NoWatch, NoMac] + [iOS (10,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily3_v2 = 7, - [iOS (11,0), NoTV, NoWatch, NoMac] + [iOS (11,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily1_v4 = 8, - [iOS (11,0), NoTV, NoWatch, NoMac] + [iOS (11,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily2_v4 = 9, - [iOS (11,0), NoTV, NoWatch, NoMac] + [iOS (11,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily3_v3 = 10, - [iOS (11,0), NoTV, NoWatch, NoMac] + [iOS (11,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily4_v1 = 11, - [iOS (12,0), NoTV, NoWatch, NoMac] + [iOS (12,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily1_v5 = 12, - [iOS (12,0), NoTV, NoWatch, NoMac] + [iOS (12,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily2_v5 = 13, - [iOS (12,0), NoTV, NoWatch, NoMac] + [iOS (12,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily3_v4 = 14, - [iOS (12,0), NoTV, NoWatch, NoMac] + [iOS (12,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily4_v2 = 15, - [iOS (12,0), NoTV, NoWatch, NoMac] + [iOS (12,0), NoTV, NoWatch, NoMac, NoMacCatalyst] iOS_GPUFamily5_v1 = 16, - [Mac (10,11), NoiOS, NoTV, NoWatch] + [Mac (10,11), NoiOS, NoTV, NoWatch, NoMacCatalyst] macOS_GPUFamily1_v1 = 10000, #if !NET @@ -832,7 +832,7 @@ public enum MTLFeatureSet : ulong { [iOS (9,0)][Mac (10,11)] [Native] public enum MTLLanguageVersion : ulong { - [NoMac] + [NoMac][NoMacCatalyst] v1_0 = (1 << 16), v1_1 = (1 << 16) + 1, [iOS (10,0), TV (10,0), NoWatch, Mac (10,12)] From b6f692c95b1f1735b938da1c488c102977b006fe Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Thu, 28 Apr 2022 14:29:12 -0500 Subject: [PATCH 17/19] Remove now unnecessary hack --- tests/introspection/ApiAvailabilityTest.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/introspection/ApiAvailabilityTest.cs b/tests/introspection/ApiAvailabilityTest.cs index 4a07dca5c5f2..9032ed6ae701 100644 --- a/tests/introspection/ApiAvailabilityTest.cs +++ b/tests/introspection/ApiAvailabilityTest.cs @@ -373,14 +373,7 @@ void CheckUnavailable (Type t, bool typeUnavailable, Version? typeUnavailableVer if (typeUnavailableVersion is not null && typeUnavailableVersion.Build == -1) { typeUnavailableVersion = new Version (typeUnavailableVersion.Major, typeUnavailableVersion.Minor, 0); } -#if NET - switch (t.FullName) { - case "MediaPlayer.MPMoviePlayerController": - case "AppKit.NSDrawer": - case "ImageKit.IKImageBrowserView": - return; - } -#endif + var ma = GetAvailable (m, out var availableVersion); if (typeUnavailable && (ma != null)) { if (typeUnavailableVersion is not null && availableVersion is not null) { From 13a21bee9c5087fa0456d3c72cd6a4cc3126e300 Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Fri, 29 Apr 2022 06:04:03 -0500 Subject: [PATCH 18/19] Code review changes --- src/generator-attributes.cs | 2 +- src/generator.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/generator-attributes.cs b/src/generator-attributes.cs index c7d0c94dd317..a61035885b24 100644 --- a/src/generator-attributes.cs +++ b/src/generator-attributes.cs @@ -925,7 +925,7 @@ void GeneratePlatformDefine (StringBuilder builder) builder.AppendLine ("#if __MACOS__"); break; case PlatformName.MacCatalyst: - builder.AppendLine ("#if __MACCATALYST__ && !__IOS__ && !__MACOS__"); + builder.AppendLine ("#if __MACCATALYST__ && !__IOS__"); break; default: throw new NotSupportedException ($"Unknown platform: {Platform}"); diff --git a/src/generator.cs b/src/generator.cs index 6138a4ccf5f8..041fb8872f5e 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3517,7 +3517,7 @@ void AddUnlistedAvailability (MemberInfo containingClass, List memberAvailability) { - if (!PlatformMarkedUnavailabile (PlatformName.MacCatalyst, memberAvailability) && + if (!PlatformMarkedUnavailable (PlatformName.MacCatalyst, memberAvailability) && !PlatformHasIntroduced (PlatformName.MacCatalyst, memberAvailability)) { foreach (var attr in memberAvailability.Where (v => v.Platform == PlatformName.iOS).ToList()) { var newAttribute = CloneFromOtherPlatform (attr, PlatformName.MacCatalyst); @@ -3541,7 +3541,7 @@ static bool PlatformHasIntroduced (PlatformName platform, List (v.Platform == platform && v is IntroducedAttribute)); } - static bool PlatformMarkedUnavailabile (PlatformName platform, List memberAvailability) + static bool PlatformMarkedUnavailable (PlatformName platform, List memberAvailability) { return memberAvailability.Any (v => (v.Platform == platform && v is UnavailableAttribute)); } @@ -3695,7 +3695,7 @@ AvailabilityBaseAttribute [] GetPlatformAttributesToPrint (MemberInfo mi, Type t // Add any implied non-catalyst introduced (Catalyst will come later) AddUnlistedAvailability (context, availabilityToConsider); - // Copy down any unavailable from the parent before expanding, since a [NoMacCatalyst ] on the type trumps [iOS] on a member + // Copy down any unavailable from the parent before expanding, since a [NoMacCatalyst] on the type trumps [iOS] on a member CopyValidAttributes (memberAvailability, availabilityToConsider.Where (attr => attr.AvailabilityKind != AvailabilityKind.Introduced)); // Add implied catalyst from [iOS] _before_ copying down from parent if no catalyst attributes From 30ea4ae71a0bf54927fc37208ce74eebb8692b2d Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Fri, 29 Apr 2022 11:40:36 -0500 Subject: [PATCH 19/19] Fix 3rd party binding having no attributes due to StripIntroducedOnNamespaceNotIncluded always assuming we're core --- src/generator.cs | 12 +++++++----- tests/generator/BGenTests.cs | 8 +++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/generator.cs b/src/generator.cs index 041fb8872f5e..5ac7733a1528 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3710,11 +3710,13 @@ AvailabilityBaseAttribute [] GetPlatformAttributesToPrint (MemberInfo mi, Type t // parent context, but we want to let any local iOS override a catalyst on the parent AddImpliedCatalyst (memberAvailability); - // If all of this implication gives us something silly, like being introduced - // on a type that is on a namespace we don't support, ignore those Supported - StripIntroducedOnNamespaceNotIncluded (memberAvailability, context); - if (inlinedType != null) { - StripIntroducedOnNamespaceNotIncluded (memberAvailability, inlinedType); + if (!BindThirdPartyLibrary) { + // If all of this implication gives us something silly, like being introduced + // on a type that is on a namespace we don't support, ignore those Supported + StripIntroducedOnNamespaceNotIncluded (memberAvailability, context); + if (inlinedType != null) { + StripIntroducedOnNamespaceNotIncluded (memberAvailability, inlinedType); + } } // Remove any duplicates attributes as well diff --git a/tests/generator/BGenTests.cs b/tests/generator/BGenTests.cs index bdb0f5688fa7..11e797b2139f 100644 --- a/tests/generator/BGenTests.cs +++ b/tests/generator/BGenTests.cs @@ -238,7 +238,13 @@ public void Bug35176 () const string attrib = "IntroducedAttribute"; #endif var preserves = allMembers.Sum ((v) => v.CustomAttributes.Count ((ca) => ca.AttributeType.Name == attrib)); - Assert.AreEqual (10, preserves, "Introduced attribute count"); // If you modified code that generates IntroducedAttributes please update the attribute count + Assert.AreEqual ( +#if NET + 36, // This number should be lower - https://github.com/xamarin/xamarin-macios/issues/14802 +#else + 10, +#endif + preserves, "Introduced attribute count"); // If you modified code that generates IntroducedAttributes please update the attribute count } [Test]