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] Add a few missing NullAllowed attributes. Fixes #18115. #18118

Merged
merged 1 commit into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/appkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18726,7 +18726,7 @@ partial interface NSTextField : NSAccessibilityNavigableStaticText, NSUserInterf
NativeHandle Constructor (CGRect frameRect);

[Export ("selectText:")]
void SelectText (NSObject sender);
void SelectText ([NullAllowed] NSObject sender);

[Export ("textShouldBeginEditing:")]
bool ShouldBeginEditing (NSText textObject);
Expand All @@ -18747,12 +18747,14 @@ partial interface NSTextField : NSAccessibilityNavigableStaticText, NSUserInterf
bool AcceptsFirstResponder ();

//Detected properties
[NullAllowed]
[Export ("backgroundColor", ArgumentSemantic.Copy)]
NSColor BackgroundColor { get; set; }

[Export ("drawsBackground")]
bool DrawsBackground { get; set; }

[NullAllowed]
[Export ("textColor", ArgumentSemantic.Copy)]
NSColor TextColor { get; set; }

Expand Down Expand Up @@ -18787,10 +18789,12 @@ partial interface NSTextField : NSAccessibilityNavigableStaticText, NSUserInterf
[Export ("preferredMaxLayoutWidth")]
nfloat PreferredMaxLayoutWidth { get; set; }

[NullAllowed]
[Mac (10, 10)]
[Export ("placeholderString", ArgumentSemantic.Copy)]
string PlaceholderString { get; set; }

[NullAllowed]
[Mac (10, 10)]
[Export ("placeholderAttributedString", ArgumentSemantic.Copy)]
NSAttributedString PlaceholderAttributedString { get; set; }
Expand Down Expand Up @@ -18982,24 +18986,29 @@ interface NSTextFieldCell {
NSText SetUpFieldEditorAttributes (NSText textObj);

//Detected properties
[NullAllowed]
[Export ("backgroundColor", ArgumentSemantic.Copy)]
NSColor BackgroundColor { get; set; }

[Export ("drawsBackground")]
bool DrawsBackground { get; set; }

[NullAllowed]
[Export ("textColor", ArgumentSemantic.Copy)]
NSColor TextColor { get; set; }

[Export ("bezelStyle")]
NSTextFieldBezelStyle BezelStyle { get; set; }

[NullAllowed]
[Export ("placeholderString")]
string PlaceholderString { get; set; }

[NullAllowed]
[Export ("placeholderAttributedString", ArgumentSemantic.Copy)]
NSAttributedString PlaceholderAttributedString { get; set; }

[NullAllowed]
[Export ("allowedInputSourceLocales")]
string [] AllowedInputSourceLocales { get; set; }

Expand Down
10 changes: 0 additions & 10 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -980,16 +980,6 @@
!missing-null-allowed! 'System.Void AppKit.NSTextBlock::SetBorderColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextBlock::SetBorderColor(AppKit.NSColor,AppKit.NSRectEdge)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextContainer::set_TextView(AppKit.NSTextView)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextField::SelectText(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextField::set_BackgroundColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextField::set_PlaceholderAttributedString(Foundation.NSAttributedString)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextField::set_PlaceholderString(System.String)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextField::set_TextColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFieldCell::set_AllowedInputSourceLocales(System.String[])' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFieldCell::set_BackgroundColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFieldCell::set_PlaceholderAttributedString(Foundation.NSAttributedString)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFieldCell::set_PlaceholderString(System.String)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFieldCell::set_TextColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFinder::set_Client(AppKit.INSTextFinderClient)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFinder::set_FindBarContainer(AppKit.INSTextFinderBarContainer)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFinderBarContainer::set_FindBarView(AppKit.NSView)' is missing an [NullAllowed] on parameter #0
Expand Down
10 changes: 0 additions & 10 deletions tests/xtro-sharpie/macOS-AppKit.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -1088,16 +1088,6 @@
!missing-null-allowed! 'System.Void AppKit.NSTextBlock::SetBorderColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextBlock::SetBorderColor(AppKit.NSColor,AppKit.NSRectEdge)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextContainer::set_TextView(AppKit.NSTextView)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextField::SelectText(Foundation.NSObject)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextField::set_BackgroundColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextField::set_PlaceholderAttributedString(Foundation.NSAttributedString)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextField::set_PlaceholderString(System.String)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextField::set_TextColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFieldCell::set_AllowedInputSourceLocales(System.String[])' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFieldCell::set_BackgroundColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFieldCell::set_PlaceholderAttributedString(Foundation.NSAttributedString)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFieldCell::set_PlaceholderString(System.String)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFieldCell::set_TextColor(AppKit.NSColor)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFinder::set_Client(AppKit.INSTextFinderClient)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFinder::set_FindBarContainer(AppKit.INSTextFinderBarContainer)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void AppKit.NSTextFinderBarContainer::set_FindBarView(AppKit.NSView)' is missing an [NullAllowed] on parameter #0
Expand Down