Skip to content
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
46 changes: 23 additions & 23 deletions src/AppKit/NSTextContainer.cs
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
#if !__MACCATALYST__ // there's a version in UIKit, use that one instead
using System;

using CoreGraphics;
using Foundation;
using ObjCRuntime;

#nullable enable

namespace AppKit {
public partial class NSTextContainer {
#if !NET
[Obsoleted (PlatformName.MacOSX, 10, 11, message: "Use NSTextContainer.FromSize instead.")]
public NSTextContainer (CGSize size)
{
Handle = InitWithContainerSize (size);
}
#endif // !NET

[SupportedOSPlatform ("macos")]
[ObsoletedOSPlatform ("macos", "Use 'new NSTextContainer (CGSize)' instead.")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
internal NSTextContainer (CGSize size, bool isContainer)
: base (NSObjectFlag.Empty)
{
if (isContainer)
Handle = InitWithContainerSize (size);
else
Handle = InitWithSize (size);
if (isContainer) {
InitializeHandle (_InitWithContainerSize (size), "initWithContainerSize:");
} else {
InitializeHandle (_InitWithSize (size), "initWithSize:");
}
}

/// <param name="size">To be added.</param>
/// <summary>To be added.</summary>
/// <returns>To be added.</returns>
/// <remarks>To be added.</remarks>
/// <summary>Create a new <see cref="NSTextContainer" /> with the specified size.</summary>
/// <param name="size">The size of the new <see cref="NSTextContainer" />.</param>
/// <returns>A new <see cref="NSTextContainer" /> with the specified size.</returns>
[SupportedOSPlatform ("macos")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
public static NSTextContainer FromSize (CGSize size)
{
return new NSTextContainer (size, false);
return new NSTextContainer (size);
}

/// <param name="containerSize">To be added.</param>
/// <summary>To be added.</summary>
/// <returns>To be added.</returns>
/// <remarks>To be added.</remarks>
[UnsupportedOSPlatform ("ios")]
/// <summary>Create a new <see cref="NSTextContainer" /> with the specified size.</summary>
/// <param name="containerSize">The size of the new <see cref="NSTextContainer" />.</param>
/// <returns>A new <see cref="NSTextContainer" /> with the specified size.</returns>
/// <remarks>This method is deprecated, use <see cref="FromSize" /> instead.</remarks>
[SupportedOSPlatform ("macos")]
[ObsoletedOSPlatform ("macos", "Use 'new NSTextContainer (CGSize)' instead.")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
[ObsoletedOSPlatform ("macos", "Use NSTextContainer.FromSize instead.")]
public static NSTextContainer FromContainerSize (CGSize containerSize)
{
return new NSTextContainer (containerSize, true);
Expand Down
6 changes: 3 additions & 3 deletions src/xkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3795,25 +3795,25 @@ NSTextLayoutOrientation LayoutOrientation {
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
partial interface NSTextContainer : NSTextLayoutOrientationProvider, NSSecureCoding {
[NoMac]
[MacCatalyst (13, 1)]
[DesignatedInitializer]
[Export ("initWithSize:")]
NativeHandle Constructor (CGSize size);

[Deprecated (PlatformName.MacOSX, 10, 11, "Use 'new NSTextContainer (CGSize)' instead.")]
[NoiOS]
[NoMacCatalyst]
[NoTV]
[Export ("initWithContainerSize:"), Internal]
[Sealed]
IntPtr InitWithContainerSize (CGSize size);
IntPtr _InitWithContainerSize (CGSize size);

[NoiOS]
[NoMacCatalyst]
[NoTV]
[Export ("initWithSize:"), Internal]
[Sealed]
IntPtr InitWithSize (CGSize size);
IntPtr _InitWithSize (CGSize size);

[NullAllowed] // by default this property is null
[Export ("layoutManager", ArgumentSemantic.Assign)]
Expand Down
1 change: 0 additions & 1 deletion tests/cecil-tests/ConstructorTest.KnownFailures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public partial class ConstructorTest {
static HashSet<string> knownFailuresNonDefaultCtorDoesNotCallBaseDefaultCtor = new HashSet<string> {
"AppKit.ActionDispatcher::.ctor(System.EventHandler)",
"AppKit.NSAlertDidEndDispatcher::.ctor(System.Action`1<System.IntPtr>)",
"AppKit.NSTextContainer::.ctor(CoreGraphics.CGSize,System.Boolean)",
"AVFoundation.InternalAVAudioSessionDelegate::.ctor(AVFoundation.AVAudioSession)",
"CarPlay.CPListSection::.ctor(CarPlay.CPListItem[],System.String,System.String)",
"CarPlay.CPListSection::.ctor(CarPlay.CPListItem[])",
Expand Down
1 change: 0 additions & 1 deletion tests/cecil-tests/SetHandleTest.KnownFailures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public partial class SetHandleTest {
"AppKit.NSBitmapImageRep::.ctor(Foundation.NSObjectFlag,Foundation.NSObjectFlag)",
"AppKit.NSOpenGLPixelFormat::.ctor(AppKit.NSOpenGLPixelFormatAttribute[])",
"AppKit.NSOpenGLPixelFormat::.ctor(System.Object[])",
"AppKit.NSTextContainer::.ctor(CoreGraphics.CGSize,System.Boolean)",
"CoreFoundation.CFMutableString::.ctor(CoreFoundation.CFString,System.IntPtr)",
"CoreFoundation.CFMutableString::.ctor(System.String,System.IntPtr)",
"CoreFoundation.CFSocket::Initialize(CoreFoundation.CFRunLoop,CoreFoundation.CFSocket/CreateSocket)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
!incorrect-protocol-member! +NSPasteboardReading::readableTypesForPasteboard: is REQUIRED and should be abstract
!incorrect-protocol-member! +NSWindowRestoration::restoreWindowWithIdentifier:state:completionHandler: is REQUIRED and should be abstract

# This init method is bound manually, because the managed signature is identical to another init method.
!missing-selector! NSTextContainer::initWithContainerSize: not bound

## unsorted

!missing-enum! NSWritingDirectionFormatType not bound
Expand Down Expand Up @@ -133,8 +136,6 @@
!missing-selector! NSMutableAttributedString::fixAttributesInRange: not bound
!missing-selector! NSString::boundingRectWithSize:options:attributes: not bound
!missing-selector! NSString::drawWithRect:options:attributes: not bound
!missing-selector! NSTextContainer::initWithContainerSize: not bound
!missing-selector! NSTextContainer::initWithSize: not bound
!missing-selector! NSTextContainer::lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect: not bound
!missing-selector! NSTextStorage::attributeRuns not bound
!missing-selector! NSTextStorage::characters not bound
Expand Down