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

142 Коммитов

Автор SHA1 Сообщение Дата
Vincent Dondain a558d84457 Merge branch 'xcode11.2' into master-merge-xcode11.2 2019-11-05 15:25:49 -05:00
Pramit Mallick f35569a715 [Appkit] Bindings part 4 (#7295)
Complete the AppKit bindings up to Xcode 11.2
2019-10-28 15:38:34 -04:00
Waleed Chaudhry c52a59358f
[UIKit] Add UIKit bindings for xcode11.2b2 (#7290) 2019-10-23 15:12:19 -04:00
Vincent Dondain a3076f29a3 Merge branch 'xcode11.1' into d16-4 2019-10-07 21:46:13 -04:00
Rolf Bjarne Kvinge 3ec3470a4e
[UIKit] Add '[Appearance]' to a few appearance properties. Fixes #6938, (#7134)
Add '[Appearance]' to a few appearance properties as defined in Apple's headers.

Fixes https://github.com/xamarin/xamarin-macios/issues/6938.
2019-10-01 07:21:58 +02:00
Rolf Bjarne Kvinge 303aa0a649 Merge remote-tracking branch 'origin/xcode11' into master-xcode11 2019-09-13 18:35:18 +02:00
Rolf Bjarne Kvinge f6e0531197 Merge xcode11 into d16-3. 2019-09-12 08:29:02 +02:00
Rolf Bjarne Kvinge cd7e293ce0 [UIKit] Make UITraitCollection thread-safe, since that's apparently how Apple treats it. Fixes #6706. (#6948)
Fixes https://github.com/xamarin/xamarin-macios/issues/6706.
2019-09-09 21:35:29 -04:00
Rolf Bjarne Kvinge 344dadb212
Bump the minimum iOS version to 7.0. Fixes #6213. (#6878)
Xcode 11 doesn't support anything below iOS 7.0 (the linker will automatically
change the deployment target to 7.0), so we need to drop support as well
(since our native bits will be targetting iOS 7.0, and we can't change that).

https://github.com/xamarin/xamarin-macios/issues/6213
2019-08-30 01:07:30 -07:00
prmallic fb225bbbdd
[UIKit] Fix threading issue in the selector performAsCurrentTraitCollection. #6870 (#6872)
The thread safe decorator was missing which made the API not behave like the Apple docs states.

https://github.com/xamarin/xamarin-macios/issues/6870
2019-08-29 09:25:59 -04:00
Sebastien Pouliot fac23dc599
[xcode11] Update with Xcode 10.3 changes and fix intro on iOS 12.4 (#6851)
Xcode 10.3 was released over the summer with a very small subset
of the (already out) Xcode 11 betas API.

This PR fix some availability attributes and also ensure we can
run introspection tests successfully on an iOS 12.4 device.
2019-08-27 08:38:12 -04:00
Alex Soto a0b73b6663
[UIKit] Update bindings to Xcode 11 Beta 6 (#6807)
* [UIKit] Update bindings to Xcode 11 Beta 6

* Update src/uikit.cs

* Apply suggestions from code review

* Update src/uikit.cs

* Update src/uikit.cs

* Update src/uikit.cs
2019-08-20 21:55:08 -04:00
Sebastien Pouliot 04263f36d4
[contactsui] Update for Xcode 11 beta 1 to 5 (#6771)
Mark the `iconWithContact:` API as not available with Catalyst

Note that the category `UIApplicationShortcutIcon (ContactsUI)` was
inlined in UIKit's `UIApplicationShortcutIcon` so only that file needs
to be updated.
2019-08-14 22:03:52 -04:00
Sebastien Pouliot ca81952852
[fileprovider[ui]] Update for Xcode 11 beta 1 to 5 (#6759)
Moved some code from uikit.cs since the type moved a while ago. That
ease code sharing with macOS (XM) but it stays into the UIKit namespace
(for XI) until `XAMCORE_4_0` to ensure binary compatibility.
2019-08-14 08:12:07 -04:00
Alex Soto d883febff0
[UIKit] Update bindings to Xcode 11 Beta 5 (#6717) 2019-08-06 07:53:08 -04:00
Whitney Schmidt 6bdb2c6107 add [BindAs] UIWindowSceneSessionRole for UIKit (#6703) 2019-08-01 20:01:14 -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
Chris Hamons 0345986b4f
[uikit] Add [NullAllowed] to UIButton.SetAttributedTitle (#6669)
- https://github.com/xamarin/xamarin-macios/issues/6649
2019-07-30 06:48:01 -07:00
Alex Soto d095f75471
[registrar] Fix a generics type issue with dynamic registrar (#6646)
* [registrar] Fix a generics type issue with dynamic registrar

Fixes xamarin/xamarin-macios#6567

This Fixes an issue in the registrar where the dynamic registrar
misses a case to check for a NSObject constraint triggered by UIKit's
`NSDiffableDataSourceSnapshot` object.

This also enables the rest of missing bindings in UIKit for Xcode 11 B4
which also works as a test case for the registrar fix. Without this fix
introspection test would throw an `AggregateException` and also
includes `NSDiffableDataSourceSnapshotTest` to check that the created
objects are usable.

* Check for Xcode 11 in tests

* Exclude the macOS in our UIKit tests ツ
2019-07-25 05:56:39 -04:00
Alex Soto 50af930c5e
[UIKit] Update bindings to Xcode 11 beta 4 (#6618) 2019-07-19 16:24:51 -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
Rolf Bjarne Kvinge c1e6ac029f [src] Remove/obsolete 'onlyOn64: true' in attributes. (#6595)
* [src] Obsolete 'onlyOn64' parameter to the availability attributes.

* [src] Remove 'onlyOn64: true' from attributes.

* [src] Adjust availability attributes.
2019-07-16 12:13:11 -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
Sebastien Pouliot 71a657d2c5
Bump for Xcode 11 beta 3 (#6480) 2019-07-02 23:34:24 -04:00
Jonathan CONTE 5f8fedb396 [uikit] Add some 'advice' to UISearchController's constructors (#6416)
- Fixes #4114
2019-06-26 12:18:08 -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 31014b0367 [uikit] Allow `null` in `CanOpenURL` Fixes #6256
This is not documented to accept `nil` and from sharpie / headers

```csharp
	// -(BOOL)canOpenURL:(NSURL * _Nonnull)url __attribute__((availability(ios, introduced=3.0)));
	[iOS (3,0)]
	[Export ("canOpenURL:")]
	bool CanOpenURL (NSUrl url);
```

so it looks like we allowed this (it's a rather old API) based on it's
behavior (and well before nullability annotations were available)

Now since the API

* returns a `bool` value **and** `false` is better than an exception;
* was an [old bug fix](https://bugzilla.xamarin.com/show_bug.cgi?id=865);

I added a `[PreSnippet]` so our behavior does not change on newer OS

references:
* https://developer.apple.com/documentation/uikit/uiapplication/1622952-canopenurl?language=objc
* https://github.com/xamarin/xamarin-macios/issues/6256
2019-06-12 13:40:36 -04:00
Rolf Bjarne Kvinge af30ef8a7d [src] Sprinkle availability attributes for iOS 8.1, tvOS 9.0 and watchOS 2.0. 2019-05-09 13:24:50 +02:00
Rolf Bjarne Kvinge 83efaaf70f [src] Sprinkle availability attributes for iOS 8.1, tvOS 9.0 and watchOS 2.0. 2019-05-06 17:01:17 +02:00
Vincent Dondain 86d1b42ad2 Merge branch 'xcode10.2' into master-merge-xcode10.2 2019-04-03 13:57:31 -04:00
Sebastien Pouliot 2e1c3dbea7
[uikit] Update for xcode 10.2 beta 3 (#5635) 2019-02-20 08:22:44 -05:00
Rolf Bjarne Kvinge dbd247ed38
[NSLayoutManager] Complete bindings for NSLayoutManager. Fixes #4740. (#4853)
Fix numerous issues with NSLayoutManager[Delegate]:

* The classes are available in both AppKit and UIKit, but the bindings are
  duplicated (unsuccessfully) in both appkit.cs and uikit.cs. So create a new
  xkit.cs that is shared between XI and XM, and put a shared version of the
  bindings there.

* Bind everything that hasn't already been bound (or deprecated by Apple).

* Methods that take a nullable NSRangePointer has been bound with three overloads:

	* A protected overridable (exported) method that uses IntPtr.
	* A public method without the parameter.
	* A public method with the parameter typed as 'ref NSRange'.

	This makes sure the native method can be overridden if needed, while at
	the same time making it possible to call without providing the nullable
	parameter.

* Fix numerous ugly bindings:

	* There's a great nint/nuint confusion for parameters referring to
	  'character index' and 'glyph index'. XI seems to prefer nuint, while XM
	  seems to prefer nint. Standardize on nuint, since that's how Apple
	  created them.

	* Many methods have names than sound like Objective-C. Fix them all,
	  either right away when possible, or for XAMCORE_4_0.

	* Several parameter names have been modified to comply with our naming
	  guidelines (no abbreviations).

Fixes https://github.com/xamarin/xamarin-macios/issues/4740.
2019-01-29 15:37:48 -05:00
Chris Hamons 6ebe19f630
Add xtro test for [Deprecated] attributes and fix up usages (#4966)
- https://github.com/xamarin/xamarin-macios/issues/4431
2019-01-29 15:37:48 -05: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
Sebastien Pouliot 8757f36ca5
Clarify usage of `[NullAllowed]` in our bindings (#5417)
First part to fix https://github.com/xamarin/xamarin-macios/issues/5416

We currently allow the `[NullAllowed]` attribute anywhere an attribute
can be used on metadata (i.e. no `AttributeUsage` is used).

However the generator only process the attribute in some specific cases,
*silently* ignoring others. This leads to situations such as

```csharp
[NullAllowed, Export ("setInputHandler:")]
void SetInputHandler (AUInputHandler handler);
```

where a `null` argument will throw an `ArgumentNullException` because
`[NullAllowed]` does not mean anything on a method declaration.

To avoid such confusion `[NullAllowed]` should be added on each parameter
(even if all of them requires it) and if a `null` return value is
possible then use `[return: NullAllowed]`.

This PR allows XI/XM bindings to be built, without error, when this
patch is applied.

```diff
diff --git a/src/generator-attributes.cs b/src/generator-attributes.cs
index 965d8469..77162253 100644
--- a/src/generator-attributes.cs
+++ b/src/generator-attributes.cs
@@ -250,6 +250,7 @@ public class IsThreadStaticAttribute : Attribute {

 // When applied to a member, generates the member as static
 // and passes IntPtr.Zero or null if the parameter is null
+[AttributeUsage (AttributeTargets.Property | AttributeTargets.ReturnValue | AttributeTargets.Parameter)]
 public class NullAllowedAttribute : Attribute {
        public NullAllowedAttribute () {}
 }
```

Note that it's unlikely we'll apply this patch _as-is_ to avoid breaking
existing projects. A better approach (in a future PR) is to have the
generator (instead of the C# compiler) issue a warning (instead of an
error) when a `NullAllowed` is ignored.
2019-01-16 09:42:45 -05:00
Sebastien Pouliot f2a05eddc7
Merge xcode10.1 into d15-9 (#5063) 2018-10-31 17:30:44 -04:00
Sebastien Pouliot 3ab481ea70 Merge xcode10.1 into master
Also update apidiff from d15-9 since it's both frozen and includes xcode10.1
2018-10-31 15:54:48 -04:00
Sebastien Pouliot cbfb047adc
Update for Xcode 10.1 final release, including last minute Pen/Tap API (#5055) 2018-10-30 21:12:54 -04:00
monojenkins 1ec90f0fe5 [uikit] Duplicate bindings for 'UIScrollView.ContentOffset' to get correct availability information. Fixes #4893 (#5007)
`ContentOffset` was moved to `UIFocusItemScrollableContainer` in iOS 12.
Since it's a new protocol it's decorated as introduced in iOS 12 - but
the API was actually already available for a long time.

The _trick_ is to keep the original binding inside `UIScrollView`
so it overrides the protocol and keeps the correct availability info.
It requires adding `new` to bindings to avoid compiler warnings.

reference: https://github.com/xamarin/xamarin-macios/issues/4893

---

from @rolfbjarne 

In iOS 12 this property was moved to a protocol, but that protocol's
availability attributes limits it to iOS 12, not iOS 2 where this property was
originally introduced.

This is problematic, because it means we'll throw a
PlatformNotSupportedException if someone tries to call it on 32-bit iOS.

So put the property back on UIScrollView, so that the generated code ends up
with the right availability attributes (and a correct 32-bit implementation).

https://github.com/xamarin/xamarin-macios/pull/5004
2018-10-18 14:37:30 -04:00
Miguel de Icaza dca1f4793f [UIKit] UIGestureRecognizer, support a way of unsubscribing without creating cycles (#4729)
* [UIKit] UIGestureRecognizer, support a way of unsubscribing without creating cycles

This now tracks all the uses of AddTarget with delegates by recording
the Token/Selector pair and making `Dispose()` release all the linkage
as well as providing an enumerator that can be used to get all the
registered Action handlers - this can then be used with .First() and
then passed to `RemoveTarget`.

This addresses https://github.com/xamarin/xamarin-macios/issues/4190

This initial patch is here for discussion of the approach, want to
review and test this before we merge.

* Simplify code a little bit.

* Add test.

* [tests] Add an NSAutoreleasePool to make GestureRecognizerTest.NoStrongCycles happy on 32-bit.
2018-10-18 12:31:39 +02:00
Chris Hamons 1082ce7a09
Add xtro test for [Deprecated] attributes and fix up usages (#4966)
- https://github.com/xamarin/xamarin-macios/issues/4431
2018-10-15 10:43:17 -05:00
Sebastien Pouliot 78af341ca4
[uikit] Duplicate bindings for 'UIScrollView.ContentOffset' to get correct availability information. Fixes #4893 (#4982)
`ContentOffset` was moved to `UIFocusItemScrollableContainer` in iOS 12.
Since it's a new protocol it's decorated as introduced in iOS 12 - but
the API was actually already available for a long time.

The _trick_ is to keep the original binding inside `UIScrollView`
so it overrides the protocol and keeps the correct availability info.
It requires adding `new` to bindings to avoid compiler warnings.

reference: https://github.com/xamarin/xamarin-macios/issues/4893
2018-10-15 08:20:52 -04:00
Rolf Bjarne Kvinge 788b63d96f
[NSLayoutManager] Complete bindings for NSLayoutManager. Fixes #4740. (#4853)
Fix numerous issues with NSLayoutManager[Delegate]:

* The classes are available in both AppKit and UIKit, but the bindings are
  duplicated (unsuccessfully) in both appkit.cs and uikit.cs. So create a new
  xkit.cs that is shared between XI and XM, and put a shared version of the
  bindings there.

* Bind everything that hasn't already been bound (or deprecated by Apple).

* Methods that take a nullable NSRangePointer has been bound with three overloads:

	* A protected overridable (exported) method that uses IntPtr.
	* A public method without the parameter.
	* A public method with the parameter typed as 'ref NSRange'.

	This makes sure the native method can be overridden if needed, while at
	the same time making it possible to call without providing the nullable
	parameter.

* Fix numerous ugly bindings:

	* There's a great nint/nuint confusion for parameters referring to
	  'character index' and 'glyph index'. XI seems to prefer nuint, while XM
	  seems to prefer nint. Standardize on nuint, since that's how Apple
	  created them.

	* Many methods have names than sound like Objective-C. Fix them all,
	  either right away when possible, or for XAMCORE_4_0.

	* Several parameter names have been modified to comply with our naming
	  guidelines (no abbreviations).

Fixes https://github.com/xamarin/xamarin-macios/issues/4740.
2018-10-01 14:17:28 +02:00
Sebastien Pouliot 8dd288925b [uikit] Fix/comment missing API reported by xtro 2018-08-24 11:24:47 -04:00
Manuel de la Pena bf3d722360 [UIKit] Add support for Xcode 10 beta 5. (#4556) 2018-08-02 16:31:35 -04:00
Alex Soto 38bbffde76
[WebKit] Update bindings to Xcode 10 Beta 1, Nothing on beta 2 or 3 (#4443)
Allso adds UIKit UIWebView deprecations
2018-07-13 21:19:57 -05:00
Manuel de la Pena 6c06b962ab [UIKit] Added support for Xcode 10 beta 3. (#4395) 2018-07-06 11:52:56 -04:00
Manuel de la Pena 553238abc8
[UIKit] Update for Xcode10. (#4253) 2018-06-18 16:01:47 +02:00
Rolf Bjarne Kvinge b1c5ebf326
[generator] Register models with unique names to not match platform types. Fixes #3875. (#3879) (#3888)
* Move Registrar.SanitizeName to StringUtils.SanitizeObjectiveCName.

* [generator] Register models with unique names to not match platform types. Fixes #3875.

* [NSObject] Don't compare against a non-existent protocol.

* [generator] Make it possible to register models like before if the binding developer wishes it.

* [src] Make sure to not declare ObjC classes Apple already defines.

Fixes these warnings at startup:

    Class DOMNodeFilter is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy (0x7fffa944a788) and /Users/builder/data/lanes/6035/0ca02336/source/xamarin-macios/tests/xharness/tmp-test-dir/dont link-mac-unified/bin/x86/Debug-unified/dont link.app/Contents/MacOS/dont link (0x10d8a9958). One of the two will be used. Which one is undefined.
    Class WebOpenPanelResultListener is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy (0x7fffa944e4c8) and /Users/builder/data/lanes/6035/0ca02336/source/xamarin-macios/tests/xharness/tmp-test-dir/dont link-mac-unified/bin/x86/Debug-unified/dont link.app/Contents/MacOS/dont link (0x10d8a9a98). One of the two will be used. Which one is undefined.
    Class WebPolicyDecisionListener is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy (0x7fffa944e838) and /Users/builder/data/lanes/6035/0ca02336/source/xamarin-macios/tests/xharness/tmp-test-dir/dont link-mac-unified/bin/x86/Debug-unified/dont link.app/Contents/MacOS/dont link (0x10d8a9ae8). One of the two will be used. Which one is undefined.
    Class MTLCaptureScope is implemented in both /System/Library/Frameworks/Metal.framework/Versions/A/Metal (0x7fffa806f1d0) and /Users/builder/data/lanes/6035/0ca02336/source/xamarin-macios/tests/xharness/tmp-test-dir/dont link-mac-unified/bin/x86/Debug-unified/dont link.app/Contents/MacOS/dont link (0x10d8aa858). One of the two will be used. Which one is undefined.
    Class JSExport is implemented in both /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore (0x7fffa7eb4f60) and /Users/builder/data/lanes/6035/0ca02336/source/xamarin-macios/tests/xharness/tmp-test-dir/dont link-mac-unified/bin/x86/Debug-unified/dont link.app/Contents/MacOS/dont link (0x10d8aaa38). One of the two will be used. Which one is undefined.
2018-04-06 19:58:20 +02:00
Sebastien Pouliot 7c45477e40
[foundation][uikit] Add missing [DesignatedInitializer] on default constructor (#3454)
Like reported by xtro (data files updated)
using the new, simpler `[DesignatedDefaultCtor]` attribute
2018-02-12 22:52:33 -05:00