Skip to content

Commit

Permalink
[AppKit] Add Catalyst attributes (#12863)
Browse files Browse the repository at this point in the history
  • Loading branch information
chamons authored Sep 30, 2021
1 parent e23a7de commit 3ffabb1
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 66 deletions.
10 changes: 5 additions & 5 deletions src/AppKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1990,13 +1990,13 @@ public enum NSFontCollectionOptions : long {
ApplicationOnlyMask = 1
}

[NoMacCatalyst]
[MacCatalyst (13,1)]
[Native]
public enum NSCollectionViewDropOperation : long {
On = 0, Before = 1
}

[NoMacCatalyst]
[MacCatalyst (13,1)]
[Mac (10,11)]
[Native]
public enum NSCollectionViewItemHighlightState : long
Expand All @@ -2007,7 +2007,7 @@ public enum NSCollectionViewItemHighlightState : long
AsDropTarget = 3
}

[NoMacCatalyst]
[MacCatalyst (13,0)]
[Mac (10,11)] // Not marked 10.11 in the headers, but doesn't exist in the 10.10 headers
[Native]
[Flags]
Expand All @@ -2026,7 +2026,7 @@ public enum NSCollectionViewScrollPosition : ulong
NearestVerticalEdge = 1 << 8
}

[NoMacCatalyst]
[MacCatalyst (13,1)]
[Mac (10,11)]
[Native]
public enum NSCollectionElementCategory : long
Expand All @@ -2049,7 +2049,7 @@ public enum NSCollectionUpdateAction : long
None
}

[NoMacCatalyst]
[MacCatalyst (13,1)]
[Mac (10,11)]
[Native]
public enum NSCollectionViewScrollDirection : long
Expand Down
2 changes: 2 additions & 0 deletions src/AppKit/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@

namespace AppKit {

#if MONOMAC
// Class to access C functions
public partial class AppKitFramework {

[DllImport (Constants.AppKitLibrary)]
public static extern void NSBeep();
}
#endif
}
45 changes: 42 additions & 3 deletions src/appkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9527,6 +9527,7 @@ public enum NSImageName
[Field ("NSImageNameBluetoothTemplate")]
BluetoothTemplate,

[NoMacCatalyst]
[Field ("NSImageNameIChatTheaterTemplate")]
IChatTheaterTemplate,

Expand All @@ -9536,12 +9537,14 @@ public enum NSImageName
[Field ("NSImageNameActionTemplate")]
ActionTemplate,

[NoMacCatalyst]
[Field ("NSImageNameSmartBadgeTemplate")]
SmartBadgeTemplate,

[Field ("NSImageNamePathTemplate")]
PathTemplate,

[NoMacCatalyst]
[Field ("NSImageNameInvalidDataFreestandingTemplate")]
InvalidDataFreestandingTemplate,

Expand All @@ -9557,9 +9560,11 @@ public enum NSImageName
[Field ("NSImageNameGoLeftTemplate")]
GoLeftTemplate,

[NoMacCatalyst]
[Field ("NSImageNameRightFacingTriangleTemplate")]
RightFacingTriangleTemplate,

[NoMacCatalyst]
[Field ("NSImageNameLeftFacingTriangleTemplate")]
LeftFacingTriangleTemplate,

Expand All @@ -9569,36 +9574,45 @@ public enum NSImageName
[Field ("NSImageNameRemoveTemplate")]
RemoveTemplate,

[NoMacCatalyst]
[Field ("NSImageNameRevealFreestandingTemplate")]
RevealFreestandingTemplate,

[NoMacCatalyst]
[Field ("NSImageNameFollowLinkFreestandingTemplate")]
FollowLinkFreestandingTemplate,

[NoMacCatalyst]
[Field ("NSImageNameEnterFullScreenTemplate")]
EnterFullScreenTemplate,

[NoMacCatalyst]
[Field ("NSImageNameExitFullScreenTemplate")]
ExitFullScreenTemplate,

[Field ("NSImageNameStopProgressTemplate")]
StopProgressTemplate,

[NoMacCatalyst]
[Field ("NSImageNameStopProgressFreestandingTemplate")]
StopProgressFreestandingTemplate,

[Field ("NSImageNameRefreshTemplate")]
RefreshTemplate,

[NoMacCatalyst]
[Field ("NSImageNameRefreshFreestandingTemplate")]
RefreshFreestandingTemplate,

[NoMacCatalyst]
[Field ("NSImageNameFolder")]
Folder,

[NoMacCatalyst]
[Field ("NSImageNameTrashEmpty")]
TrashEmpty,

[NoMacCatalyst]
[Field ("NSImageNameTrashFull")]
TrashFull,

Expand All @@ -9608,33 +9622,43 @@ public enum NSImageName
[Field ("NSImageNameBookmarksTemplate")]
BookmarksTemplate,

[NoMacCatalyst]
[Field ("NSImageNameCaution")]
Caution,

[NoMacCatalyst]
[Field ("NSImageNameStatusAvailable")]
StatusAvailable,

[NoMacCatalyst]
[Field ("NSImageNameStatusPartiallyAvailable")]
StatusPartiallyAvailable,

[NoMacCatalyst]
[Field ("NSImageNameStatusUnavailable")]
StatusUnavailable,

[NoMacCatalyst]
[Field ("NSImageNameStatusNone")]
StatusNone,

[NoMacCatalyst]
[Field ("NSImageNameApplicationIcon")]
ApplicationIcon,

[NoMacCatalyst]
[Field ("NSImageNameMenuOnStateTemplate")]
MenuOnStateTemplate,

[NoMacCatalyst]
[Field ("NSImageNameMenuMixedStateTemplate")]
MenuMixedStateTemplate,

[NoMacCatalyst]
[Field ("NSImageNameUserGuest")]
UserGuest,

[NoMacCatalyst]
[Field ("NSImageNameMobileMe")]
MobileMe,

Expand Down Expand Up @@ -9794,6 +9818,7 @@ public enum NSImageName
TouchBarPauseTemplate,

[Mac (10, 12, 2)]
[NoMacCatalyst]
[Field ("NSImageNameTouchBarPlayheadTemplate")]
TouchBarPlayheadTemplate,

Expand Down Expand Up @@ -19413,6 +19438,7 @@ partial interface NSToolbar {
[Export ("autosavesConfiguration")]
bool AutosavesConfiguration { get; set; }

[NoMacCatalyst]
[Field ("NSToolbarSeparatorItemIdentifier")]
[Deprecated (PlatformName.MacOSX, 11, 0, message: "Ignored by system.")]
NSString NSToolbarSeparatorItemIdentifier { get; }
Expand All @@ -19429,6 +19455,7 @@ partial interface NSToolbar {
[Field ("NSToolbarShowFontsItemIdentifier")]
NSString NSToolbarShowFontsItemIdentifier { get; }

[NoMacCatalyst]
[Field ("NSToolbarCustomizeToolbarItemIdentifier")]
[Deprecated (PlatformName.MacOSX, 11, 0, message: "Ignored by system.")]
NSString NSToolbarCustomizeToolbarItemIdentifier { get; }
Expand All @@ -19452,6 +19479,7 @@ partial interface NSToolbar {
[NullAllowed, Export ("centeredItemIdentifier")]
string CenteredItemIdentifier { get; set; }

[NoMacCatalyst]
[Mac (11, 0)]
[Field ("NSToolbarSidebarTrackingSeparatorItemIdentifier")]
NSString NSToolbarSidebarTrackingSeparatorItemIdentifier { get; }
Expand Down Expand Up @@ -19585,7 +19613,7 @@ interface NSToolbarItem : NSCopying, NSMenuItemValidation, NSValidatedUserInterf
bool Navigational { [Bind ("isNavigational")] get; set; }
}

[NoMacCatalyst]
[MacCatalyst (13,0)]
[BaseType (typeof (NSToolbarItem))]
interface NSToolbarItemGroup
{
Expand Down Expand Up @@ -19756,39 +19784,49 @@ interface NSTouchBarItem : NSCoding
}

[Mac (10,12,2)]
[MacCatalyst (13, 0)]
public enum NSTouchBarItemIdentifier
{
[MacCatalyst (13, 0)]
[Field ("NSTouchBarItemIdentifierFixedSpaceSmall")]
FixedSpaceSmall,

[MacCatalyst (13, 0)]
[Field ("NSTouchBarItemIdentifierFixedSpaceLarge")]
FixedSpaceLarge,

[MacCatalyst (13, 0)]
[Field ("NSTouchBarItemIdentifierFlexibleSpace")]
FlexibleSpace,

[MacCatalyst (13, 0)]
[Field ("NSTouchBarItemIdentifierOtherItemsProxy")]
OtherItemsProxy,

[NoMacCatalyst]
[Field ("NSTouchBarItemIdentifierCharacterPicker")]
CharacterPicker,

[NoMacCatalyst]
[Field ("NSTouchBarItemIdentifierTextColorPicker")]
TextColorPicker,

[NoMacCatalyst]
[Field ("NSTouchBarItemIdentifierTextStyle")]
TextStyle,

[NoMacCatalyst]
[Field ("NSTouchBarItemIdentifierTextAlignment")]
TextAlignment,

[NoMacCatalyst]
[Field ("NSTouchBarItemIdentifierTextList")]
TextList,

[NoMacCatalyst]
[Field ("NSTouchBarItemIdentifierTextFormat")]
TextFormat,

[NoMacCatalyst]
[Field ("NSTouchBarItemIdentifierCandidateList")]
CandidateList
}
Expand Down Expand Up @@ -26982,10 +27020,11 @@ interface NSSwitch : NSAccessibilitySwitch
}

[Mac (10,15)]
[NoMacCatalyst]
[MacCatalyst (13,0)]
[BaseType (typeof (NSToolbarItem))]
interface NSMenuToolbarItem
{
[NoMacCatalyst]
[Export ("menu", ArgumentSemantic.Strong)]
NSMenu Menu { get; set; }

Expand Down
58 changes: 0 additions & 58 deletions tests/xtro-sharpie/MacCatalyst-AppKit.todo

This file was deleted.

1 comment on commit 3ffabb1

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent
[AppKit] Add Catalyst attributes (#12863)

Please sign in to comment.