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] Remove a few obsolete members in .NET #14043

Merged
merged 1 commit into from
Feb 4, 2022
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
7 changes: 2 additions & 5 deletions src/appkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8211,7 +8211,7 @@ interface NSGestureRecognizerDelegate {
[Export ("gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:"), DelegateName ("NSGesturesProbe"), DefaultValue (false)]
bool ShouldBeRequiredToFail (NSGestureRecognizer gestureRecognizer, NSGestureRecognizer otherGestureRecognizer);

#if !XAMCORE_4_0
#if !NET
[Export ("xamarinselector:removed:"), DelegateName ("NSGestureEvent"), DefaultValue (true)]
[Obsolete ("It will never be called.")]
bool ShouldReceiveEvent (NSGestureRecognizer gestureRecognizer, NSEvent gestureEvent);
Expand Down Expand Up @@ -11466,15 +11466,12 @@ interface NSPasteboardReading {
[Export ("readingOptionsForType:pasteboard:")]
NSPasteboardReadingOptions GetReadingOptionsForType (string type, NSPasteboard pasteboard);

#if !XAMCORE_4_0
#if !NET
// This binding is just broken, it's an ObjC ctor (init*) bound as a normal method.
[Abstract]
[Export ("xamarinselector:removed:")]
[Obsolete ("It will never be called.")]
NSObject InitWithPasteboardPropertyList (NSObject propertyList, string type);
#else
#error FIXME: (compiler error to not forget)
#error FIXME: figure out how to bind constructors in protocols.
Comment on lines -11476 to -11477
Copy link
Member Author

Choose a reason for hiding this comment

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

This has been filed here instead: #14039.

#endif
}

Expand Down
2 changes: 1 addition & 1 deletion tests/introspection/Mac/MacApiSelectorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ protected override bool Skip (Type type, string selectorName)
// The header declares this on an NSObject category but
// it doesn't even respondsToSelector on NSView/NSCell...
return true;
#if !XAMCORE_4_0
#if !NET
case "xamarinselector:removed:":
return true;
#endif
Expand Down
6 changes: 2 additions & 4 deletions tests/monotouch-test/AppKit/NSPasteboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ class MyPasteboard2 : NSObject, INSPasteboardReading
class MyPasteboard2 : NSPasteboardReading
#endif
{
#if NET
NSObject INSPasteboardReading.InitWithPasteboardPropertyList (NSObject propertyList, string type)
#else
#if !NET
public override NSObject InitWithPasteboardPropertyList (NSObject propertyList, string type)
#endif
{
return new NSObject ();
}
#endif
}

#if NET
Expand Down
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@

## unsorted

!extra-protocol-member! unexpected selector NSGestureRecognizerDelegate::xamarinselector:removed: found
!extra-protocol-member! unexpected selector NSPasteboardReading::xamarinselector:removed: found
!missing-enum! NSWritingDirectionFormatType not bound
!missing-field! NSAuthorDocumentAttribute not bound
!missing-field! NSBackgroundColorDocumentAttribute not bound
Expand Down