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

12983 Коммитов

Автор SHA1 Сообщение Дата
TJ Lambert fce5bd423d
[NET 6 Attribute Conversion] PdfKit (#14021)
* Remove existing attributes

* Attribute Conversion

* Reverting changes to src/PdfKit/Enums.cs

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2022-02-03 10:44:56 -06:00
Rolf Bjarne Kvinge 0bcb737d8a
[dotnet] Update docs about default inclusion in binding projects. (#14035)
Binding projects enable default compile items now, so the documentation saying
otherwise is outdated and must be rectified.

Ref: 499a69e772
2022-02-03 17:22:45 +01:00
Steve Hawley bdbee30f1d
[NET Conversion] SensorKit (#14032)
* Remove existing attributes

* Attribute Conversion
2022-02-03 09:31:20 -05:00
imhameed adff9df98d
Link against the Compression framework. (#14034)
Mono will eventually use functions from the Compression framework to
decompress ICU data files during the runtime's initialization. Prepare
for this by linking against the compression framework.

Also see https://developer.apple.com/documentation/compression?language=objc.
2022-02-03 10:05:57 +01:00
Rolf Bjarne Kvinge 6c4cd16f32
[ImageKit] Adopt XAMCORE_4_0 changes in .NET. (#14019) 2022-02-03 08:27:12 +01:00
Rolf Bjarne Kvinge f0d4e1a1c7
[generator] Rework how we implement [Abstract] classes in .NET. Fixes #4969. (#14020)
We have a problem that's shown up a few times, where we're given an instance
of a native type, where the closest bound managed type is a type declared as
[Abstract] in the api definition. In this case, we want to create an instance
of the [Abstract] type to wrap the native instance, but that hasn't been
possible because the managed type is abstract.

Note: this is totally fine from the OS perspective: it might have created an
instance of a private subclass we haven't bound (or it might even be a public
subclass we just haven't bound yet).

The fix is to:

* Stop making [Abstract] classes in the api definition abstract classes in the generated code.
* Make the default constructor default to "protected" visibility for [Abstract] classes.

This way we can still create instances of these types at runtime when we need
them, but they must be subclassed in order to create a managed instance of
them.

Additionally I also had to make abstract members virtual for such types
(because otherwise the type would have to be abstract as well), and instead
throw a "You_Should_Not_Call_base_In_This_MethodException" in the
corresponding method implementations.

Fixes https://github.com/xamarin/xamarin-macios/issues/4969.
2022-02-03 08:25:07 +01:00
Rolf Bjarne Kvinge 7fcba144f1
[generator] .NET is XAMCORE v4. (#14023) 2022-02-03 08:24:28 +01:00
Rolf Bjarne Kvinge 045fbd89a6
[CoreText] Adopt XAMCORE_4_0 changes in .NET. (#14024) 2022-02-03 08:24:08 +01:00
Rolf Bjarne Kvinge ecb286be24
[XKit] Adopt XAMCORE_4_0 changes in .NET. (#14027)
This just removes obsolete API.
2022-02-03 08:23:42 +01:00
Rolf Bjarne Kvinge b8ee6c6a55
[AppKit] Rename NSWorkspace.OpenURL[s] to OpenUrl[s] in .NET. (#14028)
Rename NSWorkspace.OpenURL[s] to OpenUrl[s] in .NET to follow our naming guidelines.
2022-02-03 08:05:22 +01:00
Rolf Bjarne Kvinge 6acb26f7f7
[SceneKit] Remove file that's not part of the build. (#14030)
The single enum in this file is also in a different file (which is included in
the build).

In other words: this is just dead code removal.
2022-02-03 08:05:00 +01:00
TJ Lambert 6cf58f6345
[NET 6 Attribute Conversion] OpenGLES (#14010)
* Remove existing attributes

* Attribute Conversion

* Reverting changes to OpenGLES/EAGLEnums.cs

* reverting files with unneccessary changes

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2022-02-02 11:47:39 -06:00
TJ Lambert 91a81a5a4f
[NET 6 Attribute Conversion] OpenGL (#14007)
* Remove existing attributes

* Attribute Conversion

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-02-02 11:45:40 -06:00
TJ Lambert 138604faa6
[NET 6 Attribute Conversion] ObjCRuntime (#14006)
* Removing COREBUILD for mellite

* Remove existing attributes

* Attribute Conversion

* Reverting removing if COREBUILD

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2022-02-02 11:45:23 -06:00
TJ Lambert 844df2123f
[NET 6 Attribute Conversion] NetworkExtension (#13998)
* Remove existing attributes

* Attribute Conversion

* Reverting NEEnums

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-02-02 11:44:29 -06:00
Chris Hamons aa1ccff2c4
[NET 6 Attribute Conversion] Intents (#13948) 2022-02-02 10:57:19 -06:00
Rolf Bjarne Kvinge 363e58f079
[Foundation] Adopt more XAMCORE_4_0 changes in .NET. (#14017)
This is just removing obsolete API.
2022-02-02 17:24:51 +01:00
Rolf Bjarne Kvinge d5697a8867
[runtime] Use the full managed description (including inner exceptions) as the reason when creating an NSException from a managed exception. (#14002)
This makes diagnosing what happens much easier in some cases.

Exhibit A, pre fix:

    *** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException', reason: 'Failed to lookup the required marshalling information.
    Additional information:
    	Selector: conformsToProtocol:
    	Type: ViewController

Exhibit B, post fix:

    *** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException', reason: 'Failed to lookup the required marshalling information.
    Additional information:
    	Selector: conformsToProtocol:
    	Type: ViewController
     (ObjCRuntime.RuntimeException)
    Failed to get the 'this' instance in a method call to templ.ViewController.InvokeConformsToProtocol. (ObjCRuntime.RuntimeException)
       at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject(Type type, IntPtr selector, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
       at ObjCRuntime.Runtime.GetMethodAndObjectForSelector(IntPtr klass, IntPtr sel, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
       at ObjCRuntime.Runtime.get_method_and_object_for_selector(IntPtr cls, IntPtr sel, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc, IntPtr& exception_gchandle)
    Failed to marshal the Objective-C object 0x7f813fd2f470 (type: ViewController). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'templ.ViewController' does not have a constructor that takes one NativeHandle argument). (ObjCRuntime.RuntimeException)
       at ObjCRuntime.Runtime.MissingCtor(IntPtr ptr, IntPtr klass, Type type, MissingCtorResolution resolution)
       at ObjCRuntime.Runtime.ConstructNSObject[T](IntPtr ptr, Type type, MissingCtorResolution missingCtorResolution)
       at ObjCRuntime.Runtime.ConstructNSObject(IntPtr ptr, IntPtr klass, MissingCtorResolution missingCtorResolution)
       at ObjCRuntime.Runtime.GetNSObject(IntPtr ptr, MissingCtorResolution missingCtorResolution, Boolean evenInFinalizerQueue)
       at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject(Type type, IntPtr selector, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
2022-02-02 16:22:34 +01:00
Steve Hawley 9842974c0d
[NET 6 Attribute Conversion] MediaPlayer (#13975)
* Remove existing attributes

* attribute conversion

* using needed

* merged IOS blocks
2022-02-02 10:18:45 -05:00
Rolf Bjarne Kvinge 56a71684e5
[CoreImage] Adopt XAMCORE_4_0 changes in .NET. (#13983) 2022-02-02 16:07:45 +01:00
Chris Hamons 0a57125ccc
[tests] Add ILStrip with satellite assemblies lib (#13973)
- Part of investigation of https://github.com/xamarin/xamarin-macios/issues/13922
2022-02-02 09:01:32 -06:00
TJ Lambert f4e2c3b28a
[NET 6 Attribute Conversion] NaturalLanguage (#13997)
* Remove existing attributes

* Attribute Conversion

* reverting changes to NaturalLanguage/Enums.cs

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-02-02 06:15:59 -06:00
Rolf Bjarne Kvinge 241d821983
[runtime] Don't try to log an exception for GCHandle that has been freed. (#14003)
It does exactly what you'd think it does: nothing helpful at all.

Make sure to use a GCHandle that's alive instead.

Output before fix:

    Xamarin.Mac: Processing managed exception for exception marshalling (mode: 2):
    Failed to print exception: System.NullReferenceException: Object reference not set to an instance of an object.
       at ObjCRuntime.Runtime.PrintException(Exception exc, Boolean isInnerException, StringBuilder sb)
       at ObjCRuntime.Runtime.PrintAllExceptions(IntPtr exception_gchandle)

Output after fix:

    Xamarin.Mac: Processing managed exception for exception marshalling (mode: 2):
    Failed to lookup the required marshalling information.
    Additional information:
       Selector: conformsToProtocol:
       Type: ViewController
     (ObjCRuntime.RuntimeException)
    Failed to get the 'this' instance in a method call to templ.ViewController.InvokeConformsToProtocol. (ObjCRuntime.RuntimeException)
       at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject(Type type, IntPtr selector, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
       at ObjCRuntime.Runtime.GetMethodAndObjectForSelector(IntPtr klass, IntPtr sel, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
       at ObjCRuntime.Runtime.get_method_and_object_for_selector(IntPtr cls, IntPtr sel, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc, IntPtr& exception_gchandle)
    Failed to marshal the Objective-C object 0x7f89e6c2a2a0 (type: ViewController). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'templ.ViewController' does not have a constructor that takes one NativeHandle argument). (ObjCRuntime.RuntimeException)
       at ObjCRuntime.Runtime.MissingCtor(IntPtr ptr, IntPtr klass, Type type, MissingCtorResolution resolution)
       at ObjCRuntime.Runtime.ConstructNSObject[T](IntPtr ptr, Type type, MissingCtorResolution missingCtorResolution)
       at ObjCRuntime.Runtime.ConstructNSObject(IntPtr ptr, IntPtr klass, MissingCtorResolution missingCtorResolution)
       at ObjCRuntime.Runtime.GetNSObject(IntPtr ptr, MissingCtorResolution missingCtorResolution, Boolean evenInFinalizerQueue)
       at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject(Type type, IntPtr selector, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
2022-02-02 08:38:52 +01:00
Rolf Bjarne Kvinge 68aaef9ff7
[dotnet] Ask the linker to not mark copied assemblies if we're in a 'don't link' scenario. (#14011)
This speeds up builds significantly when the linker is disabled.

Test case: building tests/dotnet/MySimpleApp for macOS.

* Before: 37s
* After: 9s
* Difference: 26s (4x faster)

Test case: run the .NET tests

* Before: 2h55
* After: 1h43
* Difference: 1h12 (1.7x faster)

Contributes towards https://github.com/xamarin/xamarin-macios/issues/10251.
Ref: https://github.com/dotnet/linker/issues/2089
2022-02-02 08:36:17 +01:00
Rolf Bjarne Kvinge 16c3268ab3
[ExternalAccessory] Adopt XAMCORE_4_0 changes in .NET. (#14009) 2022-02-02 08:13:01 +01:00
Rolf Bjarne Kvinge 4b1738826f
[FileProvider] Adopt XAMCORE_4_0 changes in .NET. (#14012) 2022-02-02 08:01:06 +01:00
Sebastien Pouliot b9037da426
[coreimage] Modernize CIFilter (#14014)
* [coreimage] Modernize CIFilter

* Use faster `CFString` API (over the slower `NSString` variants)
* Rework internal API to use handles whenever possible
* Better use (and dispose) of `NSNumber`
* Use `ThrowHelper` to throw common exceptions

* Add related binding changes
2022-02-02 07:45:17 +01:00
Rolf Bjarne Kvinge 101c0a7ac0
[Network] Adopt XAMCORE_4_0 changes in .NET. (#13988) 2022-02-01 21:17:18 +01:00
Rolf Bjarne Kvinge db6a3b278e
[ObjCRuntime] Improve code to render an exception to avoid a NullReferenceException in case of invalid input. (#14004)
Output before fix:

    Xamarin.Mac: Processing managed exception for exception marshalling (mode: 2):
    Failed to print exception: System.NullReferenceException: Object reference not set to an instance of an object.
       at ObjCRuntime.Runtime.PrintException(Exception exc, Boolean isInnerException, StringBuilder sb)
       at ObjCRuntime.Runtime.PrintAllExceptions(IntPtr exception_gchandle)

Output after fix:

    Xamarin.Mac: Processing managed exception for exception marshalling (mode: 2):
    Unable to print exception handle 0x102ca12b8: null exception

while not much more informative, it's at least not throwing a NullReferenceException that seems unexpected.
2022-02-01 21:12:50 +01:00
Rolf Bjarne Kvinge 2d48710858
[AppKit] Adopt XAMCORE_4_0 changes in .NET. (#13987)
* A lot of obsolete/deprecated removal.
* Remove the NSDraggingInfo model, which required numerous other changes.
* Remove the NSPasteboardReading/NSPasteboardWriting models, which required more
  numerous changes.
* Update the tests accordingly.
2022-02-01 20:56:32 +01:00
Rolf Bjarne Kvinge 1cf35d5787
[Accounts] Adopt XAMCORE_4_0 changes in .NET. (#13994) 2022-02-01 19:46:15 +01:00
Chris Hamons c171b6fec9
[NET 6 Attribute Conversion] Foundation (#13905) 2022-02-01 11:23:14 -06:00
Chris Hamons ee1e8cb528
[NET 6 Attribute Conversion] CoreVideo (#13889) 2022-02-01 11:22:12 -06:00
Rolf Bjarne Kvinge b1ce33ba51
[Foundation/ObjCRuntime] Use 'ObjCException' as the native exception type name for all platforms in .NET. Fixes #13855. (#13915)
* Use 'ObjCException' instead of 'MonoTouchException' as the managed exception
  type wrapping an NSException for all platforms in .NET (that was already the
  case for macOS, so no change there).
* Make the ObjCException class behave like the MonoTouchException class does.
* Move the ObjCException type to the ObjCRuntime namespace in .NET.

Fixes https://github.com/xamarin/xamarin-macios/issues/13855.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-02-01 17:24:57 +01:00
Rolf Bjarne Kvinge 4d2db6463b
[dotnet] Fix templates to use NativeHandle instead of IntPtr. Fixes #13979. (#14001)
Also make the (NativeHandle) constructor protected instead of public, to make
it clearer that it's not for public consumption.

And modify the template tests to execute the template if we can.

Fixes https://github.com/xamarin/xamarin-macios/issues/13979.
2022-02-01 17:22:53 +01:00
Rolf Bjarne Kvinge 5d4cc0e8d1
[CoreLocation] Fix availability attributes for a few API to match current state of the framework. (#14000) 2022-02-01 12:22:52 +01:00
Rolf Bjarne Kvinge 5606035493
[MediaAccessibility] Adopt XAMCORE_4_0 changes in .NET. (#13984) 2022-02-01 11:31:45 +01:00
Rolf Bjarne Kvinge aaee4d9f27
[ModelIO] Adopt XAMCORE_4_0 changes in .NET. (#13941)
This turned out a bit complex, because numerous ModelIO APIs were initially bound
with wrong matrix types, and had to be rebound later (our matrix type was transposed
with regards to the native matrix type). The new versions often had to use worse
names, so that's being fixed now. This means that numerous tests had to be updated,
because the original API now returns non-transposed matrices.
2022-02-01 08:08:50 +01:00
Rachel Kang a64b03a886
[CHIP] Updates for Xcode13.2 beta 1 (#13884)
* [CHIP] Updates for Xcode13.2 beta 1

* Update based on feedback

* Update based on feedback and intro test failure

* Update xtro .todo files

* Fix some breaking API changes

* Delete silly typos
2022-01-31 18:55:49 -05:00
Rolf Bjarne Kvinge 7517d6a8b5
[WKWebKit] Adopt XAMCORE_4_0 changes in .NET. (#13992) 2022-01-31 23:47:45 +01:00
Rolf Bjarne Kvinge bd5c7b331f
[Contacts] Adopt XAMCORE_4_0 changes in .NET. (#13993) 2022-01-31 23:46:11 +01:00
Steve Hawley 1886681621
[NET 6 Attribute Conversion] MediaToolbox (#13976)
* Remove existing attributes

* Attribute Conversion

* missing using
2022-01-31 17:38:38 -05:00
Rolf Bjarne Kvinge 1d8ef73ee1
[SystemConfiguration] Adopt XAMCORE_4_0 changes in .NET. (#13991) 2022-01-31 21:54:37 +01:00
Rolf Bjarne Kvinge 535507dc81
[VideoToolbox] Adopt XAMCORE_4_0 changes in .NET. (#13985) 2022-01-31 21:53:23 +01:00
Rolf Bjarne Kvinge 1245ca4df7
[IdentityLookup] Adopt XAMCORE_4_0 changes in .NET. (#13989) 2022-01-31 21:46:17 +01:00
Rolf Bjarne Kvinge 2de903f337
[Social] Adopt XAMCORE_4_0 changes in .NET. (#13986)
Also clean up the code to use fewer ifdefs.
2022-01-31 21:33:53 +01:00
Rolf Bjarne Kvinge d1989b63c4
[tests] Simplify makefiles by using shared code. (#13990) 2022-01-31 21:11:08 +01:00
Chris Hamons 44f6cb24e5
[NET 6 Attribute Conversion] MapKit (#13952) 2022-01-31 14:02:29 -06:00
Chris Hamons fdd8410c80
[NET 6 Attribute Conversion] MediaAccessibility (#13951) 2022-01-31 14:00:55 -06:00
Chris Hamons 8847daa6b0
[NET 6 Attribute Conversion] HealthKit (#13950) 2022-01-31 14:00:07 -06:00