Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tj-devel709/ae2413a9777a935664d225c7fe59a7e9 to your computer and use it in GitHub Desktop.
Save tj-devel709/ae2413a9777a935664d225c7fe59a7e9 to your computer and use it in GitHub Desktop.
diff --git a/external/mono b/external/mono
--- a/external/mono
+++ b/external/mono
@@ -1 +1 @@
-Subproject commit 537654c1c79564668e4cab9735be613028328a70
+Subproject commit 537654c1c79564668e4cab9735be613028328a70-dirty
diff --git a/src/GameController/Enums.cs b/src/GameController/Enums.cs
index e8dc3bd4d..93826ca66 100644
--- a/src/GameController/Enums.cs
+++ b/src/GameController/Enums.cs
@@ -12,6 +12,9 @@ using ObjCRuntime;
using Foundation;
namespace GameController {
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
[Native]
public enum GCExtendedGamepadSnapshotDataVersion : long
{
diff --git a/src/GameController/GCExtendedGamepadSnapshot.cs b/src/GameController/GCExtendedGamepadSnapshot.cs
index 44ce4a21f..69127bc06 100644
--- a/src/GameController/GCExtendedGamepadSnapshot.cs
+++ b/src/GameController/GCExtendedGamepadSnapshot.cs
@@ -49,6 +49,12 @@ namespace GameController {
// Buttons in the range [0.0, 1.0]
public float /* float_t = float */ LeftTrigger;
public float /* float_t = float */ RightTrigger;
+ [iOS (12,2), Mac (10,14,4, onlyOn64: true), TV (12,2)]
+ public bool supportsClickableThumbsticks;
+ [iOS (12,2), Mac (10,14,4, onlyOn64: true), TV (12,2)]
+ public bool leftThumbstickButton;
+ [iOS (12,2), Mac (10,14,4, onlyOn64: true), TV (12,2)]
+ public bool rightThumbstickButton;
// radar: https://trello.com/c/7FoGTORD (GCExtendedGamepadSnapShotDataV100 struct size / alignment not backward compatible)
// [TV (12, 1), Mac (10, 14, 1, onlyOn64: true), iOS (12, 1)]
@@ -56,6 +62,9 @@ namespace GameController {
// [TV (12, 1), Mac (10, 14, 1, onlyOn64: true), iOS (12, 1)]
// public bool RightThumbstickButton;
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
[DllImport (Constants.GameControllerLibrary)]
static extern /* NSData * __nullable */ IntPtr NSDataFromGCExtendedGamepadSnapShotDataV100 (
/* GCExtendedGamepadSnapShotDataV100 * __nullable */ ref GCExtendedGamepadSnapShotDataV100 snapshotData);
@@ -67,6 +76,12 @@ namespace GameController {
}
}
+ [Introduced (PlatformName.MacOSX, 10, 11, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Introduced (PlatformName.iOS, 9, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Introduced (PlatformName.TvOS, 9, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
// float_t are 4 bytes (at least for ARM64)
[StructLayout (LayoutKind.Sequential, Pack = 1)]
public struct GCExtendedGamepadSnapshotData {
@@ -104,6 +119,9 @@ namespace GameController {
[TV (12, 2), Mac (10, 14, 4, onlyOn64: true), iOS (12, 2)]
bool RightThumbstickButton;
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
[DllImport (Constants.GameControllerLibrary)]
[TV (12, 2), Mac (10, 14, 4, onlyOn64: true), iOS (12, 2)]
static extern /* NSData * __nullable */ IntPtr NSDataFromGCExtendedGamepadSnapshotData (
@@ -120,11 +138,18 @@ namespace GameController {
public partial class GCExtendedGamepadSnapshot {
// GCExtendedGamepadSnapshot.h
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
[DllImport (Constants.GameControllerLibrary)]
static extern bool GCExtendedGamepadSnapShotDataV100FromNSData (
/* GCExtendedGamepadSnapShotDataV100 * __nullable */ out GCExtendedGamepadSnapShotDataV100 snapshotData,
/* NSData * __nullable */ IntPtr data);
+
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
[DllImport (Constants.GameControllerLibrary)]
[TV (12, 2), Mac (10, 14, 4, onlyOn64: true), iOS (12, 2)]
static extern bool GCExtendedGamepadSnapshotDataFromNSData (
diff --git a/src/GameController/GCGamepadSnapshot.cs b/src/GameController/GCGamepadSnapshot.cs
index 847c14893..0bb1f8f71 100644
--- a/src/GameController/GCGamepadSnapshot.cs
+++ b/src/GameController/GCGamepadSnapshot.cs
@@ -15,6 +15,9 @@ using Foundation;
namespace GameController {
// GCGamepadSnapshot.h
// float_t are 4 bytes (at least for ARM64)
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
[StructLayout (LayoutKind.Sequential, Pack = 1)]
[iOS (7,0)]
[Mac (10,9, onlyOn64: true)]
@@ -37,6 +40,9 @@ namespace GameController {
public float /* float_t = float */ LeftShoulder;
public float /* float_t = float */ RightShoulder;
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
[DllImport (Constants.GameControllerLibrary)]
static extern /* NSData * __nullable */ IntPtr NSDataFromGCGamepadSnapShotDataV100 (
/* GCGamepadSnapShotDataV100 * __nullable */ ref GCGamepadSnapShotDataV100 snapshotData);
@@ -51,6 +57,9 @@ namespace GameController {
public partial class GCGamepadSnapshot {
// GCGamepadSnapshot.h
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
[DllImport (Constants.GameControllerLibrary)]
static extern bool GCGamepadSnapShotDataV100FromNSData (
/* GCGamepadSnapShotDataV100 * __nullable */ out GCGamepadSnapShotDataV100 snapshotData,
diff --git a/src/GameController/GCMicroGamepadSnapshot.cs b/src/GameController/GCMicroGamepadSnapshot.cs
index 09d116a68..fde60f791 100644
--- a/src/GameController/GCMicroGamepadSnapshot.cs
+++ b/src/GameController/GCMicroGamepadSnapshot.cs
@@ -14,9 +14,9 @@ namespace GameController {
// GCMicroGamepadSnapshot.h
// float_t are 4 bytes (at least for ARM64)
[StructLayout (LayoutKind.Sequential, Pack = 1)]
- [Deprecated (PlatformName.iOS, 12, 2, message: "Use 'GCMicroGamepadSnapshotData' instead.")]
- [Deprecated (PlatformName.MacOSX, 10, 14, 4, message: "Use 'GCMicroGamepadSnapshotData' instead.")]
- [Deprecated (PlatformName.TvOS, 12, 2, message: "Use 'GCMicroGamepadSnapshotData' instead.")]
+ [Deprecated (PlatformName.iOS, 12, 2, message: "Use [GCController controllerWithMicroGamepad] instead.")]
+ [Deprecated (PlatformName.MacOSX, 10, 14, 4, message: "Use [GCController controllerWithMicroGamepad] instead.")]
+ [Deprecated (PlatformName.TvOS, 12, 2, message: "Use [GCController controllerWithMicroGamepad] instead.")]
public struct GCMicroGamepadSnapShotDataV100 {
// Standard information
@@ -32,6 +32,9 @@ namespace GameController {
public float /* float_t = float */ ButtonA;
public float /* float_t = float */ ButtonX;
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
[DllImport (Constants.GameControllerLibrary)]
static extern /* NSData * __nullable */ IntPtr NSDataFromGCMicroGamepadSnapShotDataV100 (
/* __nullable */ ref GCMicroGamepadSnapShotDataV100 snapshotData);
@@ -45,6 +48,9 @@ namespace GameController {
// GCMicroGamepadSnapshot.h
// float_t are 4 bytes (at least for ARM64)
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
[StructLayout (LayoutKind.Sequential, Pack = 1)]
public struct GCMicroGamepadSnapshotData {
@@ -61,6 +67,9 @@ namespace GameController {
public float /* float_t = float */ ButtonA;
public float /* float_t = float */ ButtonX;
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
[DllImport (Constants.GameControllerLibrary)]
[TV (12, 2), Mac (10, 14, 4, onlyOn64: true), iOS (12, 2)]
static extern /* NSData * __nullable */ IntPtr NSDataFromGCMicroGamepadSnapshotData (
@@ -78,6 +87,9 @@ namespace GameController {
public partial class GCMicroGamepadSnapshot {
// GCGamepadSnapshot.h
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
[DllImport (Constants.GameControllerLibrary)]
[Mac (10, 12)]
static extern bool GCMicroGamepadSnapShotDataV100FromNSData (out GCMicroGamepadSnapShotDataV100 snapshotData, /* NSData */ IntPtr data);
@@ -91,6 +103,9 @@ namespace GameController {
return GCMicroGamepadSnapShotDataV100FromNSData (out snapshotData, data == null ? IntPtr.Zero : data.Handle);
}
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
[DllImport (Constants.GameControllerLibrary)]
[TV (12, 2), Mac (10, 14, 4, onlyOn64: true), iOS (12, 2)]
static extern bool GCMicroGamepadSnapshotDataFromNSData (out GCMicroGamepadSnapshotData snapshotData, /* NSData */ IntPtr data);
diff --git a/src/GameController/GCMotion.cs b/src/GameController/GCMotion.cs
new file mode 100644
index 000000000..2dadb7c67
--- /dev/null
+++ b/src/GameController/GCMotion.cs
@@ -0,0 +1,47 @@
+//
+// GCMotion.cs: extensions to GCMotion iOS API
+//
+// Authors:
+// TJ Lambert ([email protected])
+//
+// Copyright 2019 Microsoft Corporation.
+
+using System;
+
+using ObjCRuntime;
+using Foundation;
+
+namespace GameController {
+
+ [iOS (13,0), Mac (10,15, onlyOn64: true), TV (13,0)]
+ public struct GCAcceleration {
+
+ public double X;
+
+ public double Y;
+
+ public double Z;
+ }
+
+ [iOS (13,0), Mac (10,15, onlyOn64: true), TV (13,0)]
+ public struct GCRotationRate {
+
+ public double X;
+
+ public double Y;
+
+ public double Z;
+ }
+
+ [iOS (13,0), Mac (10,15, onlyOn64: true), TV (13,0)]
+ public struct GCQuaternion {
+
+ public double X;
+
+ public double Y;
+
+ public double Z;
+
+ public double W;
+ }
+}
diff --git a/src/frameworks.sources b/src/frameworks.sources
index 365cb29b6..56d2cb22a 100644
--- a/src/frameworks.sources
+++ b/src/frameworks.sources
@@ -803,6 +803,7 @@ FOUNDATION_SOURCES = \
GAMECONTROLLER_CORE_SOURCES = \
GameController/Enums.cs \
GameController/GCController.cs \
+ GameController/GCMotion.cs \
GAMECONTROLLER_SOURCES = \
GameController/Compat.cs \
diff --git a/src/gamecontroller.cs b/src/gamecontroller.cs
index 72d89b226..885b5a1ee 100644
--- a/src/gamecontroller.cs
+++ b/src/gamecontroller.cs
@@ -49,6 +49,9 @@ namespace GameController {
[Export ("value")]
float Value { get; } /* float, not CGFloat */
+
+ [Export ("setValue:")]
+ void SetValue (float value);
}
delegate void GCControllerButtonValueChanged (GCControllerButtonInput button, float /* float, not CGFloat */ buttonValue, bool pressed);
@@ -74,6 +77,9 @@ namespace GameController {
[Export ("pressed")]
bool IsPressed { [Bind ("isPressed")] get; }
+ [Export ("setValue:")]
+ void SetValue (float value);
+
#if !XAMCORE_4_0
[iOS (8,0), Mac (10,10)]
[Obsolete ("Use the 'PressedChangedHandler' property.")]
@@ -81,7 +87,7 @@ namespace GameController {
void SetPressedChangedHandler (GCControllerButtonValueChanged handler);
#endif
- [iOS (8,0), Mac (10,10)]
+ [iOS (8,0), Mac (10,10), TV (13,0)]
[NullAllowed]
[Export ("pressedChangedHandler", ArgumentSemantic.Copy)]
GCControllerButtonValueChanged PressedChangedHandler { get; set; }
@@ -115,10 +121,16 @@ namespace GameController {
[Export ("right")]
GCControllerButtonInput Right { get; }
+
+ [Export ("setValueForXAxis:yAxis:")]
+ void SetValueForXAxis (float xAxis, float yAxis);
}
delegate void GCGamepadValueChangedHandler (GCGamepad gamepad, GCControllerElement element);
+ [Deprecated (PlatformName.MacOSX, 10, 12, message: "Use GCExtendedGamepad instead")]
+ [Deprecated (PlatformName.iOS, 10, 0, message: "Use GCExtendedGamepad instead")]
+ [Deprecated (PlatformName.TvOS, 10, 0, message: "Use GCExtendedGamepad instead")]
[iOS (7,0)]
[Mac (10,9, onlyOn64: true)]
[BaseType (typeof (NSObject))]
@@ -156,6 +168,9 @@ namespace GameController {
GCControllerButtonInput RightShoulder { get; }
}
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCGamepad has been deprecated, use GCExtendedGamepad instead")]
[iOS (7,0)]
[Mac (10,9, onlyOn64: true)]
[BaseType (typeof (GCGamepad))]
@@ -186,6 +201,10 @@ namespace GameController {
[Export ("valueChangedHandler", ArgumentSemantic.Copy)]
GCExtendedGamepadValueChangedHandler ValueChangedHandler { get; set; }
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController capture] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController capture] instead")]
+ [Introduced (PlatformName.TvOS, 7, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController capture] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController capture] instead")]
[Export ("saveSnapshot")]
GCExtendedGamepadSnapshot SaveSnapshot ();
@@ -229,10 +248,26 @@ namespace GameController {
[TV (12, 1), Mac (10, 14, 1, onlyOn64: true), iOS (12, 1)]
[NullAllowed, Export ("rightThumbstickButton")]
GCControllerButtonInput RightThumbstickButton { get; }
+
+ [TV (13, 0), Mac (10, 15, onlyOn64: true), iOS (13, 0)]
+ [Export ("buttonMenu")]
+ GCControllerButtonInput ButtonMenu { get; }
+
+ [TV (13, 0), Mac (10, 15, onlyOn64: true), iOS (13, 0)]
+ [NullAllowed, Export ("buttonOptions")]
+ GCControllerButtonInput ButtonOptions { get; }
+
+ [TV (13,0), Mac (10,15, onlyOn64: true), iOS (13,0)]
+ [Export ("setStateFromExtendedGamepad:")]
+ void SetState (GCExtendedGamepad extendedGamepad);
}
[iOS (7,0)]
[Mac (10,9, onlyOn64: true)]
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Introduced (PlatformName.TvOS, 9, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
[BaseType (typeof (GCExtendedGamepad))]
[DisableDefaultCtor]
partial interface GCExtendedGamepadSnapshot {
@@ -246,6 +281,9 @@ namespace GameController {
[Export ("initWithController:snapshotData:")]
IntPtr Constructor (GCController controller, NSData data);
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController controllerWithExtendedGamepad] instead")]
[TV (12, 2), Mac (10, 14, 4, onlyOn64: true), iOS (12, 2)]
[Field ("GCCurrentExtendedGamepadSnapshotDataVersion")]
GCExtendedGamepadSnapshotDataVersion DataVersion { get; }
@@ -259,6 +297,11 @@ namespace GameController {
[BaseType (typeof (NSObject))]
partial interface GCController {
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "controllerPausedHandler has been deprecated. Use the Menu button found on the controller's profile, if it exists.")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "controllerPausedHandler has been deprecated. Use the Menu button found on the controller's profile, if it exists.")]
+ [Introduced (PlatformName.TvOS, 9, 0, message: "controllerPausedHandler has been deprecated. Use the Menu button found on the controller's profile, if it exists.")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "controllerPausedHandler has been deprecated. Use the Menu button found on the controller's profile, if it exists.")]
+
[Export ("controllerPausedHandler", ArgumentSemantic.Copy)]
#if XAMCORE_2_0
Action<GCController> ControllerPausedHandler { get; set; }
@@ -280,6 +323,10 @@ namespace GameController {
nint PlayerIndex { get; set; }
#endif
+ [Deprecated (PlatformName.MacOSX, 10, 12)]
+ [Deprecated (PlatformName.iOS, 10, 0)]
+ [Introduced (PlatformName.TvOS, 7, 0)]
+ [Deprecated (PlatformName.TvOS, 10, 0)]
[Export ("gamepad", ArgumentSemantic.Retain)]
GCGamepad Gamepad { get; }
@@ -288,6 +335,7 @@ namespace GameController {
[Mac (10,12, onlyOn64: true)]
[iOS (10,0)]
+ [TV (13,0)]
[NullAllowed, Export ("microGamepad", ArgumentSemantic.Retain)]
GCMicroGamepad MicroGamepad { get; }
@@ -307,16 +355,38 @@ namespace GameController {
[Notification, Field ("GCControllerDidDisconnectNotification")]
NSString DidDisconnectNotification { get; }
- [iOS (8,0), Mac (10,10)]
+ [iOS (8,0), Mac (10,10), TV(13,0)]
[Export ("motion", ArgumentSemantic.Retain)]
GCMotion Motion { get; }
[iOS (9,0)][Mac (10,11)]
[Export ("handlerQueue", ArgumentSemantic.Retain)]
DispatchQueue HandlerQueue { get; set; }
+
+ [TV (13, 0), Mac (10, 15, onlyOn64: true), iOS (13, 0)]
+ [Export ("productCategory")]
+ string ProductCategory { get; }
+
+ [TV (13, 0), Mac (10, 15, onlyOn64: true), iOS (13, 0)]
+ [Export ("snapshot")]
+ bool Snapshot { [Bind ("isSnapshot")] get; }
+
+ [TV (13, 0), Mac (10, 15, onlyOn64: true), iOS (13, 0)]
+ [Export ("capture")]
+ GCController Capture { get; }
+
+ [TV (13, 0), Mac (10, 15, onlyOn64: true), iOS (13, 0)]
+ [Static]
+ [Export ("controllerWithMicroGamepad")]
+ GCController ControllerWithMicroGamepad { get; }
+
+ [TV (13, 0), Mac (10, 15, onlyOn64: true), iOS (13, 0)]
+ [Static]
+ [Export ("controllerWithExtendedGamepad")]
+ GCController ControllerWithExtendedGamepad { get; }
}
- [iOS (8,0), Mac (10,10, onlyOn64: true)]
+ [iOS (8,0), Mac (10,10, onlyOn64: true), TV (13,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // access thru GCController.Motion - returns a nil Handle
partial interface GCMotion {
@@ -344,7 +414,7 @@ namespace GameController {
[Export ("attitude", ArgumentSemantic.Assign)]
Quaterniond Attitude { get; }
- [TV (11,0)]
+ [TV (11,0), iOS (11,0), Mac (10,13)]
[Export ("rotationRate", ArgumentSemantic.Assign)]
Vector3d RotationRate { get; }
@@ -353,6 +423,26 @@ namespace GameController {
[Mac (10,13, onlyOn64: true)]
[Export ("hasAttitudeAndRotationRate")]
bool HasAttitudeAndRotationRate { get; }
+
+ [TV (13,0), Mac (10,15, onlyOn64: true), iOS (13,0)]
+ [Export ("setGravity:")]
+ void SetGravity (GCAcceleration gravity);
+
+ [TV (13,0), Mac (10,15, onlyOn64: true), iOS (13,0)]
+ [Export ("setUserAcceleration:")]
+ void SetUserAcceleration (GCAcceleration userAcceleration);
+
+ [TV (13,0), Mac (10,15, onlyOn64: true), iOS (13,0)]
+ [Export ("setAttitude:")]
+ void SetAttitude (GCQuaternion attitude);
+
+ [TV (13,0), Mac (10,15, onlyOn64: true), iOS (13,0)]
+ [Export ("setRotationRate:")]
+ void SetRotationRate (GCRotationRate rotationRate);
+
+ [TV (13,0), Mac (10,15, onlyOn64: true), iOS (13,0)]
+ [Export ("setStateFromMotion:")]
+ void SetState (GCMotion motion);
}
[Mac (10,11, onlyOn64: true)]
@@ -372,6 +462,9 @@ namespace GameController {
[NullAllowed, Export ("valueChangedHandler", ArgumentSemantic.Copy)]
GCMicroGamepadValueChangedHandler ValueChangedHandler { get; set; }
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController capture] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController capture] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCExtendedGamepadSnapshot has been deprecated, use [GCController capture] instead")]
[Export ("saveSnapshot")]
GCMicroGamepadSnapshot SaveSnapshot { get; }
@@ -389,8 +482,19 @@ namespace GameController {
[Export ("allowsRotation")]
bool AllowsRotation { get; set; }
+
+ [TV (13, 0), Mac (10, 15, onlyOn64: true), iOS (13, 0)]
+ [Export ("buttonMenu")]
+ GCControllerButtonInput ButtonMenu { get; }
+
+ [TV (13,0), Mac (10,15, onlyOn64: true), iOS (13,0)]
+ [Export ("setStateFromExtendedGamepad:")]
+ void SetStateFromExtendedGamepad (GCExtendedGamepad extendedGamepad);
}
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController capture] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController capture] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController capture] instead")]
[Mac (10,12, onlyOn64: true)]
[iOS (10,0)]
[TV (9,0)]
@@ -405,6 +509,9 @@ namespace GameController {
[Export ("initWithController:snapshotData:")]
IntPtr Constructor (GCController controller, NSData data);
+ [Deprecated (PlatformName.MacOSX, 10, 15, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.iOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
+ [Deprecated (PlatformName.TvOS, 13, 0, message: "GCMicroGamepadSnapshot has been deprecated, use [GCController controllerWithMicroGamepad] instead")]
[TV (12, 2), Mac (10, 14, 4, onlyOn64: true), iOS (12, 2)]
[Field ("GCCurrentMicroGamepadSnapshotDataVersion")]
GCMicroGamepadSnapshotDataVersion DataVersion { get; }
diff --git a/tests/xtro-sharpie/iOS-GameController.todo b/tests/xtro-sharpie/iOS-GameController.todo
deleted file mode 100644
index b329b60de..000000000
--- a/tests/xtro-sharpie/iOS-GameController.todo
+++ /dev/null
@@ -1,27 +0,0 @@
-!deprecated-attribute-missing! GCController::controllerPausedHandler missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCController::gamepad missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCController::setControllerPausedHandler: missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCExtendedGamepad::saveSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCExtendedGamepadSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCGamepad missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCGamepadSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCMicroGamepad::saveSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCMicroGamepadSnapshot missing a [Deprecated] attribute
-!missing-selector! +GCController::controllerWithExtendedGamepad not bound
-!missing-selector! +GCController::controllerWithMicroGamepad not bound
-!missing-selector! GCController::capture not bound
-!missing-selector! GCController::isSnapshot not bound
-!missing-selector! GCController::productCategory not bound
-!missing-selector! GCControllerAxisInput::setValue: not bound
-!missing-selector! GCControllerButtonInput::setValue: not bound
-!missing-selector! GCControllerDirectionPad::setValueForXAxis:yAxis: not bound
-!missing-selector! GCExtendedGamepad::buttonMenu not bound
-!missing-selector! GCExtendedGamepad::buttonOptions not bound
-!missing-selector! GCExtendedGamepad::setStateFromExtendedGamepad: not bound
-!missing-selector! GCMicroGamepad::buttonMenu not bound
-!missing-selector! GCMicroGamepad::setStateFromMicroGamepad: not bound
-!missing-selector! GCMotion::setAttitude: not bound
-!missing-selector! GCMotion::setGravity: not bound
-!missing-selector! GCMotion::setRotationRate: not bound
-!missing-selector! GCMotion::setStateFromMotion: not bound
-!missing-selector! GCMotion::setUserAcceleration: not bound
diff --git a/tests/xtro-sharpie/macOS-GameController.todo b/tests/xtro-sharpie/macOS-GameController.todo
deleted file mode 100644
index b329b60de..000000000
--- a/tests/xtro-sharpie/macOS-GameController.todo
+++ /dev/null
@@ -1,27 +0,0 @@
-!deprecated-attribute-missing! GCController::controllerPausedHandler missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCController::gamepad missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCController::setControllerPausedHandler: missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCExtendedGamepad::saveSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCExtendedGamepadSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCGamepad missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCGamepadSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCMicroGamepad::saveSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCMicroGamepadSnapshot missing a [Deprecated] attribute
-!missing-selector! +GCController::controllerWithExtendedGamepad not bound
-!missing-selector! +GCController::controllerWithMicroGamepad not bound
-!missing-selector! GCController::capture not bound
-!missing-selector! GCController::isSnapshot not bound
-!missing-selector! GCController::productCategory not bound
-!missing-selector! GCControllerAxisInput::setValue: not bound
-!missing-selector! GCControllerButtonInput::setValue: not bound
-!missing-selector! GCControllerDirectionPad::setValueForXAxis:yAxis: not bound
-!missing-selector! GCExtendedGamepad::buttonMenu not bound
-!missing-selector! GCExtendedGamepad::buttonOptions not bound
-!missing-selector! GCExtendedGamepad::setStateFromExtendedGamepad: not bound
-!missing-selector! GCMicroGamepad::buttonMenu not bound
-!missing-selector! GCMicroGamepad::setStateFromMicroGamepad: not bound
-!missing-selector! GCMotion::setAttitude: not bound
-!missing-selector! GCMotion::setGravity: not bound
-!missing-selector! GCMotion::setRotationRate: not bound
-!missing-selector! GCMotion::setStateFromMotion: not bound
-!missing-selector! GCMotion::setUserAcceleration: not bound
diff --git a/tests/xtro-sharpie/tvOS-GameController.todo b/tests/xtro-sharpie/tvOS-GameController.todo
deleted file mode 100644
index b329b60de..000000000
--- a/tests/xtro-sharpie/tvOS-GameController.todo
+++ /dev/null
@@ -1,27 +0,0 @@
-!deprecated-attribute-missing! GCController::controllerPausedHandler missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCController::gamepad missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCController::setControllerPausedHandler: missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCExtendedGamepad::saveSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCExtendedGamepadSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCGamepad missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCGamepadSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCMicroGamepad::saveSnapshot missing a [Deprecated] attribute
-!deprecated-attribute-missing! GCMicroGamepadSnapshot missing a [Deprecated] attribute
-!missing-selector! +GCController::controllerWithExtendedGamepad not bound
-!missing-selector! +GCController::controllerWithMicroGamepad not bound
-!missing-selector! GCController::capture not bound
-!missing-selector! GCController::isSnapshot not bound
-!missing-selector! GCController::productCategory not bound
-!missing-selector! GCControllerAxisInput::setValue: not bound
-!missing-selector! GCControllerButtonInput::setValue: not bound
-!missing-selector! GCControllerDirectionPad::setValueForXAxis:yAxis: not bound
-!missing-selector! GCExtendedGamepad::buttonMenu not bound
-!missing-selector! GCExtendedGamepad::buttonOptions not bound
-!missing-selector! GCExtendedGamepad::setStateFromExtendedGamepad: not bound
-!missing-selector! GCMicroGamepad::buttonMenu not bound
-!missing-selector! GCMicroGamepad::setStateFromMicroGamepad: not bound
-!missing-selector! GCMotion::setAttitude: not bound
-!missing-selector! GCMotion::setGravity: not bound
-!missing-selector! GCMotion::setRotationRate: not bound
-!missing-selector! GCMotion::setStateFromMotion: not bound
-!missing-selector! GCMotion::setUserAcceleration: not bound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment