Skip to content

Commit

Permalink
[AppKit] Remove a few obsolete members in .NET
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed Feb 3, 2022
1 parent 6c4cd16 commit 3262b5c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
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.
#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

0 comments on commit 3262b5c

Please sign in to comment.