Skip to content

Commit

Permalink
[CarPlay] Add support for Xcode13 beta1.
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque committed Jun 14, 2021
1 parent 5211f5f commit 9312c3b
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 26 deletions.
157 changes: 157 additions & 0 deletions src/carplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,97 @@ public enum CPTextButtonStyle : long
Confirm,
}

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

[NoWatch, NoTV, NoMac, iOS (15,0)]
[Native]
public enum CPAssistantCellVisibility : long
{
Off = 0,
WhileLimitedUIActive,
Always,
}


[NoWatch, NoTV, NoMac, iOS (15,0)]
public enum CPJunctionType : byte
{
Intersection = 0,
Roundabout = 1,
}

[NoWatch, NoTV, NoMac, iOS (15,0)]
public enum CPTrafficSide : byte
{
Right = 0,
Left = 1,
}

[NoWatch, NoTV, NoMac, iOS (15,0)]
public enum CPManeuverType : byte
{
NoTurn = 0,
LeftTurn = 1,
RightTurn = 2,
StraightAhead = 3,
UTurn = 4,
FollowRoad = 5,
EnterRoundabout = 6,
ExitRoundabout = 7,
OffRamp = 8,
OnRamp = 9,
ArriveEndOfNavigation = 10,
StartRoute = 11,
ArriveAtDestination = 12,
KeepLeft = 13,
KeepRight = 14,
EnterFerry = 15,
ExitFerry = 16,
ChangeFerry = 17,
StartRouteWithUTurn = 18,
UTurnAtRoundabout = 19,
LeftTurnAtEnd = 20,
RightTurnAtEnd = 21,
HighwayOffRampLeft = 22,
HighwayOffRampRight = 23,
ArriveAtDestinationLeft = 24,
ArriveAtDestinationRight = 25,
UTurnWhenPossible = 26,
ArriveEndOfDirections = 27,
RoundaboutExit1 = 28,
RoundaboutExit2 = 29,
RoundaboutExit3 = 30,
RoundaboutExit4 = 31,
RoundaboutExit5 = 32,
RoundaboutExit6 = 33,
RoundaboutExit7 = 34,
RoundaboutExit8 = 35,
RoundaboutExit9 = 36,
RoundaboutExit10 = 37,
RoundaboutExit11 = 38,
RoundaboutExit12 = 39,
RoundaboutExit13 = 40,
RoundaboutExit14 = 41,
RoundaboutExit15 = 42,
RoundaboutExit16 = 43,
RoundaboutExit17 = 44,
RoundaboutExit18 = 45,
RoundaboutExit19 = 46,
SharpLeftTurn = 47,
SharpRightTurn = 48,
SlightLeftTurn = 49,
SlightRightTurn = 50,
ChangeHighway = 51,
ChangeHighwayLeft = 52,
ChangeHighwayRight = 53,
}

[NoWatch, NoTV, NoMac, iOS (12,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
Expand Down Expand Up @@ -273,6 +364,18 @@ interface CPGridTemplate : CPBarButtonProviding{

[Export ("title")]
string Title { get; }

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

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

[iOS (15,0)]
[Field ("CPGridTemplateMaximumItems")]
nuint MaximumItems { get; }
}

[NoWatch, NoTV, NoMac, iOS (12,0)]
Expand Down Expand Up @@ -503,6 +606,10 @@ interface CPListItem : CPSelectableListItem, NSSecureCoding {
[NullAllowed, iOS (14, 0)]
[Export ("handler", ArgumentSemantic.Copy)]
new CPSelectableListItemHandler Handler { get; set; }

[iOS (15, 0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}

[NoWatch, NoTV, NoMac, iOS (12,0)]
Expand All @@ -516,6 +623,10 @@ interface CPListSection : NSSecureCoding {
[Export ("initWithItems:")]
IntPtr Constructor (CPListItem [] items);

[iOS (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);

[NullAllowed, Export ("header")]
string Header { get; }

Expand All @@ -532,6 +643,25 @@ interface CPListSection : NSSecureCoding {
[iOS (14,0)]
[Export ("itemAtIndex:")]
ICPListTemplateItem GetItem (nuint index);

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

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

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

[iOS (15, 0)]
[Field ("CPMaximumListSectionImageSize")]
CGSize MaximumImageSize { get; }
}

[NoWatch, NoTV, NoMac, iOS (12,0)]
Expand All @@ -542,6 +672,10 @@ interface CPListTemplate : CPBarButtonProviding {
[Export ("initWithTitle:sections:")]
IntPtr Constructor ([NullAllowed] string title, CPListSection[] sections);

[iOS (15,0)]
[Export ("initWithTitle:sections:assistantCellVisibility:assistantCellPosition:")]
IntPtr Constructor ([NullAllowed] string title, CPListSection[] sections, CPAssistantCellVisibility visibility, CPAssistantCellPosition position);

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

[iOS (15, 0)]
[Export ("assistantCellVisibility", ArgumentSemantic.Assign)]
CPAssistantCellVisibility AssistantCellVisibility { get; set; }

[iOS (15, 0)]
[Export ("assistantCellPosition", ArgumentSemantic.Assign)]
CPAssistantCellPosition AssistantCellPosition { get; set; }
}

interface ICPListTemplateDelegate { }
Expand Down Expand Up @@ -1450,6 +1592,10 @@ interface CPListImageRowItem : CPSelectableListItem

[NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)]
new NSObject UserInfo { get; set; }

[iOS (15, 0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}

[NoWatch, NoTV, NoMac, iOS (14,0)]
Expand Down Expand Up @@ -1519,6 +1665,10 @@ interface CPMessageListItem : CPListTemplateItem

[NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)]
new NSObject UserInfo { get; set; }

[iOS (15, 0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}

[NoWatch, NoTV, NoMac, iOS (14,0)]
Expand Down Expand Up @@ -1806,6 +1956,13 @@ interface CPListTemplateItem
[Abstract]
[NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)]
NSObject UserInfo { get; set; }

#if XAMCORE_4_0
[Abstract]
#endif
[iOS (15, 0)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}

interface ICPSelectableListItem { }
Expand Down
2 changes: 2 additions & 0 deletions tests/xtro-sharpie/iOS-CarPlay.ignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
!incorrect-protocol-member! CPBarButtonProviding::backButton is REQUIRED and should be abstract
!incorrect-protocol-member! CPBarButtonProviding::setBackButton: is REQUIRED and should be abstract
!incorrect-protocol-member! CPSessionConfigurationDelegate::sessionConfiguration:limitedUserInterfacesChanged: is OPTIONAL and should NOT be abstract
!incorrect-protocol-member! CPListTemplateItem::isEnabled is REQUIRED and should be abstract
!incorrect-protocol-member! CPListTemplateItem::setEnabled: is REQUIRED and should be abstract

# introduced iOS 14, deprecated iOS 14
!missing-selector! CPListItem::showsExplicitLabel not bound
Expand Down
26 changes: 0 additions & 26 deletions tests/xtro-sharpie/iOS-CarPlay.todo

This file was deleted.

0 comments on commit 9312c3b

Please sign in to comment.