Граф коммитов

2761 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge d574250a27
Remove XAMARIN_APPLETLS, it seems like it's always defined, which means it's not needed. (#8523)
Also remove outdated comment about Xamarin.Mac/Classic, since XM/Classic is dead.
2020-05-06 14:11:02 +02:00
Manuel de la Pena 7c6abf33f0
[BGTasks] Do not make BGTask abstract. (#8513)
The class in the API is abstract, the problem is that when the
application goes to the background, when it gets back we try to
instantiate an abstract class probably because Apple returns a internal
type that we do not know about.

fixes: https://github.com/xamarin/xamarin-macios/issues/7456
2020-05-05 10:46:23 -04:00
Sebastien Pouliot e45278259b
[linker] Remove now unneeded code from PreserveCode (#8504)
`monotouch-glue.m` was replaced a while ago and the new code does not
need `Class.LookupFullName` to be preserved in debug builds.

Also `PreserveType` was unused code (left from even older times?)
2020-05-05 09:27:26 -04:00
Rolf Bjarne Kvinge f8be1a8802
Merge pull request #8463 from rolfbjarne/remove-objectwrapper
Remove the ObjectWrapper class
2020-05-05 08:44:55 +02:00
Cosmin Stirbu e164c4d38f Adds platform specific nullability attributes to CoreLocation 2020-05-04 17:30:46 +03:00
Rolf Bjarne Kvinge 956228685c
[src] Fix rebuilding Xamarin.Mac.pdb. (#8496)
Teach make that the target that creates Xamarin.Mac.dll also creates
Xamarin.Mac.pdb, which fixes an issue where the installed version of
Xamarin.Mac.pdb wouldn't always be updated in non-clean builds.
2020-05-04 16:28:18 +02:00
Cosmin Stirbu f17dd4fc18
[avfoundation] Added nullability attributes to AVFoundation (#8490)
* Added nullability attributes to AVFoundation

* Revert AVPlayerItem FromAsset nullability attributes changes to keep existing tests passing and allow backwards compatibility

* Documents common-AVFoundation.ignore entry related to Foundation.NSNumber[] AVFoundation.AVVideoCompositionInstruction::get_RequiredSourceTrackIDs()

!extra-null-allowed! 'Foundation.NSNumber[] AVFoundation.AVVideoCompositionInstruction::get_RequiredSourceTrackIDs()' has a extraneous [NullAllowed] on return type
2020-05-04 08:35:13 -04:00
Rolf Bjarne Kvinge ef8a5736a2 [src] Remove ObjectWrapper.
ObjectWrapper is not safe, and in any case incompatible with .NET 5.
2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge ab50886e47 Convert Runtime.GetNullableType to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge fc233a46ad Convert Registrar.WriteUnmanagedDescription to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 872530dfe0 Convert Runtime.CreateDelegateProxy to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge b0974e8317 Convert Runtime.ConvertNSStringToSmartEnum and Runtime.ConvertSmartEnumToNSString to use GCHandle.
These methods were already partially using GCHandles, so convert the parameter
using ObjectWrapper to GCHandle, and port the rest of the existing logic to
use the new helper API.
2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge b360263f2c Convert Runtime.RegisterAssembly to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge dd7278c4ea Convert Runtime.RegisterEntryAssembly to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 605a83215d Convert Runtime.GetHandleForINativeObject to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge aa875592c8 Convert Runtime.UnregisterNSObject to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge c0c35acd40 Convert Runtime.TryGetOrConstructNSObjectWrapped to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 8ac784ccfe Convert Runtime.GetINativeObject_[Dynamic|Static] to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge e31b9db516 Convert Runtime.GetNSObjectWithType to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 5e44aac2d8 Convert Runtime.IsParameter[Out|Transient] to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge cff3617dd2 Convert Runtime.Dispose to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge e2ee5a2710 Convert Runtime.GetSelector to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge ef92c04135 Convert Runtime.GetClass to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge c25403bb21 Convert Runtime.RegisterNSObject to take a GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 632fd10328 Convert Runtime.GetBlockWrapperCreator, Runtime.CreateBlockProxy and Runtime.Get[Generic]MethodFromToken to use GCHandle.
The native methods xamarin_get_[generic_]method_from_token are a bit unusual
in that they return an actual GCHandle. This is for performance reasons, since
in some cases their return value is passed as parameters to other function
calls to managed code, in which case we need the GCHandle. This way we avoid
round-tripping a GCHandle multiple times.
2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge a7d68ddfbc Convert Runtime.GetMethodAndObjectForSelector to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 1bf3ccfb45 Convert Runtime.TypeGetFullName to use GCHandle. 2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 8afbbf9eee [src] Runtime: add helper functions for GCHandle management. 2020-05-04 11:08:23 +02:00
Rolf Bjarne Kvinge bbcab6f70c
[runtime] Remove a few unused functions. (#8482) 2020-04-30 14:40:56 +02:00
Sebastien Pouliot 4709931933
[generator] Delay some checks when generating code for macOS (#8479) 2020-04-30 08:12:58 -04:00
Sebastien Pouliot dfc7f6267e
[appkit] Remove 32bits code paths from NSGradient (#8478) 2020-04-30 08:10:30 -04:00
Rolf Bjarne Kvinge d601ad5bdf
Use a GCHandle instead of WeakReference in our IntPtr->NSObject table. (#8473)
A WeakReference contains a GCHandle and provides additional services on top,
but we don't need those services, so we can just use a GCHandle instead.

This should decrease memory usage somewhat, since we won't have the
WeakReference objects around.

This also prepares us for switching the native API to use GCHandle instead of
passing MonoObject* to managed code (we won't have to re-create a GCHandle
inside a WeakReference when passed a GCHandle for a managed object).
2020-04-30 09:43:32 +02:00
Cosmin Stirbu f4f89ece0a
[corelocation] Added missing nullability attributes to CoreLocation (#8471) 2020-04-29 13:47:13 -04:00
Whitney Schmidt ecf295f4db
[ImageIO] Update bindings for Xcode11 (#8376)
* initial imagio bindings + test project

* remove sample files, update xtro

* clean up

* add new line at eof

* even more cleanup...

* update based on PR feedback

* reformat according to coding standards

* fix all feedback except monotouch tests

* add monotouch-test files

* fix test feedback

* fix PR feedback

* fix timeout in tests, add asserts for status, update return value for APi to CGImageAnimationStatus enum

* fix == asserts

* respond to more pr feedback

* add StrongDictionary, remove Partial

* NSNumber -> nuint for NSUInteger

* add smaller gif

* remove hack.gif from project

* add gif to csproj
2020-04-28 17:02:36 -04:00
yaliashkevich 05d9520b2c
Avoid ObjCRuntime. Runtime.GetDelegateForBlock race condition. (#8433)
* Initialize block_to_delegate_cache once.

* Lazy initialization of block_to_delegate_cache.

* Use lock_obj while accessing block_to_delegate_cache.

Co-authored-by: Yauheni Aliashkevich <Yauheni_Aliashkevich@epam.com>
2020-04-23 12:34:35 +02:00
Sebastien Pouliot 5eb593f4ba
[generator] Avoid repetitive calls to GetSafeParamName (#8443)
as it can allocate memory (create string) in some cases
also a few other left over pieces from nullability work
2020-04-22 09:23:15 -04:00
Sebastien Pouliot a9721e08cf
[generator] Remove generated, 32bits specific code paths for XM (#8444)
Product now only supports 64bits but the generator was still
producing some dual 32/64 code.

```
    Assembly    |    Profile    |   Before   |    After   |   Diff  |  %
----------------|---------------|------------|------------|---------|------
Xamarin.Mac.dll | full 64bits   | 22 348 800 | 22 082 560 | 266 240 | 1.2%
Xamarin.Mac.dll | mobile 64bits | 22 352 384 | 22 085 632 | 266 752 | 1.2%
```

Fix https://github.com/xamarin/xamarin-macios/issues/8441
2020-04-22 09:10:31 -04:00
Rolf Bjarne Kvinge 697f36e313
[NSObject] Remove dead XAMCORE_2_0 and ARCH_64 code/defines. (#8440) 2020-04-21 17:06:46 +02:00
Chris Hamons b93e97fe92
[AVFoundation] AVPlayerItemMetadataCollector is now 10.12+ (#8435)
- Runs on older macOS show the type is not as documented, nm confirms.
	1) ApiCtorInitTest.DefaultCtorAllowed (Introspection.MacApiCtorInitTest.ApiCtorInitTest.DefaultCtorAllowed)
		1 potential errors found in 1143 default ctor validated:
		Default constructor not allowed for AVFoundation.AVPlayerItemMetadataCollector : Could not create an native instance of the type 'AVFoundation.AVPlayerItemMetadataCollector': the native class hasn't been loaded.
2020-04-20 10:26:20 -05:00
Rolf Bjarne Kvinge 9dd1231e50
[Foundation] Add an overload to NSString.FromHandle that takes an 'owns' parameter. (#8417)
This matches our API elsewhere.
2020-04-20 09:48:29 +02:00
Chris Hamons c0b8036d3b
[mac][mapkit] Allow creation of MKLocalSearchCompleter instance (#8370)
- Fix https://github.com/xamarin/xamarin-macios/issues/8274
- Turns out that MKLocalSearchCompleter can be instanced, even on iOS
	- Tested on sim and in docs
- MKLocalSearchCompletion is still not instanced, updating comment
2020-04-17 12:48:36 -05:00
Chris Hamons e2a73610a7
Add missing ctors to AVPlayerItemMetadataCollector and SKCloudServiceController (#8403)
- https://github.com/xamarin/xamarin-macios/issues/8398
- They were incorrectly marked DisableDefaultCtor in an attempt to fix API breaks
- Manual tests/documentation shows that the default init works
2020-04-17 12:42:08 -05:00
Chris Hamons a066315030
[appkit] Fix smartInsertForString to use nullable out strings (#8365)
- Fixes https://github.com/xamarin/xamarin-macios/issues/8349
2020-04-17 12:38:51 -05:00
Rolf Bjarne Kvinge 28eddda439
Extract the ApplePlatform and LinkMode enums into their own files. (#8411) 2020-04-17 09:45:18 +02:00
Sebastien Pouliot 2dbd247c53
[SystemConfiguration] Add 'IsWWAN' to XM to ease code sharing (#8413)
`IsWWAN` is not available (so it won't be returned) but it's nicer to
include it anyway to make the code better looking.

The example that triggered this was
0bbb51c548 (r409239375)
2020-04-16 21:09:00 -04:00
Sebastien Pouliot 8127c77b35
[foundation] Remove scary 'unsafe' from NSString API that are safe (#8412) 2020-04-16 21:07:26 -04:00
Sebastien Pouliot af7da4b233
[generator] Handle (ignore) C#8 special nullability attributes (#8382)
C# 8 nullability attributes are special (injected into assemblies) and
not meant to be used from C# source code.

We do not **use** them (we generated them) so existing attributes can
be ignored (filtered) by the generator.

Fix https://github.com/xamarin/xamarin-macios/issues/8347
2020-04-14 15:25:00 -04:00
Rolf Bjarne Kvinge 3005f8fa0f
[AppKit] Fix typo hWord -> Word. (#8359) 2020-04-13 17:36:07 +02:00
Manuel de la Pena 7ac67e6e33
[AppKit] NSScreen properties can be executed in non-UI threads. (#8345)
Allow all the properties to be executed outside the UI thread. This has
been tests with Xcode using MTC.
2020-04-10 19:25:56 -04:00
Sebastien Pouliot 8d3987b84a
[xtro][bindings] Add xtro support for nullability and fix some bindings (#8335)
Enabling this will ensure that future bindings (and Xcode updates that
change nullability information) are spotted right away.

The binding fixes are **not** complete, i.e. what was done was mostly
to debug the xtro rule and find corner cases. The backlog will be
_ignored_ so the builds won't fail.
2020-04-10 11:00:47 -04:00