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

52 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge c1606d5497
[Foundation] Unify a few NSAttributedString constructor implementations. (#16804)
Unify the code for the following constructors:

* NSAttributedString (NSData data, NSDictionary options, out NSDictionary resultDocumentAttributes, ref/out NSError error);
* NSAttributedString (NSUrl url, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref/out NSError error);
* NSAttributedString (NSData data, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref/out NSError error);

These functions use 'ref' arguments instead of 'out' arguments for mobile
platforms (likely due to the generator not having proper 'out' parameter
support when these functions were implemented), so improve to use 'out'
parameters in XAMCORE_5_0 (and macOS, where they already use 'out'
parameters).

Also fix nullability.

Ref: https://github.com/xamarin/xamarin-macios/issues/15216
2022-11-21 21:05:20 +01:00
Rolf Bjarne Kvinge 95783dbb50
[Foundation] Unify a few NSAttributedString functions. (#16782)
Unify the code for the following functions:

* NSAttributedString.GetData[FromRange]
* NSAttributedString.GetFileWrapper[FromRange]

These functions use 'ref' arguments instead of 'out' arguments for mobile
platforms (likely due to the generator not having proper 'out' parameter
support when these functions were implemented), so improve to use 'out'
parameters in XAMCORE_5_0 (and macOS, where they already use 'out'
parameters).

Also fix nullability.

Ref: https://github.com/xamarin/xamarin-macios/issues/15216
2022-11-17 15:51:19 +01:00
Rolf Bjarne Kvinge bedcbb063f
[Foundation] Remove support for '[NSAttributedString initWithFileURL:options:documentAttributes:error:]'. (#16787)
The 'initWithFileURL:options:documentAttributes:error:' was deprecated in iOS
9, and a new alternative (initWithURL:options:documentAttributes:error:) was
added. At the time, we implemented automatic detection of the current OS, and
would choose one version or the other depending on which was available.

We won't support anything below iOS 9 anymore, which means that keeping the
backwards-compatible constructor is useless, so just remove the corresponding
code and expose the new alternative directly.

On another note, this constructor uses a 'ref NSError' argument instead of an
'out NSError' on mobile platforms (likely due to the generator not having
proper 'out' parameter support when this constructor was implemented), so
improve to use 'out' parameters in XAMCORE_5_0 (and macOS, where it already
uses 'out' parameters).

Ref: https://github.com/xamarin/xamarin-macios/issues/15216
2022-11-17 15:45:11 +01:00
Rolf Bjarne Kvinge cb6f555665 Merge main into xcode14.1. 2022-10-17 11:35:33 +02:00
Rolf Bjarne Kvinge 05939b5e86
[xtro] Don't allow entries in 'common' ignore files that aren't actually common to all platforms for a given framework. Fixes #12769. (#16342)
This makes it possible to run xtro consistently when not all platforms are
enabled.

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

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-10-14 09:29:59 +02:00
Manuel de la Pena 8cecb962a4
[UIKit] Add support for Xcode 14 up to beta 5. (#15694)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-08-26 20:14:11 -04:00
Ryan Pendleton 49249344e9
[UIKit] Correct nullability attributes for parts of UIKit (#15200)
These changes correct some of the nullability attributes for the UIKit bindings. Although UIKit has several hundred lines of xtro-sharpie ignores related to nullability, this PR only fixes a few of them.

I wasn't sure where to draw the line, but in the end, I essentially fixed most of `UIViewController` and all of `UITableView` and `UICollectionView`. These classes were the ones that led to the most `// ReSharper disable` comments being added in my team's codebase, and/or that led to crashes being introduced by devs following ReSharper's suggestions to remove "unnecessary" null-checks.

These changes were largely based on the instructions given by @spouliot in [#6154](https://github.com/xamarin/xamarin-macios/issues/6154#issuecomment-620014843). However, I noticed the xtro-sharpie ignore files have been duplicated in the `api-annotations-dotnet` directory since then, so I updated the .ignore and .todo files in that directory as well.

If the process has changed since that comment was written, I can make any additional changes that are needed.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-06-08 11:21:54 +02:00
Chris Hamons d51bd343f7
Add nullability on one UndoManager API (#14653)
- Fixes https://github.com/xamarin/xamarin-macios/issues/14646
- I checked UIDocument and AppKit versions and those are not nullable.
2022-04-06 10:43:29 -05:00
Rolf Bjarne Kvinge 06100d8dca
[xtro] Update legacy annotations to talk about .NET instead of XAMCORE_4_0. (#14094)
This makes the XAMCORE_4_0 list in our source code substantially smaller.
2022-02-09 08:27:46 +01:00
Rolf Bjarne Kvinge 0a10670d2e
[UIKit] Rename UISegmentedControl.DividerImageForLeftSegmentStaterightSegmentStatebarMetrics to UISegmentedControl.GetDividerImage in .NET. Fixes #6357. (#14059)
Also make the return value nullable since xtro says so.

Fixes https://github.com/xamarin/xamarin-macios/issues/6357.
2022-02-04 07:50:47 +01:00
Rolf Bjarne Kvinge 82a3b71c60
[Foundation] Adopt a better name/signature for numerous Foundation API in .NET. (#13776) 2022-01-20 10:32:55 +01:00
Rolf Bjarne Kvinge d1b5507111
[xtro] Skip numerous validations for deprecated API. (#13383)
There are numerous checks that don't make much sense to report for deprecated
API, so skip those. This also required updating a few .ignore and .todo files.
2021-11-18 16:26:30 +01:00
Alex Soto 8bc4fc645c
[UIKit] Update bindings to Xcode 13 Beta 5 (#12706)
* [UIKit] Update bindings to Xcode 13 Beta 5

* Fix tvOS availability

* Apply feedback

* Add UIPointerAccessory and feedback

* Fix typo

* Fix availability

* Apply feedback and fix library field lookup
2021-09-14 16:31:45 -04:00
Sebastien Pouliot dac58e4115
[objcruntime] Enable nullable on `Selector` class (#12340)
This requires a small change to the generator since `Selector.FromHandle`
can return `null` but it does not means the invoked API can (and we are
interested in the later).

Fixed up existing API returning potentially `null` `Selector`, IOW adding
the missing `[NullAllowed]` on them and updating xtro.
2021-08-04 08:47:53 -04:00
Rolf Bjarne Kvinge f521537e0a
[AppKit/UIKit] Share the implementation of some classes between AppKit and UIKit. (#12161)
* [AppKit/UIKit] Merge the definitions of NSTextLayoutOrientationProvider.

It looks like this might be a breaking change for macOS, but the macOS
definition had only a [Model] attribute, which won't make the generator
generate any public API.

* [AppKit/UIKit] Merge the definitions of NSTextContainer.

* [AppKit/UIKit] Merge the definitions of NSExtendedStringDrawing.
2021-07-21 14:52:19 +02:00
Rolf Bjarne Kvinge 80d2bfa252
[src] Share the NSTextAttachment[Container] implementations between AppKit and UIKit. (#12135)
* [src] Share the NSTextAttachment[Container] implementations between AppKit and UIKit.

* Use shared definition of UIImage/NSImage.
2021-07-20 08:00:35 +02:00
Rolf Bjarne Kvinge dba3bf30b1
[AppKit/UIKit] Share the implementation of some classes between AppKit and UIKit. (#12131)
* [src] Share [I]NSCollectionLayoutVisibleItem implementation between AppKit and UIKit.

* [src] Share several NSLayout* implementations between AppKit and UIKit.
2021-07-16 18:24:50 +02:00
Alex Soto 16dcaa1c72 Fix xtro 2021-04-03 17:58:31 -04:00
Alex Soto bc1d8513a6 Merge remote-tracking branch 'xamarin/xcode12.5' into alex-xcode12.5-main 2021-04-02 21:46:31 -04:00
Sebastien Pouliot 584b45a25e
[catalyst] Remove extraneous API detected by xtro (#10872)
This fixes almost [1] all `extra` API detected from the extrospection
(header-based) tests for MacCatalyst. This is needed to complete the
introspection fixes (without having _too large PR).

[1] except `!extra-null-allowed!` since those are still in progress for
all platforms
2021-03-16 16:04:01 -04:00
Alex Soto ba58ddd217
[UIKit] Update bindings for Xcode 12.5 Beta 1 to Beta 3 (#10851)
* [UIKit] Update bindings for Xcode 12.5 Beta 1 to Beta 3

* Fix condition

* Apply feedback!

* Update tests/monotouch-test/UIKit/UIListSeparatorConfigurationTest.cs
2021-03-12 12:26:24 -05:00
Sebastien Pouliot 755b60e64c
[catalyst] Remove "unknown" API inside existing frameworks (#10731)
xtro tests are based on Apple's header files and report as _unknown_
bindings to API that are not found in headers - Catalyst in this case.

Removing them is required so the applications can be submitted to the
AppStore.
2021-02-26 11:49:24 -05:00
Sebastien Pouliot d7f8825119
[tests][xtro] Add enum member/values checks. Fix #7527 (#9691)
Figure out if
* we're missing enum values (easy to workaround, but annoying for developers)
* we expose enum values that are not defined natively (potential bugs)

reference: https://github.com/xamarin/xamarin-macios/issues/7527
2020-10-05 15:57:18 -04:00
Sebastien Pouliot 144f926cea
[tests][xtro] Check for missing/extra [Appearance]. Fix #7136 (#9765)
based on the header's `UI_APPEARANCE_SELECTOR` decorations

Fix https://github.com/xamarin/xamarin-macios/issues/7136
2020-10-02 13:51:55 -04:00
Manuel de la Pena dcb0c93ab0 [Xcode12] Bring xcode 12 changes into main. 2020-09-23 16:05:22 -04:00
Rolf Bjarne Kvinge 1d3c9f4a04
[UIKit] Sprinkle NullAllowed on UIImage according to Apple's headers. Fixes #9597. (#9598)
Fixes https://github.com/xamarin/xamarin-macios/issues/9597.
2020-09-09 08:49:08 +02:00
Sebastien Pouliot 1f37a5c40e
[xcode12][tests][xtro] Update xtro files (#9541) 2020-08-28 09:05:34 -04:00
Rolf Bjarne Kvinge 5327564109
[AppKit/UIKit] Merge the definitions of NS[Mutable]ParagraphStyle. (#9261)
* Reduces code duplication.
* Makes the macOS versions thread-safe (the iOS versions have been thread-safe
  for years: 2c6a5303a7).
* A few parameters names were different in the definitions; I chose to keep the ones in Xamarin.iOS, since they looked better.
* Xamarin.Mac had two methods, SetTextBlocks and SetTextLists, in place of an actual property override (for the mutable setter), this was fixed to be an actual property overload, and compat methods were implemented.
* xtro needed an update to cope with multiple static methods for the same selector.
2020-08-04 14:25:24 +02:00
Sebastien Pouliot f427b5e91d
[xcode12] Bump for beta 1 (#8935)
Known issues https://github.com/xamarin/xamarin-macios/issues/8943
2020-06-26 14:02:44 -04:00
monojenkins 015fd895c5
[d16-7] [xtro][bindings] Add xtro support for nullability and fix some bindings (#8341)
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 12:37:16 -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
Alex Soto ac8fb30f5d
[xcode11.4] Initial commit for Xcode 11.4 Beta 3 support (#8034)
* [xcode11.4] Initial commit for Xcode 11.4 Beta 3 support

* [monotouch-test] Adjust `TextFieldTest.EmptySelection` to 13.4 changes
2020-03-04 11:24:02 -05:00
Alex Soto dd83fbed2d
[UIKit] Update bindings to Xcode 11.4 Beta 2 (#7963) 2020-02-25 06:50:39 -05:00
Alex Soto b437313fe0
[UIKit] Update bindings to Xcode 11.4 Beta 1 (#7887) 2020-02-13 16:12:07 -05:00
Alex Soto d883febff0
[UIKit] Update bindings to Xcode 11 Beta 5 (#6717) 2019-08-06 07:53:08 -04:00
Alex Soto d10d7f0370
[xcode11] Bump to Xcode 11 Beta 5 (#6684)
* [xcode11] Bump to Xcode 11 Beta 5
2019-07-30 14:16:44 -04:00
Sebastien Pouliot 7fcd8d7974 Bump for Xcode 11 beta 4 (#6603)
* Bump for Xcode 11 beta 4

xtro tests will fail until we have an update for sharpie, however
the introspection tests should be fine (with the small changes in
arkit.cs and uikit.cs)

xtro failure:

```
System.NotImplementedException: AVAudioInteger
  at (wrapper managed-to-native) Clang.Ast.AstReader.LoadInternal(Clang.Ast.AstReader,string)
  at Clang.Ast.AstReader.Load (System.String astPath) [0x00014] in /Users/builder/vsts-agent/_work/5/s/Clang/Ast/AstReader.cs:33
  at Extrospection.Runner.Execute (System.String pchFile, System.Collections.Generic.IEnumerable`1[T] assemblyNames) [0x0019a] in /Users/poupou/git/xcode11/xamarin-macios/tests/xtro-sharpie/Runner.cs:54
  at Extrospection.MainClass.Main (System.String[] args) [0x00046] in /Users/poupou/git/xcode11/xamarin-macios/tests/xtro-sharpie/Program.cs:20
```

due to

```diff
-typedef CF_ENUM(NSInteger, AVAudioSessionErrorCode) {
+typedef CF_ENUM(AVAudioInteger, AVAudioSessionErrorCode) {
```
https://github.com/xamarin/xamarin-macios/wiki/CoreAudioTypes-iOS-xcode11-beta4

* [tests] CoreText stopped reporting error when font files are missing

* Fix xtro (EnumCheck.cs) and update its data files

* Fix xtro results (due to some local changes)
2019-07-18 05:44:34 -04:00
Alex Soto 2d53b90723
[UIKit] Partial update to Xcode 11 Beta 1, 2 and 3 - Part 2 of ? (#6553)
* [UIKit] Partial update to Xcode 11 Beta 1, 2 and 3 - Part 2 of ?

Missing bindings for

* NSDiffableDataSourceSnapshot
* UICollectionViewDiffableDataSource
* UITableViewDiffableDataSource

due to a registrar issue git generics.

* Update src/UIKit/UIFont.cs

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Update src/uikit.cs

* More feedback

This also disables

* FloatRangeTest.Equals
* FloatRangeTest.ManagedVersusNative

due to https://github.com/xamarin/maccore/issues/1885

* [UIKIt] Start fixing `UITextWritingDirection` situation

But the complete fix is for another time https://github.com/xamarin/xamarin-macios/issues/6573
2019-07-12 13:44:24 -04:00
Alex Soto a8b90e68f0
[UIKit] Partial update to Xcode 11 Beta 1 and 2 - Part 1 of ? (#6392)
* [UIKit] Partial update to Xcode 11 Beta 1 and 2 - Part 1 of ?

Adds new classes included in Xcode 11 Beta 1 and 2, all stuff
included in this PR is up to date with Beta 2.

* Fix whitespace.

* Add tvOS availability attributes.

* UNNotificationResponse is public, it just need a using.

* Update xtro.

* [tests/.gitignore] Update ignored files

Avoid new generated csprojs

```
	tests/apitest/apitest-unified-32.csproj
	tests/apitest/apitest-unified.csproj
	tests/apitest/apitest-unifiedXM45-32.csproj
	tests/apitest/apitest-unifiedXM45.csproj
	tests/introspection/Mac/introspection-mac-unified-32.csproj
	tests/introspection/Mac/introspection-mac-unified.csproj
	tests/linker/mac/dont link/dont link-mac-unified-32.csproj
	tests/linker/mac/dont link/dont link-mac-unified.csproj
	tests/linker/mac/dont link/dont link-mac-unifiedXM45-32.csproj
	tests/linker/mac/dont link/dont link-mac-unifiedXM45.csproj
```

* Implement feedback

* More feedback

* [Tests] Fix Apple's lies in headers for tvOS

Whatch is fine
2019-06-21 18:25:04 -04:00
Sebastien Pouliot dec78af591
[foundation] Fix NSCopying.Copy - the biggest offender of not releasing its return value (#6271)
Manual backport of https://github.com/xamarin/xamarin-macios/pull/6230

and part of https://github.com/xamarin/xamarin-macios/pull/6171 to get PR green
2019-06-12 16:02:04 -07:00
monojenkins 72c4a8ab90 [xtro] Add new checker for '[return: Release]' attributes. Fixes #6014. (#6151)
Also add a 'u2ignore' tool that can copy the resulting unclassified (all 1612
of them) to the ignore files.

Fixes https://github.com/xamarin/xamarin-macios/issues/6014.
2019-05-28 10:10:39 -07:00
Alex Soto 0e8393f1f7
[UIKit] Update bindings to Xcode 10.2 Beta 1 (#5475)
* [UIKit] Update bindings to Xcode 10.2 Beta 1

* Remove the test from tvOS because it will break the build...
2019-01-25 13:01:07 -05:00
Vincent Dondain eec95e881c Merge branch 'd15-8' into xcode10-rebase-15.8 2018-08-13 21:04:56 -04:00
Manuel de la Pena bf3d722360 [UIKit] Add support for Xcode 10 beta 5. (#4556) 2018-08-02 16:31:35 -04:00
Sebastien Pouliot fe159bda2d
Update for xcode 10 beta 5 (#4527) 2018-07-31 08:49:19 -04:00
Sebastien Pouliot cc73932ea5 Bump for xcode10 beta 2 2018-06-19 15:26:08 -04:00
Manuel de la Pena 553238abc8
[UIKit] Update for Xcode10. (#4253) 2018-06-18 16:01:47 +02:00
Vincent Dondain 4da8016db4
[xtro] Report missing-protocol-conformance when protocols are defined… (#3187)
- Fixes bug #59272: [xtro] Report !missing-protocol-conformance! when protocols are defined in categories
(https://bugzilla.xamarin.com/show_bug.cgi?id=59272)
- Implemented missing protocol conformances based on tool's new data.
- Remove Internal check from VisitObjCCategoryDecl and VisitObjCInterfaceDecl
- Ignore previewItemTitle failure (normal since it's optional)
- Only skip UIStateRestoring for subclasses of UIViewController
- Ignore UIStateRestoring test on watchOS (UIViewController not available)
- Remove protocol conformances that generated wrong availability attributes (https://github.com/xamarin/xamarin-macios/issues/3213)
- Avoid new virtual or virtual when adding protocol conformance (https://github.com/xamarin/xamarin-macios/issues/3217)
2018-01-18 13:41:09 -05:00
Sebastien Pouliot 3ea8ad4041
[tests][xtro] Annotation update (#3143) 2018-01-02 08:18:32 -05:00
Sebastien Pouliot a69e161d59
[src] Properly annotate designated initializers in many frameworks (#3142)
Correspond to xtro `!missing-designated-initializer!` errors
2017-12-28 16:37:13 -05:00