From 027710ae19be5178bb81419fdc332f8f05d1967a Mon Sep 17 00:00:00 2001 From: tj_devel709 Date: Thu, 24 Jun 2021 10:21:37 -0500 Subject: [PATCH 1/3] Initial changes for xcode13 GameController beta1 --- src/gamecontroller.cs | 122 +++++++++++++++++- .../MacCatalyst-GameController.todo | 34 ----- tests/xtro-sharpie/iOS-GameController.todo | 34 ----- tests/xtro-sharpie/macOS-GameController.todo | 18 --- tests/xtro-sharpie/tvOS-GameController.todo | 18 --- 5 files changed, 121 insertions(+), 105 deletions(-) delete mode 100644 tests/xtro-sharpie/MacCatalyst-GameController.todo delete mode 100644 tests/xtro-sharpie/iOS-GameController.todo delete mode 100644 tests/xtro-sharpie/macOS-GameController.todo delete mode 100644 tests/xtro-sharpie/tvOS-GameController.todo diff --git a/src/gamecontroller.cs b/src/gamecontroller.cs index 4d3c8a8975cb..46ccd46df344 100644 --- a/src/gamecontroller.cs +++ b/src/gamecontroller.cs @@ -3,7 +3,7 @@ // // Authors: // Aaron Bockover (abock@xamarin.com) -// TJ Lambert (t-anlamb@microsoft.com) +// TJ Lambert (antlambe@microsoft.com) // Whitney Schmidt (whschm@microsoft.com) // // Copyright 2013, 2015 Xamarin Inc. @@ -19,9 +19,11 @@ using AppKit; using UIViewController = AppKit.NSViewController; using CHHapticEngine = Foundation.NSObject; +using BezierPath = AppKit.NSBezierPath; #else using CoreHaptics; using UIKit; +using BezierPath = UIKit.UIBezierPath; #endif namespace GameController { @@ -963,6 +965,14 @@ interface GCPhysicalInputProfile [Export ("setStateFromPhysicalInput:")] void SetState (GCPhysicalInputProfile physicalInput); + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("allTouchpads", ArgumentSemantic.Strong)] + NSSet AllTouchpads { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("touchpads", ArgumentSemantic.Strong)] + NSDictionary Touchpads { get; } } [TV (14, 0), Mac (11, 0), iOS (14, 0)] @@ -1267,6 +1277,38 @@ partial interface GCKey [Field ("GCKeyF12")] NSString F12 { get; } + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyF13")] + NSString F13 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyF14")] + NSString F14 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyF15")] + NSString F15 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyF16")] + NSString F16 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyF17")] + NSString F17 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyF18")] + NSString F18 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyF19")] + NSString F19 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyF20")] + NSString F20 { get; } + [Field ("GCKeyPrintScreen")] NSString PrintScreen { get; } @@ -1651,6 +1693,38 @@ interface GCKeyCode [Field ("GCKeyCodeF12")] nint F12 { get; } + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyCodeF13")] + nint F13 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyCodeF14")] + nint F14 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyCodeF15")] + nint F15 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyCodeF16")] + nint F16 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyCodeF17")] + nint F17 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyCodeF18")] + nint F18 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyCodeF19")] + nint F19 { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("GCKeyCodeF20")] + nint F20 { get; } + [Field ("GCKeyCodePrintScreen")] nint PrintScreen { get; } @@ -1922,4 +1996,50 @@ enum GCInputDirectional { [Field ("GCInputDirectionalCardinalDpad")] CardinalDpad, } + + delegate GCVirtualControllerElementConfiguration GCVirtualControllerElementUpdateBlock (GCVirtualControllerElementConfiguration configuration); + + [NoTV, NoMac, NoWatch, iOS (15,0), MacCatalyst (15,0)] + [BaseType (typeof(NSObject))] + [DisableDefaultCtor] + interface GCVirtualController + { + [Static] + [Export ("virtualControllerWithConfiguration:")] + GCVirtualController CreateVirtualController (GCVirtualControllerConfiguration configuration); + + [Export ("connectWithReply:")] + void Connect ([NullAllowed] Action reply); + + [Export ("disconnect")] + void Disconnect (); + + [NullAllowed, Export ("controller", ArgumentSemantic.Weak)] + GCController Controller { get; } + + [Export ("changeElement:configuration:")] + void Change (string element, GCVirtualControllerElementUpdateBlock config); + } + + [NoTV, NoMac, NoWatch, iOS (15,0), MacCatalyst (15,0)] + [BaseType (typeof(NSObject))] + interface GCVirtualControllerConfiguration + { + [Export ("elements", ArgumentSemantic.Strong)] + NSSet Elements { get; set; } + } + + [NoTV, NoMac, NoWatch, iOS (15,0), MacCatalyst (15,0)] + [BaseType (typeof(NSObject))] + interface GCVirtualControllerElementConfiguration + { + [Export ("hidden")] + bool Hidden { get; set; } + + [NullAllowed, Export ("path", ArgumentSemantic.Strong)] + BezierPath Path { get; set; } + + [Export ("touchpad")] + bool Touchpad { get; set; } + } } diff --git a/tests/xtro-sharpie/MacCatalyst-GameController.todo b/tests/xtro-sharpie/MacCatalyst-GameController.todo deleted file mode 100644 index 11cff8a58c44..000000000000 --- a/tests/xtro-sharpie/MacCatalyst-GameController.todo +++ /dev/null @@ -1,34 +0,0 @@ -!missing-field! GCKeyCodeF13 not bound -!missing-field! GCKeyCodeF14 not bound -!missing-field! GCKeyCodeF15 not bound -!missing-field! GCKeyCodeF16 not bound -!missing-field! GCKeyCodeF17 not bound -!missing-field! GCKeyCodeF18 not bound -!missing-field! GCKeyCodeF19 not bound -!missing-field! GCKeyCodeF20 not bound -!missing-field! GCKeyF13 not bound -!missing-field! GCKeyF14 not bound -!missing-field! GCKeyF15 not bound -!missing-field! GCKeyF16 not bound -!missing-field! GCKeyF17 not bound -!missing-field! GCKeyF18 not bound -!missing-field! GCKeyF19 not bound -!missing-field! GCKeyF20 not bound -!missing-selector! +GCVirtualController::virtualControllerWithConfiguration: not bound -!missing-selector! GCPhysicalInputProfile::allTouchpads not bound -!missing-selector! GCPhysicalInputProfile::touchpads not bound -!missing-selector! GCVirtualController::changeElement:configuration: not bound -!missing-selector! GCVirtualController::connectWithReply: not bound -!missing-selector! GCVirtualController::controller not bound -!missing-selector! GCVirtualController::disconnect not bound -!missing-selector! GCVirtualControllerConfiguration::elements not bound -!missing-selector! GCVirtualControllerConfiguration::setElements: not bound -!missing-selector! GCVirtualControllerElementConfiguration::hidden not bound -!missing-selector! GCVirtualControllerElementConfiguration::path not bound -!missing-selector! GCVirtualControllerElementConfiguration::setHidden: not bound -!missing-selector! GCVirtualControllerElementConfiguration::setPath: not bound -!missing-selector! GCVirtualControllerElementConfiguration::setTouchpad: not bound -!missing-selector! GCVirtualControllerElementConfiguration::touchpad not bound -!missing-type! GCVirtualController not bound -!missing-type! GCVirtualControllerConfiguration not bound -!missing-type! GCVirtualControllerElementConfiguration not bound diff --git a/tests/xtro-sharpie/iOS-GameController.todo b/tests/xtro-sharpie/iOS-GameController.todo deleted file mode 100644 index 11cff8a58c44..000000000000 --- a/tests/xtro-sharpie/iOS-GameController.todo +++ /dev/null @@ -1,34 +0,0 @@ -!missing-field! GCKeyCodeF13 not bound -!missing-field! GCKeyCodeF14 not bound -!missing-field! GCKeyCodeF15 not bound -!missing-field! GCKeyCodeF16 not bound -!missing-field! GCKeyCodeF17 not bound -!missing-field! GCKeyCodeF18 not bound -!missing-field! GCKeyCodeF19 not bound -!missing-field! GCKeyCodeF20 not bound -!missing-field! GCKeyF13 not bound -!missing-field! GCKeyF14 not bound -!missing-field! GCKeyF15 not bound -!missing-field! GCKeyF16 not bound -!missing-field! GCKeyF17 not bound -!missing-field! GCKeyF18 not bound -!missing-field! GCKeyF19 not bound -!missing-field! GCKeyF20 not bound -!missing-selector! +GCVirtualController::virtualControllerWithConfiguration: not bound -!missing-selector! GCPhysicalInputProfile::allTouchpads not bound -!missing-selector! GCPhysicalInputProfile::touchpads not bound -!missing-selector! GCVirtualController::changeElement:configuration: not bound -!missing-selector! GCVirtualController::connectWithReply: not bound -!missing-selector! GCVirtualController::controller not bound -!missing-selector! GCVirtualController::disconnect not bound -!missing-selector! GCVirtualControllerConfiguration::elements not bound -!missing-selector! GCVirtualControllerConfiguration::setElements: not bound -!missing-selector! GCVirtualControllerElementConfiguration::hidden not bound -!missing-selector! GCVirtualControllerElementConfiguration::path not bound -!missing-selector! GCVirtualControllerElementConfiguration::setHidden: not bound -!missing-selector! GCVirtualControllerElementConfiguration::setPath: not bound -!missing-selector! GCVirtualControllerElementConfiguration::setTouchpad: not bound -!missing-selector! GCVirtualControllerElementConfiguration::touchpad not bound -!missing-type! GCVirtualController not bound -!missing-type! GCVirtualControllerConfiguration not bound -!missing-type! GCVirtualControllerElementConfiguration not bound diff --git a/tests/xtro-sharpie/macOS-GameController.todo b/tests/xtro-sharpie/macOS-GameController.todo deleted file mode 100644 index 8f7dd95403ce..000000000000 --- a/tests/xtro-sharpie/macOS-GameController.todo +++ /dev/null @@ -1,18 +0,0 @@ -!missing-field! GCKeyCodeF13 not bound -!missing-field! GCKeyCodeF14 not bound -!missing-field! GCKeyCodeF15 not bound -!missing-field! GCKeyCodeF16 not bound -!missing-field! GCKeyCodeF17 not bound -!missing-field! GCKeyCodeF18 not bound -!missing-field! GCKeyCodeF19 not bound -!missing-field! GCKeyCodeF20 not bound -!missing-field! GCKeyF13 not bound -!missing-field! GCKeyF14 not bound -!missing-field! GCKeyF15 not bound -!missing-field! GCKeyF16 not bound -!missing-field! GCKeyF17 not bound -!missing-field! GCKeyF18 not bound -!missing-field! GCKeyF19 not bound -!missing-field! GCKeyF20 not bound -!missing-selector! GCPhysicalInputProfile::allTouchpads not bound -!missing-selector! GCPhysicalInputProfile::touchpads not bound diff --git a/tests/xtro-sharpie/tvOS-GameController.todo b/tests/xtro-sharpie/tvOS-GameController.todo deleted file mode 100644 index 8f7dd95403ce..000000000000 --- a/tests/xtro-sharpie/tvOS-GameController.todo +++ /dev/null @@ -1,18 +0,0 @@ -!missing-field! GCKeyCodeF13 not bound -!missing-field! GCKeyCodeF14 not bound -!missing-field! GCKeyCodeF15 not bound -!missing-field! GCKeyCodeF16 not bound -!missing-field! GCKeyCodeF17 not bound -!missing-field! GCKeyCodeF18 not bound -!missing-field! GCKeyCodeF19 not bound -!missing-field! GCKeyCodeF20 not bound -!missing-field! GCKeyF13 not bound -!missing-field! GCKeyF14 not bound -!missing-field! GCKeyF15 not bound -!missing-field! GCKeyF16 not bound -!missing-field! GCKeyF17 not bound -!missing-field! GCKeyF18 not bound -!missing-field! GCKeyF19 not bound -!missing-field! GCKeyF20 not bound -!missing-selector! GCPhysicalInputProfile::allTouchpads not bound -!missing-selector! GCPhysicalInputProfile::touchpads not bound From fa9e0b425058d4349c4fbf62cdaf3fb1f3fb116a Mon Sep 17 00:00:00 2001 From: tj_devel709 Date: Thu, 24 Jun 2021 11:30:58 -0500 Subject: [PATCH 2/3] syntax and name change --- src/gamecontroller.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gamecontroller.cs b/src/gamecontroller.cs index 46ccd46df344..6390927b689e 100644 --- a/src/gamecontroller.cs +++ b/src/gamecontroller.cs @@ -2000,7 +2000,7 @@ enum GCInputDirectional { delegate GCVirtualControllerElementConfiguration GCVirtualControllerElementUpdateBlock (GCVirtualControllerElementConfiguration configuration); [NoTV, NoMac, NoWatch, iOS (15,0), MacCatalyst (15,0)] - [BaseType (typeof(NSObject))] + [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface GCVirtualController { @@ -2018,11 +2018,11 @@ interface GCVirtualController GCController Controller { get; } [Export ("changeElement:configuration:")] - void Change (string element, GCVirtualControllerElementUpdateBlock config); + void Change (string element, GCVirtualControllerElementUpdateBlock configuration); } [NoTV, NoMac, NoWatch, iOS (15,0), MacCatalyst (15,0)] - [BaseType (typeof(NSObject))] + [BaseType (typeof (NSObject))] interface GCVirtualControllerConfiguration { [Export ("elements", ArgumentSemantic.Strong)] @@ -2030,7 +2030,7 @@ interface GCVirtualControllerConfiguration } [NoTV, NoMac, NoWatch, iOS (15,0), MacCatalyst (15,0)] - [BaseType (typeof(NSObject))] + [BaseType (typeof (NSObject))] interface GCVirtualControllerElementConfiguration { [Export ("hidden")] From 08644b1a2fde0ab2aa903e5fb1fef50e0329fafe Mon Sep 17 00:00:00 2001 From: tj_devel709 Date: Fri, 25 Jun 2021 14:48:08 -0500 Subject: [PATCH 3/3] name change and adding async --- src/gamecontroller.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gamecontroller.cs b/src/gamecontroller.cs index 6390927b689e..d590f760c19b 100644 --- a/src/gamecontroller.cs +++ b/src/gamecontroller.cs @@ -2006,8 +2006,9 @@ interface GCVirtualController { [Static] [Export ("virtualControllerWithConfiguration:")] - GCVirtualController CreateVirtualController (GCVirtualControllerConfiguration configuration); + GCVirtualController Create (GCVirtualControllerConfiguration configuration); + [Async] [Export ("connectWithReply:")] void Connect ([NullAllowed] Action reply);