Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AppKit] Update Xcode 13.0 bindings for betas 1,2,3,4,5 #12936

Merged
merged 3 commits into from
Oct 7, 2021

Conversation

rachelkang
Copy link
Contributor

No description provided.

@rachelkang rachelkang added the note-highlight Worth calling out specifically in release notes label Oct 5, 2021
@rachelkang rachelkang added this to the xcode13.0 milestone Oct 5, 2021
src/appkit.cs Outdated
@@ -13069,6 +13143,30 @@ partial interface NSScreen {
string LocalizedName { get; }
}

[NoMacCatalyst]
partial interface NSScreen
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was unsure about what to do about this interface structure - there are a couple other partial interfaces with the same name, in the same file here. Not sure why they're all separated, but sharpie does the same, and diffs suggest the interface is new for some reason. So, I just did what the diffs/sharpie seem to indicate.

But I was wondering - why is it like that? Can't I just add these new properties to the partial interface above?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why sharpie does that, but you can just add it to any existing partial interfaces (at the very least it makes it less confusing for the next person).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, thanks!

Copy link
Member

@rolfbjarne rolfbjarne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I mostly just had a few comments about naming.

src/appkit.cs Outdated
[Mac (12,0)]
[IgnoredInDelegate]
[Export ("applicationSupportsSecureRestorableState:")]
bool ApplicationSupportsSecureRestorableState (NSApplication application);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'application' suffix is often emitted from the managed name in this case, because it's somewhat redundant (look at the other methods in this class, they mostly do the same thing) - in the UIApplicationDelegate class the logic is about UIApplication, which means that spelling out 'Application' all the time feels a bit unnecessary:

Suggested change
bool ApplicationSupportsSecureRestorableState (NSApplication application);
bool SupportsSecureRestorableState (NSApplication application);

src/appkit.cs Outdated
[IgnoredInDelegate]
[Export ("application:handlerForIntent:")]
[return: NullAllowed]
NSObject GetApplication (NSApplication application, INIntent intent);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somewhat of a similar case, the important part is what comes after 'application:', so this is a better managed name:

Suggested change
NSObject GetApplication (NSApplication application, INIntent intent);
NSObject GetHandler (NSApplication application, INIntent intent);

src/appkit.cs Outdated
[Mac (12,0)]
[IgnoredInDelegate]
[Export ("applicationShouldAutomaticallyLocalizeKeyEquivalents:")]
bool ApplicationShouldAutomaticallyLocalizeKeyEquivalents (NSApplication application);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same:

Suggested change
bool ApplicationShouldAutomaticallyLocalizeKeyEquivalents (NSApplication application);
bool ShouldAutomaticallyLocalizeKeyEquivalents (NSApplication application);

src/appkit.cs Outdated

[Mac (12,0)]
[Export ("applicationProtectedDataWillBecomeUnavailable:")]
void ApplicationProtectedDataWillBecomeUnavailable (NSNotification notification);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void ApplicationProtectedDataWillBecomeUnavailable (NSNotification notification);
void ProtectedDataWillBecomeUnavailable (NSNotification notification);

src/appkit.cs Outdated

[Mac (12,0)]
[Export ("applicationProtectedDataDidBecomeAvailable:")]
void ApplicationProtectedDataDidBecomeAvailable (NSNotification notification);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void ApplicationProtectedDataDidBecomeAvailable (NSNotification notification);
void ProtectedDataDidBecomeAvailable (NSNotification notification);

src/appkit.cs Outdated
[Async]
[Mac (12,0)]
[Export ("setDefaultApplicationAtURL:toOpenContentTypeOfFileAtURL:completionHandler:")]
void SetDefaultApplicationToOpenContentType (NSUrl applicationURL, NSUrl url, [NullAllowed] Action<NSError> completionHandler);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void SetDefaultApplicationToOpenContentType (NSUrl applicationURL, NSUrl url, [NullAllowed] Action<NSError> completionHandler);
void SetDefaultApplicationToOpenContentType (NSUrl applicationUrl, NSUrl url, [NullAllowed] Action<NSError> completionHandler);

src/appkit.cs Outdated
[Async]
[Mac (12,0)]
[Export ("setDefaultApplicationAtURL:toOpenFileAtURL:completionHandler:")]
void SetDefaultApplicationToOpenFile (NSUrl applicationURL, NSUrl url, [NullAllowed] Action<NSError> completionHandler);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void SetDefaultApplicationToOpenFile (NSUrl applicationURL, NSUrl url, [NullAllowed] Action<NSError> completionHandler);
void SetDefaultApplicationToOpenFile (NSUrl applicationUrl, NSUrl url, [NullAllowed] Action<NSError> completionHandler);

src/appkit.cs Outdated
[Mac (12,0)]
[Export ("URLForApplicationToOpenContentType:")]
[return: NullAllowed]
NSUrl URLForApplication (UTType contentType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this have to be a bit more explicit to be understandable:

Suggested change
NSUrl URLForApplication (UTType contentType);
NSUrl GetUrlForApplicationToOpenContentType (UTType contentType);

src/appkit.cs Outdated

[Mac (12,0)]
[Export ("URLsForApplicationsToOpenContentType:")]
NSUrl[] URLsForApplications (UTType contentType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NSUrl[] URLsForApplications (UTType contentType);
NSUrl[] GetUrlsForApplicationsToOpenContentType (UTType contentType);

src/appkit.cs Outdated
[Async]
[Mac (12,0)]
[Export ("setDefaultApplicationAtURL:toOpenContentType:completionHandler:")]
void SetDefaultApplication (NSUrl applicationURL, UTType contentType, [NullAllowed] Action<NSError> completionHandler);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void SetDefaultApplication (NSUrl applicationURL, UTType contentType, [NullAllowed] Action<NSError> completionHandler);
void SetDefaultApplicationToOpenContentType (NSUrl applicationURL, UTType contentType, [NullAllowed] Action<NSError> completionHandler);

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build] Tests passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

🎉 All 102 tests passed 🎉

Pipeline on Agent XAMBOT-1100.BigSur'
Merge 517fbd9 into a300dfc

@rachelkang
Copy link
Contributor Author

@rolfbjarne thank you! updated based on your feedback

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

1 tests failed, 101 tests passed.

Failed tests

  • link sdk/Mac Catalyst [dotnet]/Debug [dotnet]: TimedOut (Execution timed out after 1200 seconds.
    No test log file was produced)

Pipeline on Agent XAMBOT-1094.BigSur'
Merge 1458b03 into 67e1ca5

[Mac (12,0)]
[Static]
[Export ("allowedClassesForRestorableStateKeyPath:")]
Class[] GetAllowedClassesForRestorableStateKeyPath (string keyPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this name could exclude KeyPath since it is the parameter name.
Swift name in the docs is allowedClasses(forRestorableStateKeyPath:)
but would GetAllowedClassesForRestorableState (string keyPath) work here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! I'll just simplify to GetAllowedClasses then - I think RestorableStateKeyPath is one thing, so it could be confusing to imply its for the restorablestate and not specify the keypath

src/appkit.cs Outdated
[BaseType (typeof (NSCell))]
interface NSTextAttachmentCell : NSTextAttachmentCellProtocol {
[Export ("initImageCell:")]
IntPtr Constructor (NSImage image);
Copy link
Contributor

@tj-devel709 tj-devel709 Oct 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IntPtr Constructor (NSImage image);
IntPtr Constructor (NSImage image);

nit

@tj-devel709
Copy link
Contributor

Added a small formatting change and a suggestion about the KeyPath! Everything else looks great to me! :)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent
Merge 21db142 into 2bc66b0

@rachelkang
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

1 tests failed, 101 tests passed.

Failed tests

  • dont link/Mac Catalyst [dotnet]/Release [dotnet]: Failed (Test run crashed (exit code: 134).
    Tests run: 11 Passed: 6 Inconclusive: 0 Failed: 0 Ignored: 5)

Pipeline on Agent XAMBOT-1097.BigSur'
Merge 21db142 into 2bc66b0

@rachelkang
Copy link
Contributor Author

failing test not related #10833

@rachelkang rachelkang merged commit 9ebf14e into xamarin:main Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
note-highlight Worth calling out specifically in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants