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

20 Коммитов

Автор SHA1 Сообщение Дата
Alex Soto 8c207428a9
[ImageCaptureCore] Add ImageCaptureCore Bindings (#5074)
* [ImageCaptureCore] Add ImageCaptureCore Bindings

Fixes xamarin/xamarin-macios#4273

* [ImageCaptureCore] remove not needed `unsafe`

Co-Authored-By: dalexsoto <alex@alexsoto.me>

* Implement feedback
2018-11-07 09:52:39 -05:00
Manuel de la Pena 7c7f46da28
[iTunesLibrary] Xcode 10 beta 3 support. (#4462) 2018-08-08 16:34:16 +02:00
Miguel de Icaza ee4faee1c9 [Network] Declare the Network library in the relevant places 2018-07-05 15:01:47 -04:00
Sebastien Pouliot f9a0253e71
[videosubscriberaccount] Update for beta 1 (#4275)
This ended up enabling the framework for macOS.
2018-06-15 16:43:23 -04:00
Manuel de la Pena f77f44940e
[NaturalLanguage] Added the new framework for Xcode10. (#4236) 2018-06-14 19:21:44 +02:00
Sebastien Pouliot 7372f627ad
[adsupport] Update for beta 1 (#4213) 2018-06-12 05:19:16 -07:00
Rolf Bjarne Kvinge 86a38e5541
[linker] Improve inlining of IsDirectBinding check to inline both true and false values. (#3214)
Previous behavior
=================

* The linker would determine if a class is a generated binding class or not.
  This was determined by the presence of a constructor taking a single IntPtr
  argument, and with a [CompilerGenerated] attribute.
* If a class was not a generated binding class, then that class and all its
  superclasses were marked as not optimizable (in the context of inlining the
  IsDirectBinding check).
* The end result was that all classes with a [CompilerGenerated] IntPtr
  constructor that weren't subclassed, were optimized (the IsDirectBinding
  value was implied to be 'true').

Unfortunately this does not match how the IsDirectBinding value is actually
computed, and is in many cases quite wrong.

Background
==========

The authorative value for the IsDirectBinding value is the register attribute:

```csharp
[Register ("MyClass", true)] // the second parameter specifies the IsDirectBinding value
class MyClass : NSObject {}
```

Due to history this second parameter is called `IsWrapper` and not
`IsDirectBinding`, but it's the exact same thing.

Unfortunately looking up this attribute every time a class is instantiated is
slow (since fetching attributes is slow), so we guess this value in NSObject's
initialization: if the actual type of the object is in the platform assembly,
then we assume IsDirectBinding=true:

```csharp
IsDirectBinding = (this.GetType ().Assembly == PlatformAssembly);
```

and any subclasses in the platform assembly which is not a direct binding have
to set the correct value in their constructors.

New behavior
============

In the linker we now track three states for the IsDirectBinding value for each
class: if it can be inlined into a constant true or false, or if it has to be
checked at runtime (a nullable bool is used, and null corresponds with this
last undetermined state).

* The linker will look at the `[Register]` attribute for a class, and:
    * If the type is CIFilter, store that IsDirectBinding=undetermined.
    * If IsWrapper=False, store that IsDirectBinding=False for that class, and
      that IsDirectBinding=undetermined for all super classes where
      IsWrapper=True.
    * If IsWrapper=True, tentatively assume IsDirectBinding=True in that class
      unless already determined to be undetermined (which will be overruled if
      a non-wrapper subclass is found later).

Results
=======

For monotouch-test, the changes are as follows:

* Classes we can now assume IsDirectBinding=true: https://gist.github.com/rolfbjarne/acd6a8cf1236562a832d6db9400afee9#file-foo-diff-L1-L25
* Classes we previously assumed incorrectly that IsDirectBinding=true: https://gist.github.com/rolfbjarne/acd6a8cf1236562a832d6db9400afee9#file-foo-diff-L27-L645
* Classes we can now assume IsDirectBinding=false: https://gist.github.com/rolfbjarne/acd6a8cf1236562a832d6db9400afee9#file-foo-diff-L647-L2281

There are also minor size improvements (in the iPhone/Debug64 configuration):

The executable is 17.632 bytes smaller:

    -rwxr-xr-x  1 rolf  staff  73038384 Jan 12 12:40 /Users/rolf/test/old/monotouchtest.app/monotouchtest
    -rwxr-xr-x  1 rolf  staff  73020752 Jan 12 12:50 /Users/rolf/test/new/monotouchtest.app/monotouchtest

Xamarin.iOS.dll is 3.072 bytes smaller (this will probably be 0 on a release (stripped) build).

    -rw-r--r--  1 rolf  staff   2522624 Jan 12 12:40 /Users/rolf/test/old/monotouchtest.app/Xamarin.iOS.dll
    -rw-r--r--  1 rolf  staff   2519552 Jan 12 12:50 /Users/rolf/test/new/monotouchtest.app/Xamarin.iOS.dll

CIFilter
========

There's a complication with CIFilters [1] [2], their implementation is
somewhat special, so we do not want to optimize anything for those classes to
not risk getting anything wrong.

[1] https://github.com/xamarin/xamarin-macios/pull/3055
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=15465
2018-01-15 12:28:34 +01:00
Timothy Risi 87f9e23989 [MetalPerformanceShaders] Xcode 9 bindings (#3005)
* [MetalPerformanceShaders] Activate bindings for Xamarin.Mac and add n… (#2816)

* [MetalPerformaceShaders] Several MPSCnnKernel properties should be readonly (#2938)

The subclasses versions of the properties need Override, cannot be removed since it would break visibility for iOS 10

* Remove some [Model] attributes that sholdn't be needed

* Fix introspection test crashes

* More introspection fixes

* NN does not need to be PascalCased

Remove unneeded Models and BaseTypes

* PR Whitespace fixes and renamings

* Paste fail

* More fixes from PR comments

* [MPS] Adds new intro test, fixes ctors and xtro output

* Removes duplicated availability attributes.
* Removes obsoleted API from macOS since mps is new to it.
* Fixes xtro output.
* Adds missing API.
* Fixes parameterless ctors, some of them do not really work, found
  by our new intro test and disabled the one that seem to not make
  sense due to the presence of DesignatedInitializers.
* Fixes a selector typo.
* Adds new `ShouldNotExposeDefaultCtorTest` to intro.

ShouldNotExposeDefaultCtorTest
==============================

This test checks for types with a parameterless ctor that are subclasses
of `NSObject` and then cheks if the BaseType of said objects also expose
a parameterless ctor (all in .NET land), if this is not the case it reports
them and so they can manually audited. Also this test has the ability to
print alloc/init ObjC code by setting `genObjCTestCode` to `true` so you can
take this code into an Xcode project and easily tests the ctors.

It seems that xtro (sharpie) does not have a complete picture of when a ctor
must be exposed hence the hability to generate this code and manually test.

Right now this test is just enabled for MPS since it is the scope of this PR.
In the future it should be enabled for all other frameworks and the output be
manually audited.

* [MPS] Fixes premature collection possible in bindings (bug 59547) and implements feedback.

https://bugzilla.xamarin.com/show_bug.cgi?id=59547

* Fixes premature collection possible in bindings im MPSKernel.cs
* Fixes MPSImageHistogramTest from using deprecated API.
* Removes renamed selectors and typos from ApiSelectorTest and ApiTypoTest.

* [MPS] Reenable Copy API and DesignatedInitializer xtro feedback

* Implement more feedback

* More feedback
2017-11-28 14:29:05 -06:00
Chris Hamons 75235cdf17 Fix a number of introspection test failures on 10.13 (#2815) (#2833) 2017-10-03 12:59:13 -05:00
Miguel de Icaza c453776ac0 [Xcode9] Add IOSurface bindings (#2363)
* This framework was a private framework before iOS 11.

This framework was a private framework before iOS 11, yet the headers claim
many API were introduced in iOS 10.

So take account of this difference by using the private framework location in
iOS 10.3 or earlier.

Testing these API from Xcode works fine when run on an iOS 10.3 device, and
I've confirmed the IOSurface framework is loaded from the private frameworks
path on older devices (and when built using Xcode 9 and linked with the public
framework path).

* Disable code to make IOSurface work on iOS 10.

Disable the code to make IOSurface work on iOS 10, since it may be rejected by
the App Store.

This also means adjusting the availability attributes, so that the
introspection tests pass (and to document that technically these API won't
work when used with Xamarin.iOS in iOS 10).

I've filed bug #[59201][1] to keep track of this, maybe we can re-enable this later.

[1]: https://bugzilla.xamarin.com/show_bug.cgi?id=59201
2017-09-05 08:57:58 -04:00
Chris Hamons 6cd63f38e8 [macos] Add ExternalAccessory APIs from xcode9 (#2526) 2017-08-23 14:22:23 -05:00
Alex Soto 1cbac6a367 [PDFKit] Update to Xcode 9 Beta 1, 2, 3 & 4 (#2378)
* [PDFKit] Update to Xcode 9 Beta 1, 2, 3 & 4

* [PDFKit] Implement feedback

* [PDFKit] the forgotten enum

* [PDFKit] More feedback

* [PDFKit] Add Mac changes

* Missing change

* Fix test RectangleF VS CGRect
2017-08-04 08:06:21 -05:00
Alex Soto 89071bc19d [Vision] Add bindings for Xcode 9 Beta 1, 2 & 3 (#2301)
* [Vision] Add bindings for Xcode 9 Beta 1 & 2

This commit also adds two convenience overloads to GetAttachments
that allows you to get a more strongly typed version of the
returned dictionary, this is needed because there is no easy way
to downcast from NSDictionary to NSDictionary<TKey, TValue>
and it is used in the sample that excecises the Vision API found here

https://github.com/dalexsoto/FaceDetector

* [Vision] Implement feedback

* Add commas to enums to avoid diff spam
* Throw a managed exception when we fail to dinamically call Vision framework

* [Vision] Update to xcode 9 Beta 3

* [vision] fix VNImageCropAndScaleOption enum

Also removed public modifier from enums in order to have interfaces
and enums in sync

* [Vision] Add missing comma to enum

* [Vision] More API enhancements

* Removed default .ctor from types that are not user created
* Added Strong Dictionary to VNImageRequestHandler ctors
* Turned VNImageOption into a StrongDictionary
* Added bug report[1] for BarcodeDescriptor so we do not forget
* Removed duped metadata from manual bindings
* VNDetectedObjectObservation subclasses now have the factory
  method FromBoundingBox inherited from its parent class
  (VNDetectedObjectObservation).

[1]: https://bugzilla.xamarin.com/show_bug.cgi?id=58197

* [Vision] Merge extern API with wrappers, fixed intro!

* [Vision] Add one missing public accessor to VNUtils
2017-07-18 11:12:10 -05:00
Alex Soto f34b61da2b [CoreML] Add Xcode 9 Beta 1 bindings (#2275)
* [CoreML] Add Xcode 9 Beta 1 bindings

* Do not C# 7 here... :'(

* No C# 7 here either :'(

* Apply feedback

* [CoreML] Fix feedback and xtro

* [CoreML] Add more feedback

* Fix build.... What the heck was I thinking, always rebuild your stuff...
2017-06-30 17:35:30 -05:00
Sebastien Pouliot ef399e8756 [mmp] Add Intents and Photos mappings for namespaces (#1983)
MonoMacNamespaces needs them to properly remove the entries from
NSObject.mac.cs.

Fix debug logs:

Unprocessed library / namespace /System/Library/Frameworks/Intents.framework/Intents
Unprocessed library / namespace /System/Library/Frameworks/Photos.framework/Photos
2017-04-11 08:18:25 -04:00
Chris Hamons d20ccf5bc6 [macos] Rework framework/weak_framework handling in mmp (#1953)
- Before this mmp was not adding -framework, -weak_framework consistently on non-static registrar use cases
- GatherFrameworks was previously not ported from mtouch, and did not work as DeploymentTarget was unset in mmp
- Added verbose prints so users can determine why various framework linkages are added
- Fixed an issue where duplicate were being added due to HandleFramework shoving args by hand
- Tested with auto test and https://github.com/chamons/xm-version-regression-test manual test
2017-04-05 14:38:40 -05:00
Rolf Bjarne Kvinge 5fb09b1b84 [linker] Remove static state, and put the state inside DerivedLinkContext instead. (#1657)
Remove the usage of static variables in the linker so that one day we can run
the linker in parallel over multiple assembly sets.
2017-02-10 07:45:42 +01:00
Chris Hamons cdf3915704 Fix EveryFrameworkSmokeTests test with MediaPlayerLibrary (#1418) 2016-12-28 08:46:46 -06:00
Chris Hamons 9530bdf608 [XM] Fix linker ability to deadstrip library loads from NSObject.mac.… (#448)
* [XM] Fix linker ability to deadstrip library loads from NSObject.mac.cd for new libraries

- Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=42177 in Release / Mobile since we can rip out GameController if not used
2016-07-21 12:58:54 -05:00
Rolf Bjarne Kvinge 82ab3fc106 Build mmp. 2016-04-24 14:47:26 -04:00