Skip to content

Commit

Permalink
[Carplay] Add support for Xcode 13 beta 5 and fix catalyst attrs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque committed Aug 16, 2021
1 parent b4e828c commit 722490a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 25 deletions.
66 changes: 51 additions & 15 deletions src/carplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ public enum CPTextButtonStyle : long
Confirm,
}

[NoWatch, NoTV, NoMac, iOS (15,0)]
[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum CPAssistantCellPosition : long
{
Top = 0,
Bottom,
}

[NoWatch, NoTV, NoMac, iOS (15,0)]
[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[Native]
public enum CPAssistantCellVisibility : long
{
Expand All @@ -181,6 +181,15 @@ public enum CPAssistantCellVisibility : long
Always,
}

[iOS (15,0), MacCatalyst (15,0), NoMac, NoTV, NoWatch]
[Native]
public enum CPAssistantCellActionType : long
{
PlayMedia = 0,
StartCall,
}


[NoWatch, NoTV, NoMac, iOS (12,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
Expand Down Expand Up @@ -291,15 +300,15 @@ interface CPGridTemplate : CPBarButtonProviding{
[Export ("title")]
string Title { get; }

[iOS (15,0)]
[iOS (15,0), MacCatalyst (15,0)]
[Export ("updateGridButtons:")]
void UpdateGridButtons (CPGridButton[] gridButtons);

[iOS (15,0)]
[iOS (15,0), MacCatalyst (15,0)]
[Export ("updateTitle:")]
void UpdateTitle (string title);

[iOS (15,0)]
[iOS (15,0), MacCatalyst (15,0)]
[Field ("CPGridTemplateMaximumItems")]
nuint MaximumItems { get; }
}
Expand Down Expand Up @@ -533,7 +542,7 @@ interface CPListItem : CPSelectableListItem, NSSecureCoding {
[Export ("handler", ArgumentSemantic.Copy)]
new CPSelectableListItemHandler Handler { get; set; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}
Expand All @@ -549,7 +558,7 @@ interface CPListSection : NSSecureCoding {
[Export ("initWithItems:")]
IntPtr Constructor (CPListItem [] items);

[iOS (15,0)]
[iOS (15,0), MacCatalyst (15,0)]
[Export ("initWithItems:header:headerSubtitle:headerImage:headerButton:sectionIndexTitle:")]
IntPtr Constructor (ICPListTemplateItem[] items, string header, [NullAllowed] string headerSubtitle, [NullAllowed] UIImage headerImage, [NullAllowed] CPButton headerButton, [NullAllowed] string sectionIndexTitle);

Expand All @@ -570,22 +579,22 @@ interface CPListSection : NSSecureCoding {
[Export ("itemAtIndex:")]
ICPListTemplateItem GetItem (nuint index);

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[NullAllowed]
[Export ("headerSubtitle")]
string HeaderSubtitle { get; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[NullAllowed]
[Export ("headerImage", ArgumentSemantic.Copy)]
UIImage HeaderImage { get; }
UIImage HeaderImage { get; set; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[NullAllowed]
[Export ("headerButton", ArgumentSemantic.Copy)]
CPButton HeaderButton { get; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[Field ("CPMaximumListSectionImageSize")]
CGSize MaximumImageSize { get; }
}
Expand All @@ -598,6 +607,10 @@ interface CPListTemplate : CPBarButtonProviding {
[Export ("initWithTitle:sections:")]
IntPtr Constructor ([NullAllowed] string title, CPListSection[] sections);

[iOS (15,0), MacCatalyst (15,0)]
[Export ("initWithTitle:sections:assistantCellConfiguration:")]
IntPtr Constructor ([NullAllowed] string title, CPListSection[] sections, [NullAllowed] CPAssistantCellConfiguration assistantCellConfiguration);

[Deprecated (PlatformName.iOS, 14, 0, message: "Use 'CPListItem.Handler' instead.")]
[Wrap ("WeakDelegate")]
[NullAllowed]
Expand Down Expand Up @@ -646,6 +659,11 @@ interface CPListTemplate : CPBarButtonProviding {
[iOS (14, 0)]
[Export ("emptyViewSubtitleVariants", ArgumentSemantic.Copy)]
string[] EmptyViewSubtitleVariants { get; set; }

[NullAllowed]
[iOS (15, 0), MacCatalyst (15,0)]
[Export ("assistantCellConfiguration", ArgumentSemantic.Strong)]
CPAssistantCellConfiguration AssistantCellConfiguration { get; set; }
}

interface ICPListTemplateDelegate { }
Expand Down Expand Up @@ -1507,7 +1525,7 @@ interface CPListImageRowItem : CPSelectableListItem
[NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)]
new NSObject UserInfo { get; set; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}
Expand Down Expand Up @@ -1580,7 +1598,7 @@ interface CPMessageListItem : CPListTemplateItem
[NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)]
new NSObject UserInfo { get; set; }

[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}
Expand Down Expand Up @@ -1874,7 +1892,7 @@ interface CPListTemplateItem
#if XAMCORE_4_0
[Abstract]
#endif
[iOS (15, 0)]
[iOS (15, 0), MacCatalyst (15,0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}
Expand Down Expand Up @@ -1907,4 +1925,22 @@ interface CPInformationRatingItem
[NullAllowed, Export ("maximumRating")]
NSNumber MaximumRating { get; }
}

[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof(NSObject))]
interface CPAssistantCellConfiguration : NSSecureCoding
{
[Export ("initWithPosition:visibility:assistantAction:")]
IntPtr Constructor (CPAssistantCellPosition position, CPAssistantCellVisibility visibility, CPAssistantCellActionType assistantAction);

[Export ("position")]
CPAssistantCellPosition Position { get; }

[Export ("visibility")]
CPAssistantCellVisibility Visibility { get; }

[Export ("assistantAction")]
CPAssistantCellActionType AssistantAction { get; }
}

}
10 changes: 0 additions & 10 deletions tests/xtro-sharpie/iOS-CarPlay.todo

This file was deleted.

0 comments on commit 722490a

Please sign in to comment.