Enabling CloudKit on watchOS required to remove some default .ctor that
watchOS does not _support_.
This commit fix this by either
* replacing the default .ctor with something that works across all
platforms (best); or
* removing the default .ctor only on watchOS;
The commit also mark as abstract three existing types for watchOS (and
for XAMCORE_4_0) that were found reviewing the bindings.
Runtime
- Added support for Vector2d, Vector3d and Vector4d SIMD types
- Added support for GKBox, GKQuad and GKTriangle SIMD types
GameplayKit
- Apple introduced GKQuadTreeNode and GKQuadTree in Xcode 7.1 and
removed those types in a later Xcode (7.2?) but we kept them around.
Now apple introduced again both types but renamed them to GKQuadtreeNode
and GKQuadtree (lowercase t), this is a breaking change and since we do
care about binary compat we are just changing the registration name and
keeping the same managed name deprecating old methods and introducing
the new ones.
- Added tests for new SIMD types
Xcode8 SDK changed untyped enums (always 32 bits) into NSInteger. In this
case we can continue with the existing API (and ignore them in xtro)
reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=42682
Some types were removed in tvOS 10, including:
!unknown-protocol! AVAssetDownloadDelegate bound
!unknown-type! AVAssetDownloadTask bound
!unknown-type! AVAssetDownloadURLSession bound
!unknown-type! AVAudioInputNode bound
and we're replacing them with stubs so our binaries won't contain any of
the selectors that could be rejected by Apple on the app store
Some (new) fields are also not part of tvOS (and were not in iOS either)
!unknown-field! AVVideoCodecAppleProRes422 bound
!unknown-field! AVVideoCodecAppleProRes4444 bound
!unknown-field! AVVideoColorPrimaries_EBU_3213 bound
!unknown-field! AVVideoTransferFunction_SMPTE_240M_1995 bound
!unknown-field! AVVideoYCbCrMatrix_SMPTE_240M_1995 bound
* [tests][xtro] Many categories are not marked as not available on tvOS, even if the type being extended is not available. This adds entries for them so only missing AV* API remains in tvos.unclassified
The P/Invoke callback method that's called by native code
has a simpler function signature than what the user delegate
has.
Example P/Invoke callback signature:
static unsafe void Invoke (IntPtr block, IntPtr obj)
which ends up calling this delegate:
System.Action<NSDictionary>
The NSDictionary parameter has been simplifed to just IntPtr.
The problem is that we need to encode the block signature according
to the signature of the user delegate (Apple uses the signature
in some cases, and fails/aborts if the signature doesn't match
what the code expects).
So add more metadata to make it possible to find the signature
of the user delegate at runtime.
The generator generates code like this:
block_scheduledCompletion.SetupBlock (Trampolines.SDActionArity1V2.Handler, scheduledCompletion);
where SDActionArity1V2.Handler is defined as this:
static internal readonly DActionArity1V2 Handler = Invoke;
this means we can get the type of `Trampolines.SDActionArity1V2.Handler` at runtime
(which would be `DActionArity1V2` in this case), so put a new attribute (`UserDelegateTypeAttribute`)
at that type:
[UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
[UserDelegateType (typeof (global::System.Action<NSDictionary>))]
internal delegate void DActionArity1V2 (IntPtr block, IntPtr obj);
Then at runtime we check if the target delegate's type has this attribute,
and then we use the type specified by this new attribute instead when
computing the ObjC signature of the block.
https://bugzilla.xamarin.com/show_bug.cgi?id=43592
A problem, that exists with the current API, is that several constants
are hidden but many are needed in some dictionaries - and not all of
them can be turned into _classic_ StrongDictionary.
This initial PR does not solve all the (old) problems, but it does offer
some useful overloads that makes the API usable for basic usages and
expose the NSDictionary-based API.
This is a static selector that needs to be overridden, which is not the
usual pattern in C#. We re-define it using [New] on subclasses.
Unit tests added for all NSDimension subclasses.
reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=43444
Also fix warnings printed while executing:
> CoreText performance note: Client called CTFontCreateWithName() using name "Arial" and got font with PostScript name "ArialMT". For best performance, only use PostScript names when calling this API.
> CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug.
* ApiCMAttachmentTest
[FAIL] ApiCMAttachmentTest.CheckFailAttachments : CGColorConverter.Handle
* SKNode added conformance to new (in iOS10) UIFocus protocol.
[FAIL] Selector not found for SpriteKit.SKNode : didUpdateFocusInContext:withAnimationCoordinator:
[FAIL] Selector not found for SpriteKit.SKNode : setNeedsFocusUpdate
[FAIL] Selector not found for SpriteKit.SKNode : shouldUpdateFocusInContext:
[FAIL] Selector not found for SpriteKit.SKNode : updateFocusIfNeeded
[FAIL] Selector not found for SpriteKit.SKNode : preferredFocusedView
* HKWorkoutEvent conformance to NSCopying is new in iOS10
[FAIL] Selector not found for HealthKit.HKWorkoutEvent : copyWithZone:
* HKDocumentType was added in iOS 10 (not iOS 8) and not watchOS 2 or 3
ref: +HK_CLASS_AVAILABLE_IOS_ONLY(10_0)
[FAIL] iOSApiProtocolTest.ApiProtocolTest.Coding : ObjCRuntime.RuntimeException : Wrapper type 'HealthKit.HKDocumentType' is missing its native ObjectiveC class 'HKDocumentType'.
reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=43329
It was disable as it crashed our test suite and the crash report from
the simulators were not very helpful. The issue becomes clear from
device builds...
Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: dispatch_barrier_sync called on queue already owned by current thread
Abort Cause 6244246656
Filtered syslog:
None found
Thread 0 name: tid_a07 Dispatch queue: CTCallCenter
Thread 0 Crashed:
0 libdispatch.dylib 0x00000001839fdf60 _dispatch_barrier_sync_f_slow + 596
1 CoreTelephony 0x000000018756e7ec -[CTCallCenter callEventHandler] + 128
2 CoreTelephony 0x000000018756e7ec -[CTCallCenter callEventHandler] + 128
3 CoreTelephony 0x000000018756f51c __27-[CTCallCenter description]_block_invoke + 60
4 CoreTelephony 0x000000018756f79c ___ZN8dispatch9sync_implIU13block_pointerFP8NSStringvEEENSt3__15decayIDTclfp0_EEE4typeEP16dispatch_queue_sOT_NS5_17integral_constantIbLb0EEE_block_invoke + 32
5 libdispatch.dylib 0x00000001839ed1c0 _dispatch_client_callout + 16
6 libdispatch.dylib 0x00000001839fa860 _dispatch_barrier_sync_f_invoke + 84
7 libdispatch.dylib 0x00000001839fde9c _dispatch_barrier_sync_f_slow + 400
8 CoreTelephony 0x000000018756f4d0 -[CTCallCenter description] + 128
9 introspection 0x000000010192b7b8 wrapper_managed_to_native_ObjCRuntime_Messaging_IntPtr_objc_msgSend_intptr_intptr (/<unknown>:1)
10 introspection 0x00000001012dbff8 Foundation_NSObject_get_Description (NSObject.g.cs:717)
11 introspection 0x00000001012d8e34 Foundation_NSObject_ToString (NSObject2.cs:703)
so calling `description` is broken and we need to exclude this from our
introspection tests for the type.
Apple removed CGColorConverter even if it was publicly exposed in iOS 9.3,
not that I recall any API that consumed it...
It was replaced by a new, very close, type named CGColorConversionInfo and
the existing code and tests were updated to the new API.
So for `CGColorConverter` we're
* iOS: Obsoleted + code removal
* tvOS: Obsoleted + code removal
* watchOS: the API can be removed as it was not exposed in a stable release
* macOS: it was not enabled (did not work)
* [tests] Adjust ApiCMAttachmentTest so it knows how to create the new CGColorConversionInfo type
Also apply fixes based on xtro results. Most of them are likely because the iOS frameworks contains out-dated headers wrt watchOS.
references:
* Missing fields /API
!missing-field! CKShareThumbnailImageDataKey not bound
!missing-field! CKShareTitleKey not bound
!missing-field! CKShareTypeKey not bound
!missing-selector! CKContainer::acceptShareMetadata:completionHandler: not bound
!missing-selector! CKContainer::fetchShareMetadataWithURL:completionHandler: not bound
* tvOS: enabled
!missing-selector! CKNotificationInfo::setShouldSendContentAvailable: not bound
!missing-selector! CKNotificationInfo::shouldSendContentAvailable not bound
* watchOS: xtro fixes for additions/removal in the same release
!missing-type! CKFetchRecordChangesOperation not bound
!missing-type! CKDiscoverAllContactsOperation not bound
!missing-type! CKDiscoverUserInfosOperation not bound
!missing-type! CKDiscoveredUserInfo not bound
!missing-selector! CKContainer::discoverAllContactUserInfosWithCompletionHandler: not bound
!missing-selector! CKContainer::discoverUserInfoWithEmailAddress:completionHandler: not bound
!missing-selector! CKContainer::discoverUserInfoWithUserRecordID:completionHandler: not bound
* watchOS: missing [NoWatch] on some types
!unknown-native-enum! CKQuerySubscriptionOptions bound
!unknown-native-enum! CKSubscriptionOptions bound
!unknown-native-enum! CKSubscriptionType bound
!unknown-type! CKDatabaseSubscription bound
!unknown-type! CKNotificationInfo bound
!unknown-type! CKQuerySubscription bound
!unknown-type! CKRecordZoneSubscription bound
!unknown-type! CKSubscription bound