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

8 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 68de101ce6
[UIKit] Wrap the call to UIApplicationMain in a @try/@catch handler. (#15746)
Wrap the call to UIApplicationMain in a @try/@catch handler, and convert any
Objective-C exceptions to a managed exception.

This way the managed Main method (which calls UIApplication.Main) will be able
to catch any Objective-C exceptions.
2022-08-26 13:56:33 +02:00
Rolf Bjarne Kvinge 14e76c0139
[runtime] Return the exception from wrapper methods for exception marshalling. (#11382)
There's no general way to set a pending managed exception in CoreCLR (the
current plan is to support setting a pending managed exception for the
objc_msgSend family of functions). This means that the way we've implemented
custom wrappers that can handle Objective-C exceptions won't work, because
those wrappers currently tries to set a pending managed exception (which Mono
throws upon returning from the corresponding native wrapper function).

So rewrite this a bit: these custom wrappers now return a GCHandle with the
managed exception as an out parameter, and the calling managed code throws
that exception instead.

This also required adjusting a few API definitions to match how their wrapper
functions are defined.
2021-05-04 08:25:38 +02:00
Rolf Bjarne Kvinge 24ed1ddc66
[runtime] Remove Classic code. (#8720) 2020-06-02 08:18:24 +02:00
Manuel de la Pena 2e5b64893f
[Runtime] Enable the -Wshorten-64-to-32 flag and fix all warnings. (#7353)
* [Runtime] Enable the -Wshorten-64-to-32 flag and fix all warnings.

We want to enable the -Wconversion but that will raise too many warning
for a single commit. We are enabiling one by one the flags included in
-Wconversion so that we have smaller diffs.

-Wshorten-64-to-32 adds warnings when there is a implicit conversion that
loses integer precision. We are moving all the 32 to 64 conversions to
use 64. Expecially since most of the code changed is related with sizes,
legths and params counts that are never going to be negative.


Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
2019-11-05 11:00:14 -05:00
Sebastien Pouliot c0e5176e9e
[runtime] Simplify Vision dlsym'ed functions (#7307)
* [runtime] Simplify Vision dlsym'ed functions

More code sharing - DRYer :)

It also remove complaints (from static analysis tools) that a `dlclose`
should be present. That's not really an issue here since it's reference
counted and won't be unloaded if you use the code (and such a call is
not added in the PR). It silence the warning since it's not a local
variable anymore.
2019-10-28 09:21:34 -04: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
Rolf Bjarne Kvinge 5feea25f3c [runtime] Use xamarin_process_nsexception instead of xamarin_throw_ns_exception in our generated bindings. (#84)
This makes the generated bindings play nice with exception marshaling.
2016-05-26 13:36:56 +02:00
Rolf Bjarne Kvinge ac418df815 Build our runtime. 2016-04-24 14:47:24 -04:00