Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spritekit] Audit fixes (xtro) #2577

Merged
merged 1 commit into from
Sep 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ SOCIAL_SOURCES = \

# SpriteKit

SPRITEKIT_CORE_SOURCES = \
SPRITEKIT_API_SOURCES = \
SpriteKit/Enums.cs \

SPRITEKIT_SOURCES = \
Expand Down
54 changes: 44 additions & 10 deletions src/spritekit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ interface SK3DNode {
}


[DisableDefaultCtor] // DesignatedInitializer below
#if MONOMAC
[Mac (10,9, onlyOn64 : true)]
[BaseType (typeof (NSResponder))]
Expand All @@ -132,6 +133,10 @@ partial interface SKNode : NSCoding, NSCopying, UIFocusItem {
[BaseType (typeof (NSObject))]
partial interface SKNode : NSCoding, NSCopying {
#endif
[DesignatedInitializer]
[Export ("init")]
IntPtr Constructor ();

[Static, Export ("node")]
SKNode Create ();

Expand Down Expand Up @@ -321,11 +326,13 @@ partial interface SKNode : NSCoding, NSCopying {
[Export ("obstaclesFromSpriteTextures:accuracy:")]
GKPolygonObstacle[] ObstaclesFromSpriteTextures (SKNode[] sprites, float accuracy);

#if !XAMCORE_4_0
[Deprecated (PlatformName.iOS, 10,0, message: "Attributes are only available for node classes supporting SKShader (see SKSpriteNode etc.).")]
[Deprecated (PlatformName.MacOSX, 10,12, message: "Attributes are only available for node classes supporting SKShader (see SKSpriteNode etc.).")]
[iOS (9,0),Mac(10,11)]
[Export ("attributeValues", ArgumentSemantic.Copy)]
NSDictionary<NSString, SKAttributeValue> AttributeValues { get; set; }

#if !XAMCORE_4_0
[Deprecated (PlatformName.iOS, 10,0, message: "Attributes are only available for node classes supporting SKShader (see SKSpriteNode etc.).")]
[Deprecated (PlatformName.MacOSX, 10,12, message: "Attributes are only available for node classes supporting SKShader (see SKSpriteNode etc.).")]
[iOS (9,0),Mac(10,11)]
Expand Down Expand Up @@ -409,7 +416,10 @@ partial interface SKEffectNode : SKWarpable {
[Export ("shader", ArgumentSemantic.Retain)]
SKShader Shader { get; set; }

#if XAMCORE_4_0
[iOS (9,0),Mac(10,11)]
[Export ("attributeValues", ArgumentSemantic.Copy)]
NSDictionary<NSString, SKAttributeValue> AttributeValues { get; set; }

[iOS (9,0), Mac(10,11)]
[Export ("valueForAttributeNamed:")]
[return: NullAllowed]
Expand All @@ -418,7 +428,6 @@ partial interface SKEffectNode : SKWarpable {
[iOS (9,0), Mac(10,11)]
[Export ("setValue:forAttributeNamed:")]
void SetValue (SKAttributeValue value, string key);
#endif
}

delegate Vector3 SKFieldForceEvaluator (/* vector_float3 */ Vector4 position, /* vector_float3 */ Vector4 velocity, float /* float, not CGFloat */ mass, float /* float, not CGFloat */ charge, double time);
Expand Down Expand Up @@ -758,7 +767,10 @@ partial interface SKSpriteNode : SKWarpable {
[Export ("scaleToSize:")]
void ScaleTo (CGSize size);

#if XAMCORE_4_0
[iOS (9,0),Mac(10,11)]
[Export ("attributeValues", ArgumentSemantic.Copy)]
NSDictionary<NSString, SKAttributeValue> AttributeValues { get; set; }

[iOS (9,0), Mac(10,11)]
[Export ("valueForAttributeNamed:")]
[return: NullAllowed]
Expand All @@ -767,7 +779,6 @@ partial interface SKSpriteNode : SKWarpable {
[iOS (9,0), Mac(10,11)]
[Export ("setValue:forAttributeNamed:")]
void SetValue (SKAttributeValue value, string key);
#endif
}

[Watch (3,0)]
Expand Down Expand Up @@ -992,7 +1003,10 @@ partial interface SKEmitterNode {
[Export ("particleRenderOrder", ArgumentSemantic.Assign)]
SKParticleRenderOrder ParticleRenderOrder { get; set; }

#if XAMCORE_4_0
[iOS (9,0),Mac(10,11)]
[Export ("attributeValues", ArgumentSemantic.Copy)]
NSDictionary<NSString, SKAttributeValue> AttributeValues { get; set; }

[iOS (9,0), Mac(10,11)]
[Export ("valueForAttributeNamed:")]
[return: NullAllowed]
Expand All @@ -1001,7 +1015,6 @@ partial interface SKEmitterNode {
[iOS (9,0), Mac(10,11)]
[Export ("setValue:forAttributeNamed:")]
void SetValue (SKAttributeValue value, string key);
#endif
}

[Watch (3,0)]
Expand Down Expand Up @@ -1275,13 +1288,27 @@ interface SKLightNode {
uint CategoryBitMask { get; set; } /* uint32_t */
}

[NoWatch]
[Watch (4,0)]
[Mac (10,9, onlyOn64 : true)]
[Since (7,0)]
[BaseType (typeof (SKNode))]
partial interface SKVideoNode {

[NoWatch]
#if WATCH
[Static, Export ("videoNodeWithFileNamed:")]
SKVideoNode VideoNodeWithFileNamed (string videoFile);

[Static, Export ("videoNodeWithURL:")]
SKVideoNode VideoNodeWithURL (NSUrl videoURL);

[DesignatedInitializer]
[Export ("initWithFileNamed:")]
IntPtr Constructor (string videoFile);

[DesignatedInitializer]
[Export ("initWithURL:")]
IntPtr Constructor (NSUrl url);
#else
[Static, Export ("videoNodeWithAVPlayer:")]
SKVideoNode FromPlayer (AVPlayer player);

Expand All @@ -1297,7 +1324,6 @@ partial interface SKVideoNode {
[Static, Export ("videoNodeWithURL:"), Internal]
SKVideoNode VideoNodeWithURL (NSUrl videoURL);

[NoWatch]
[DesignatedInitializer]
[Export ("initWithAVPlayer:")]
IntPtr Constructor (AVPlayer player);
Expand All @@ -1313,10 +1339,13 @@ partial interface SKVideoNode {

[Export ("initWithURL:"), Internal]
IntPtr InitWithURL (NSUrl url);
#endif

[NoWatch]
[Export ("play")]
void Play ();

[NoWatch]
[Export ("pause")]
void Pause ();

Expand Down Expand Up @@ -2865,8 +2894,13 @@ interface SKAttribute : NSCoding

[iOS (9,0)][Mac (10,11, onlyOn64 : true)]
[BaseType (typeof(NSObject))]
[DisableDefaultCtor] // DesignatedInitializer below
interface SKAttributeValue : NSCoding
{
[DesignatedInitializer]
[Export ("init")]
IntPtr Constructor ();

[Static]
[Export ("valueWithFloat:")]
SKAttributeValue Create (float value);
Expand Down
6 changes: 6 additions & 0 deletions tests/xtro-sharpie/osx.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
!missing-pinvoke! NSDataFromGCMicroGamepadSnapShotDataV100 is not bound


# SpriteKit

## This enum is not used in macOS API so it makes not sense to expose it
!missing-enum! SKNodeFocusBehavior not bound


# fixed in XAMCORE_3_0

## 8a6099b8027fa8e1ad1e032c731c7f750619303e
Expand Down