Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CarPlay] Add support for Xcode13 beta1. #11928

Merged
merged 1 commit into from
Jun 15, 2021
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
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
Copy link
Contributor

Choose a reason for hiding this comment

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

So the "uint8_t" type should be "byte" in our bindings?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, u for unsigned and 8 for 8-bits -> System.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,
Copy link
Member

Choose a reason for hiding this comment

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

I wonder where this roundabout is?

Copy link
Member

Choose a reason for hiding this comment

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

Una rotonda with 19 exits!

Copy link
Member Author

Choose a reason for hiding this comment

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

Place Charles de Gaulle is a good contender

Screenshot 2021-06-14 at 17 47 29

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.