[introspection] Fix bindings so the tests pass (#254)
- Added missing NSCopying, NSCoding and NSSecureCoding. - Filled radar://26939747 with Apple - https://trello.com/c/6aIzLH4a
This commit is contained in:
Родитель
004fe2f8d8
Коммит
ca718991df
|
@ -273,7 +273,11 @@ namespace XamCore.Contacts {
|
|||
[iOS (9,0), Mac (10,11, onlyOn64: true)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
[DisableDefaultCtor] // using init raises an exception according to docs
|
||||
#if !MONOMAC
|
||||
public interface CNContactFetchRequest : NSSecureCoding {
|
||||
#else
|
||||
public interface CNContactFetchRequest {
|
||||
#endif
|
||||
|
||||
[DesignatedInitializer]
|
||||
[Export ("initWithKeysToFetch:")]
|
||||
|
|
|
@ -954,7 +954,7 @@ namespace XamCore.Foundation
|
|||
|
||||
[Since (3,2)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
public interface NSCharacterSet : NSCoding, NSMutableCopying {
|
||||
public interface NSCharacterSet : NSSecureCoding, NSMutableCopying {
|
||||
[Static, Export ("alphanumericCharacterSet")]
|
||||
NSCharacterSet Alphanumerics {get;}
|
||||
|
||||
|
|
|
@ -87,7 +87,11 @@ namespace XamCore.GameplayKit {
|
|||
// https://bugzilla.xamarin.com/show_bug.cgi?id=4391
|
||||
[iOS (9,0), Mac (10,11, onlyOn64 : true)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
#if !MONOMAC
|
||||
interface GKBehavior : NSCopying {
|
||||
#else
|
||||
interface GKBehavior {
|
||||
#endif
|
||||
|
||||
[Export ("goalCount")]
|
||||
nint GoalCount { get; }
|
||||
|
@ -136,7 +140,11 @@ namespace XamCore.GameplayKit {
|
|||
[iOS (9,0), Mac (10,11, onlyOn64 : true)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
[Abstract]
|
||||
#if !MONOMAC
|
||||
interface GKComponent : NSCopying, NSCoding {
|
||||
#else
|
||||
interface GKComponent : NSCopying {
|
||||
#endif
|
||||
|
||||
[NullAllowed]
|
||||
[Export ("entity", ArgumentSemantic.Weak)]
|
||||
|
@ -189,7 +197,11 @@ namespace XamCore.GameplayKit {
|
|||
|
||||
[iOS (9,0), Mac (10,11, onlyOn64 : true)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
#if !MONOMAC
|
||||
interface GKEntity : NSCopying, NSCoding {
|
||||
#else
|
||||
interface GKEntity : NSCopying {
|
||||
#endif
|
||||
|
||||
[Static]
|
||||
[Export ("entity")]
|
||||
|
@ -346,7 +358,11 @@ namespace XamCore.GameplayKit {
|
|||
|
||||
[iOS (9,0), Mac (10,11, onlyOn64 : true)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
#if !MONOMAC
|
||||
interface GKGraph : NSCopying, NSCoding {
|
||||
#else
|
||||
interface GKGraph {
|
||||
#endif
|
||||
|
||||
[NullAllowed]
|
||||
[Export ("nodes")]
|
||||
|
@ -459,7 +475,11 @@ namespace XamCore.GameplayKit {
|
|||
|
||||
[iOS (9,0), Mac (10,11, onlyOn64 : true)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
#if !MONOMAC
|
||||
interface GKGraphNode : NSCoding {
|
||||
#else
|
||||
interface GKGraphNode {
|
||||
#endif
|
||||
|
||||
[Export ("connectedNodes")]
|
||||
GKGraphNode [] ConnectedNodes { get; }
|
||||
|
@ -594,7 +614,11 @@ namespace XamCore.GameplayKit {
|
|||
[iOS (9,0), Mac (10,11, onlyOn64 : true)]
|
||||
[DisableDefaultCtor]
|
||||
[BaseType (typeof (GKObstacle))]
|
||||
#if !MONOMAC
|
||||
interface GKPolygonObstacle : NSCoding {
|
||||
#else
|
||||
interface GKPolygonObstacle {
|
||||
#endif
|
||||
|
||||
[Export ("vertexCount")]
|
||||
nuint VertexCount { get; }
|
||||
|
|
|
@ -391,6 +391,9 @@ namespace XamCore.ModelIO {
|
|||
[iOS (9,0)][Mac (10,11, onlyOn64 : true)]
|
||||
[BaseType (typeof(NSObject))]
|
||||
[DisableDefaultCtor]
|
||||
// TODO: NSCopying defined but copyWithZone doesn't work
|
||||
// filled radar://26939747 with Apple
|
||||
// https://trello.com/c/6aIzLH4a
|
||||
interface MDLMaterialProperty : MDLNamed
|
||||
{
|
||||
[DesignatedInitializer]
|
||||
|
@ -1171,8 +1174,12 @@ namespace XamCore.ModelIO {
|
|||
|
||||
[iOS (9,0), Mac(10,11, onlyOn64 : true)]
|
||||
[BaseType (typeof(NSObject))]
|
||||
interface MDLTransform : MDLTransformComponent
|
||||
{
|
||||
#if !MONOMAC
|
||||
interface MDLTransform : MDLTransformComponent, NSCopying {
|
||||
#else
|
||||
interface MDLTransform : MDLTransformComponent {
|
||||
#endif
|
||||
|
||||
[Export ("initWithTransformComponent:")]
|
||||
IntPtr Constructor (IMDLTransformComponent component);
|
||||
|
||||
|
|
|
@ -1051,7 +1051,11 @@ namespace XamCore.NetworkExtension {
|
|||
[iOS (9,0)][Mac (10,11, onlyOn64 : true)]
|
||||
[BaseType (typeof (NSObject))]
|
||||
[Abstract]
|
||||
#if !MONOMAC
|
||||
interface NWEndpoint : NSSecureCoding, NSCopying {
|
||||
#else
|
||||
interface NWEndpoint {
|
||||
#endif
|
||||
}
|
||||
|
||||
[iOS (9,0)][Mac (10,11, onlyOn64 : true)]
|
||||
|
|
|
@ -159,7 +159,11 @@ namespace XamCore.WebKit
|
|||
|
||||
[iOS (8,0), Mac (10,10, onlyOn64 : true)] // Not defined in 32-bit
|
||||
[BaseType (typeof (NSObject))]
|
||||
#if !MONOMAC
|
||||
interface WKPreferences : NSCoding {
|
||||
#else
|
||||
interface WKPreferences {
|
||||
#endif
|
||||
[Export ("minimumFontSize")]
|
||||
nfloat MinimumFontSize { get; set; }
|
||||
|
||||
|
@ -263,8 +267,12 @@ namespace XamCore.WebKit
|
|||
|
||||
[iOS (9,0), Mac(10,11, onlyOn64 : true)]
|
||||
[BaseType (typeof(NSObject))]
|
||||
interface WKWebsiteDataStore
|
||||
{
|
||||
#if !MONOMAC
|
||||
interface WKWebsiteDataStore : NSCoding {
|
||||
#else
|
||||
interface WKWebsiteDataStore {
|
||||
#endif
|
||||
|
||||
[Static]
|
||||
[Export ("defaultDataStore")]
|
||||
WKWebsiteDataStore DefaultDataStore { get; }
|
||||
|
@ -316,7 +324,11 @@ namespace XamCore.WebKit
|
|||
|
||||
[iOS (8,0), Mac (10,10, onlyOn64 : true)] // Not defined in 32-bit
|
||||
[BaseType (typeof (NSObject))]
|
||||
#if !MONOMAC
|
||||
interface WKUserContentController : NSCoding {
|
||||
#else
|
||||
interface WKUserContentController {
|
||||
#endif
|
||||
|
||||
[Export ("userScripts")]
|
||||
WKUserScript [] UserScripts { get; }
|
||||
|
@ -496,7 +508,11 @@ namespace XamCore.WebKit
|
|||
|
||||
[iOS (8,0), Mac (10,10, onlyOn64 : true)] // Not defined in 32-bit
|
||||
[BaseType (typeof (NSObject))]
|
||||
#if !MONOMAC
|
||||
interface WKWebViewConfiguration : NSCopying, NSCoding {
|
||||
#else
|
||||
interface WKWebViewConfiguration : NSCopying {
|
||||
#endif
|
||||
|
||||
[Export ("processPool", ArgumentSemantic.Retain)]
|
||||
WKProcessPool ProcessPool { get; set; }
|
||||
|
@ -549,7 +565,11 @@ namespace XamCore.WebKit
|
|||
|
||||
[iOS (8,0), Mac (10,10, onlyOn64 : true)] // Not defined in 32-bit
|
||||
[BaseType (typeof (NSObject))]
|
||||
#if !MONOMAC
|
||||
interface WKProcessPool : NSCoding {
|
||||
#else
|
||||
interface WKProcessPool {
|
||||
#endif
|
||||
// as of Mac 10.10, iOS 8.0 Beta 2,
|
||||
// this interface is completely empty
|
||||
}
|
||||
|
|
|
@ -73,6 +73,14 @@ namespace Introspection {
|
|||
case "GKScore":
|
||||
// new in iOS8 and 10.0
|
||||
case "NSExtensionContext":
|
||||
// TODO: MDLMaterialProperty has NSCopying defined but copyWithZone doesn't work
|
||||
// filled radar://26939747 with Apple
|
||||
// https://trello.com/c/6aIzLH4a
|
||||
case "MDLMaterialProperty":
|
||||
case "NSLayoutAnchor`1":
|
||||
case "NSLayoutDimension":
|
||||
case "NSLayoutXAxisAnchor":
|
||||
case "NSLayoutYAxisAnchor":
|
||||
return true; // skip
|
||||
}
|
||||
break;
|
||||
|
@ -89,6 +97,12 @@ namespace Introspection {
|
|||
// new in iOS8 and 10.0
|
||||
case "NSExtensionContext":
|
||||
case "NSItemProvider":
|
||||
// iOS9 / 10.11
|
||||
case "CNSaveRequest":
|
||||
case "NSLayoutAnchor`1":
|
||||
case "NSLayoutDimension":
|
||||
case "NSLayoutXAxisAnchor":
|
||||
case "NSLayoutYAxisAnchor":
|
||||
// undocumented
|
||||
return true;
|
||||
}
|
||||
|
@ -109,6 +123,7 @@ namespace Introspection {
|
|||
case "NSMutableParagraphStyle": //17770106
|
||||
return true; // skip
|
||||
// iOS9 / 10.11
|
||||
case "CNSaveRequest":
|
||||
case "NSPersonNameComponentsFormatter":
|
||||
return true; // skip
|
||||
}
|
||||
|
|
|
@ -243,6 +243,7 @@ namespace Introspection {
|
|||
case "HKQuantitySample":
|
||||
case "HKSample":
|
||||
case "HKWorkout":
|
||||
case "PKPaymentMethod":
|
||||
// iOS 10
|
||||
case "CXCallDirectoryExtensionContext":
|
||||
case "SFSafariViewControllerConfiguration":
|
||||
|
|
|
@ -191,6 +191,15 @@ namespace MonoTouchFixtures.ModelIO {
|
|||
Assert.AreEqual (3.1415f, obj.FloatValue, "11 FloatValue");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Ignore ("MDLMaterialProperty has NSCopying defined but copyWithZone doesn't work. radar://26939747 - https://trello.com/c/6aIzLH4a")]
|
||||
public void Copy ()
|
||||
{
|
||||
using (var obj = new MDLMaterialProperty ("name", MDLMaterialSemantic.AmbientOcclusion)) {
|
||||
Assert.IsNotNull (obj.Copy ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче