Repository navigation
[Appkit] Bindings - part 2 - #7215
Conversation
|
Build failure Test results1 tests failed, 90 tests passed.Failed tests
|
|
Build success |
30f76cb to
985e707
Compare
|
|
||
| [Static] | ||
| [Export ("layoutAnchorWithEdges:fractionalOffset:")] | ||
| NSCollectionLayoutAnchor LayoutAnchorWithEdgesFractionalOffset (NSDirectionalRectEdge edges, CGPoint fractionalOffset); |
There was a problem hiding this comment.
I think GetLayoutAnchor sounds better.
| { | ||
| [Static] | ||
| [Export ("fractionalWidthDimension:")] | ||
| NSCollectionLayoutDimension CreateFractionalWidthDimension (nfloat fractionalWidth); |
There was a problem hiding this comment.
I think this is fine as it is - it's not With, it's Width (same goes for the others below).
|
|
||
| [Export ("imageAtIndex:")] | ||
| [return: NullAllowed] | ||
| NSImage ImageAtIndex (nint index); |
There was a problem hiding this comment.
This has a verb, sounds more like C#, and is also symmetrical to SetImage:
| NSImage ImageAtIndex (nint index); | |
| NSImage GetImage (nint index); |
|
|
||
| [Export ("labelAtIndex:")] | ||
| [return: NullAllowed] | ||
| string LabelAtIndex (nint index); |
There was a problem hiding this comment.
Same:
| string LabelAtIndex (nint index); | |
| string GetLabel (nint index); |
| void SetEnabled (bool enabled, nint index); | ||
|
|
||
| [Export ("isEnabledAtIndex:")] | ||
| bool IsEnabledAtIndex (nint index); |
There was a problem hiding this comment.
Same:
| bool IsEnabledAtIndex (nint index); | |
| bool GetEnabled (nint index); |
| bool IsEnabledAtIndex (nint index); | ||
|
|
||
| // @property (readwrite, copy) NSString * _Null_unspecified customizationLabel; | ||
| [Export ("customizationLabel")] |
There was a problem hiding this comment.
ArgumentSemantic.Copy is important, and shouldn't be skipped (the copy part from the Objective-C property declaration above)
| [Export ("customizationLabel")] | |
| [Export ("customizationLabel", ArgumentSemantic.Copy)] |
| NSCollectionLayoutSize Create (NSCollectionLayoutDimension width, NSCollectionLayoutDimension height); | ||
|
|
||
| [Export ("widthDimension")] | ||
| NSCollectionLayoutDimension Width { get; } |
There was a problem hiding this comment.
I think WidthDimension sounds just as good as Width, and it has the advantage of being identical to Swift/Objective-C, so I would go with WidthDimension here.
| NSCollectionLayoutDimension Width { get; } | |
| NSCollectionLayoutDimension WidthDimension { get; } |
| NSCollectionLayoutDimension Width { get; } | ||
|
|
||
| [Export ("heightDimension")] | ||
| NSCollectionLayoutDimension Height { get; } |
There was a problem hiding this comment.
Same:
| NSCollectionLayoutDimension Height { get; } | |
| NSCollectionLayoutDimension HeightDimension { get; } |
| } | ||
|
|
||
| public partial class NSCollectionLayoutAnchor { | ||
| public static NSCollectionLayoutAnchor GetLayoutAnchor (NSDirectionalRectEdge edges, NSCollectionLayoutAnchorOffsetType offsetType, CGPoint offset) => |
There was a problem hiding this comment.
In general (I did not read the associated doc) when type 'X' has static members that returns 'X' then it's more a Create than a Get, e.g.
public class Url {
// good
static Url Create (string url) { ... }
// bad
static Url Get (string url) { ... }
// good
static string GetDomain (Url url) { ... }
// bad
static string CreateDomain (Url url) { ... }
}| { | ||
| [Export ("initWithIdentifier:")] | ||
| [DesignatedInitializer] | ||
| IntPtr Constructor (string identifier); |
There was a problem hiding this comment.
should not this be NSTouchBarItemIdentifier (not string) ?
| UIKit/UIPrintInteractionController.cs \ | ||
| UIKit/UIStringAttributes.cs \ | ||
| UIKit/UITypes.cs \ | ||
| XKit/Types.cs \ |
There was a problem hiding this comment.
misaligned - tabs vs spaces?
|
So removing the above .ctor ( |
|
Build failure Test results# Test run in progress: NotStarted: 70, Failed: 21, Ignored: 960Failed tests
|
| // Explicitly disabled ctors - (instancetype)init NS_UNAVAILABLE; | ||
| return true; | ||
| case "NSPickerTouchBarItem": | ||
| if (ctor.ToString () == $"Void .ctor(System.String)") |
There was a problem hiding this comment.
please add a comment why this ctor is being disabled (like the above cases already have)
there's nothing in /Applications/Xcode112-beta2.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSPickerTouchBarItem.h to suggest it should not be available.
|
Build success |
|
Also, the Xtro here generates double names. issue - #2029 |
|
Build success |
Rebased on PR#7187.