Skip to content

Commit

Permalink
[CarPlay] Implement Xcode 16.0 beta 1-6 changes. (#21039)
Browse files Browse the repository at this point in the history
Note: there were no changes in beta 2, beta 3, beta 4, beta 5 or beta 6.
  • Loading branch information
rolfbjarne authored Sep 4, 2024
1 parent 515d0ce commit 16207e9
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 109 deletions.
24 changes: 22 additions & 2 deletions src/CarPlay/CPCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#nullable enable

using System;
using CoreGraphics;
using Foundation;
using ObjCRuntime;
using System.ComponentModel;
Expand All @@ -18,8 +19,8 @@
using NativeHandle = System.IntPtr;
#endif

#if !NET
namespace CarPlay {
#if !NET
[Register (SkipRegistration = true)]
[Unavailable (PlatformName.iOS, PlatformArchitecture.All)]
[Obsolete ("This API has been removed from the native SDK.")]
Expand All @@ -38,5 +39,24 @@ public class CPEntity : NSObject, INSSecureCoding {

public override NativeHandle ClassHandle => throw new NotSupportedException ();
}
}
#endif
#if !XAMCORE_5_0 && __IOS__
public partial class CPListItem {
#if NET
[ObsoletedOSPlatform ("ios14.0", "Do not use; this API was removed.")]
[UnsupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("macos")]
[UnsupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("ios12.0")]
#else
[Deprecated (PlatformName.iOS, 14, 0, message: "Do not use; this API was removed.")]
#endif
[EditorBrowsable (EditorBrowsableState.Never)]
public static CGSize MaximumListItemImageSize {
get {
return default (CGSize);
}
}
}
#endif // !XAMCORE_5_0 && __IOS__
}
70 changes: 60 additions & 10 deletions src/carplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,15 @@ interface CPAlertAction : NSSecureCoding {
interface CPBarButton : NSSecureCoding {

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("initWithType:handler:")]
NativeHandle Constructor (CPBarButtonType type, [NullAllowed] Action<CPBarButton> handler);

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

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("buttonType", ArgumentSemantic.Assign)]
CPBarButtonType ButtonType { get; }

Expand Down Expand Up @@ -445,30 +447,37 @@ interface CPInterfaceController {
bool PrefersDarkUserInterfaceStyle { get; set; }

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("setRootTemplate:animated:")]
void SetRootTemplate (CPTemplate rootTemplate, bool animated);

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("pushTemplate:animated:")]
void PushTemplate (CPTemplate templateToPush, bool animated);

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("popTemplateAnimated:")]
void PopTemplate (bool animated);

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("popToRootTemplateAnimated:")]
void PopToRootTemplate (bool animated);

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("popToTemplate:animated:")]
void PopToTemplate (CPTemplate targetTemplate, bool animated);

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("presentTemplate:animated:")]
void PresentTemplate (CPTemplate templateToPresent, bool animated);

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("dismissTemplateAnimated:")]
void DismissTemplate (bool animated);

Expand Down Expand Up @@ -557,6 +566,7 @@ interface ICPApplicationDelegate { }
/// <summary>The application delegate for CarPlay applications.</summary>
[Introduced (PlatformName.iOS, 12, 0)]
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'CPTemplateApplicationSceneDelegate' instead.")]
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'CPTemplateApplicationSceneDelegate' instead.")]
[NoWatch, NoTV, NoMac]
#if NET
[Protocol, Model]
Expand Down Expand Up @@ -586,12 +596,8 @@ interface CPApplicationDelegate : UIApplicationDelegate {
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CPListItem : CPSelectableListItem, NSSecureCoding {

[Deprecated (PlatformName.iOS, 14, 0, message: "Do not use; this API was removed.")]
[Field ("CPMaximumListItemImageSize")]
CGSize MaximumListItemImageSize { get; }

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("initWithText:detailText:image:showsDisclosureIndicator:")]
NativeHandle Constructor ([NullAllowed] string text, [NullAllowed] string detailText, [NullAllowed] UIImage image, bool showsDisclosureIndicator);

Expand All @@ -612,6 +618,7 @@ interface CPListItem : CPSelectableListItem, NSSecureCoding {
UIImage Image { get; }

[Deprecated (PlatformName.iOS, 14, 0)]
[Deprecated (PlatformName.MacCatalyst, 14, 0)]
[Export ("showsDisclosureIndicator")]
bool ShowsDisclosureIndicator { get; }

Expand Down Expand Up @@ -751,11 +758,13 @@ interface CPListTemplate : CPBarButtonProviding {
NativeHandle Constructor ([NullAllowed] string title, CPListSection [] sections, [NullAllowed] CPAssistantCellConfiguration assistantCellConfiguration);

[Deprecated (PlatformName.iOS, 14, 0, message: "Use 'CPListItem.Handler' instead.")]
[Deprecated (PlatformName.MacCatalyst, 14, 0, message: "Use 'CPListItem.Handler' instead.")]
[Wrap ("WeakDelegate")]
[NullAllowed]
ICPListTemplateDelegate Delegate { get; set; }

[Deprecated (PlatformName.iOS, 14, 0, message: "Use 'CPListItem.Handler' instead.")]
[Deprecated (PlatformName.MacCatalyst, 14, 0, message: "Use 'CPListItem.Handler' instead.")]
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
NSObject WeakDelegate { get; set; }

Expand Down Expand Up @@ -810,6 +819,7 @@ interface ICPListTemplateDelegate { }

/// <summary>Abstract implementation of <see cref="T:CarPlay.ICPListTemplateDelegate" />, the delegate object for <see cref="T:CarPlay.CPListTemplate" /> objects.</summary>
[Deprecated (PlatformName.iOS, 14, 0, message: "Use 'CPListItem.Handler' instead.")]
[Deprecated (PlatformName.MacCatalyst, 14, 0, message: "Use 'CPListItem.Handler' instead.")]
[NoWatch, NoTV, NoMac, iOS (12, 0)]
#if NET
[Protocol, Model]
Expand All @@ -830,6 +840,7 @@ interface CPListTemplateDelegate {
interface CPManeuver : NSCopying, NSSecureCoding {

[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'CPManeuver.SymbolImage' instead.")]
[Deprecated (PlatformName.MacCatalyst, 13, 0, message: "Use 'CPManeuver.SymbolImage' instead.")]
[NullAllowed, Export ("symbolSet", ArgumentSemantic.Strong)]
CPImageSet SymbolSet { get; set; }

Expand Down Expand Up @@ -1105,6 +1116,7 @@ interface CPNavigationAlert : NSSecureCoding {


[Deprecated (PlatformName.iOS, 13, 0, message: "Use constructor that takes in 'UIImage' instead of 'CPImageSet'.")]
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use constructor that takes in 'UIImage' instead of 'CPImageSet'.")]
[Export ("initWithTitleVariants:subtitleVariants:imageSet:primaryAction:secondaryAction:duration:")]
NativeHandle Constructor (string [] titleVariants, [NullAllowed] string [] subtitleVariants, [NullAllowed] CPImageSet imageSet, CPAlertAction primaryAction, [NullAllowed] CPAlertAction secondaryAction, double duration);

Expand Down Expand Up @@ -2343,18 +2355,56 @@ interface CPTemplateApplicationInstrumentClusterScene {
UIUserInterfaceStyle ContentStyle { get; }
}

[NoWatch, NoTV, NoMac, iOS (17, 4), MacCatalyst (17, 4)]
[NoWatch, NoTV, NoMac, iOS (17, 4)]
[NoMacCatalyst] // We don't expose CarPlay on Mac Catalyst for the moment // [MacCatalyst (17, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CPLane : NSCopying, NSSecureCoding {

[Export ("status", ArgumentSemantic.Assign)]
CPLaneStatus Status { get; set; }
CPLaneStatus Status {
get;
[Deprecated (PlatformName.iOS, 18, 0, message: "Use the 'NSMeasurement<NSUnitAngle>' constructor to create a CPLane with CPLaneStatus.NotGood, or use the 'NSMeasurement<NSUnitAngle>[], NSMeasurement<NSUnitAngle>[], bool' constructor to create a CPLane with status CPLaneStatus.Good or CPLaneStatus.Preferred.")]
set;
}

[Export ("primaryAngle", ArgumentSemantic.Strong)]
NSMeasurement<NSUnitAngle> PrimaryAngle { get; set; }
NSMeasurement<NSUnitAngle> PrimaryAngle {
[Deprecated (PlatformName.iOS, 18, 0, message: "Use the 'HighlightedAngle' property instead.")]
get;
[Deprecated (PlatformName.iOS, 18, 0, message: "Use the 'NSMeasurement<NSUnitAngle>[], NSMeasurement<NSUnitAngle>[], bool' to create a CPLane with a HighlightedAngle.")]
set;
}

[Export ("secondaryAngles", ArgumentSemantic.Strong)]
NSMeasurement<NSUnitAngle> [] SecondaryAngles { get; set; }
NSMeasurement<NSUnitAngle> [] SecondaryAngles {
[Deprecated (PlatformName.iOS, 18, 0, message: "Use the 'Angles' property instead.")]
get;
[Deprecated (PlatformName.iOS, 18, 0, message: "Use the 'NSMeasurement<NSUnitAngle>' constructor or the 'NSMeasurement<NSUnitAngle>[], NSMeasurement<NSUnitAngle>[], bool' constructor to create a CPLane with angles.")]
set;
}

[Export ("init")]
[Deprecated (PlatformName.iOS, 18, 0, message: "Use either of the other two constructors instead.")]
NativeHandle Constructor ();

[iOS (18, 0), MacCatalyst (18, 0)]
[Export ("initWithAngles:")]
NativeHandle Constructor (NSMeasurement<NSUnitAngle> [] angles);

[iOS (18, 0), MacCatalyst (18, 0)]
[Export ("initWithAngles:highlightedAngle:isPreferred:")]
NativeHandle Constructor (NSMeasurement<NSUnitAngle> [] angles, NSMeasurement<NSUnitAngle> [] highlightedAngle, bool isPreferred);


[NullAllowed]
[iOS (18, 0), MacCatalyst (18, 0)]
[Export ("highlightedAngle", ArgumentSemantic.Strong)]
NSMeasurement<NSUnitAngle> HighlightedAngle { get; }


[iOS (18, 0), MacCatalyst (18, 0)]
[Export ("angles", ArgumentSemantic.Copy)]
NSMeasurement<NSUnitAngle> [] Angles { get; }
}

[NoWatch, NoTV, NoMac, iOS (17, 4), MacCatalyst (17, 4)]
Expand Down
6 changes: 6 additions & 0 deletions src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4593,6 +4593,12 @@ interface NSError : NSSecureCoding, NSCopying {
[Field ("CMErrorDomain", "CoreMotion")]
NSString CoreMotionErrorDomain { get; }

[NoMac, NoTV, NoWatch]
[iOS (12, 0)]
[NoMacCatalyst] // We don't expose CarPlay on Mac Catalyst for the moment // [MacCatalyst (14, 0)]
[Field ("CarPlayErrorDomain", "CarPlay")]
NSString CarPlayErrorDomain { get; }

#if !XAMCORE_3_0
// now exposed with the corresponding EABluetoothAccessoryPickerError enum
[NoMac, NoTV, NoWatch]
Expand Down
7 changes: 6 additions & 1 deletion tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28170,6 +28170,9 @@ M:CarPlay.CPInterfaceControllerDelegate.TemplateDidAppear(CarPlay.CPTemplate,Sys
M:CarPlay.CPInterfaceControllerDelegate.TemplateDidDisappear(CarPlay.CPTemplate,System.Boolean)
M:CarPlay.CPInterfaceControllerDelegate.TemplateWillAppear(CarPlay.CPTemplate,System.Boolean)
M:CarPlay.CPInterfaceControllerDelegate.TemplateWillDisappear(CarPlay.CPTemplate,System.Boolean)
M:CarPlay.CPLane.#ctor
M:CarPlay.CPLane.#ctor(Foundation.NSMeasurement{Foundation.NSUnitAngle}[],Foundation.NSMeasurement{Foundation.NSUnitAngle}[],System.Boolean)
M:CarPlay.CPLane.#ctor(Foundation.NSMeasurement{Foundation.NSUnitAngle}[])
M:CarPlay.CPLane.Copy(Foundation.NSZone)
M:CarPlay.CPLane.EncodeTo(Foundation.NSCoder)
M:CarPlay.CPLaneGuidance.Copy(Foundation.NSZone)
Expand Down Expand Up @@ -59003,6 +59006,8 @@ P:CarPlay.CPInterfaceController.RootTemplate
P:CarPlay.CPInterfaceController.Templates
P:CarPlay.CPInterfaceController.TopTemplate
P:CarPlay.CPInterfaceController.WeakDelegate
P:CarPlay.CPLane.Angles
P:CarPlay.CPLane.HighlightedAngle
P:CarPlay.CPLane.PrimaryAngle
P:CarPlay.CPLane.SecondaryAngles
P:CarPlay.CPLane.Status
Expand All @@ -59026,7 +59031,6 @@ P:CarPlay.CPListItem.Image
P:CarPlay.CPListItem.IsExplicitContent
P:CarPlay.CPListItem.IsPlaying
P:CarPlay.CPListItem.MaximumImageSize
P:CarPlay.CPListItem.MaximumListItemImageSize
P:CarPlay.CPListItem.PlaybackProgress
P:CarPlay.CPListItem.PlayingIndicatorLocation
P:CarPlay.CPListItem.ShowsDisclosureIndicator
Expand Down Expand Up @@ -65214,6 +65218,7 @@ P:Foundation.NSDictionary`2.Values
P:Foundation.NSDimension.BaseUnit
P:Foundation.NSDistributedNotificationCenter.NSLocalNotificationCenterType
P:Foundation.NSEnergyFormatter.ForFoodEnergyUse
P:Foundation.NSError.CarPlayErrorDomain
P:Foundation.NSError.CFNetworkErrorDomain
P:Foundation.NSError.CocoaErrorDomain
P:Foundation.NSError.CoreLocationErrorDomain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,3 +514,68 @@
!missing-selector! CPTemplateApplicationScene::contentStyle not bound
!missing-type! CPInstrumentClusterController not bound
!missing-type! CPTemplateApplicationInstrumentClusterScene not bound
!missing-selector! CPAlertAction::color not bound
!missing-selector! CPAlertAction::initWithTitle:color:handler: not bound
!missing-enum! CPJunctionType not bound
!missing-enum! CPLaneStatus not bound
!missing-enum! CPManeuverState not bound
!missing-enum! CPManeuverType not bound
!missing-enum! CPTrafficSide not bound
!missing-selector! +CPPointOfInterest::pinImageSize not bound
!missing-selector! +CPPointOfInterest::selectedPinImageSize not bound
!missing-selector! CPLane::status not bound
!missing-selector! CPLaneGuidance::instructionVariants not bound
!missing-selector! CPLaneGuidance::lanes not bound
!missing-selector! CPLaneGuidance::setInstructionVariants: not bound
!missing-selector! CPLaneGuidance::setLanes: not bound
!missing-selector! CPListImageRowItem::imageTitles not bound
!missing-selector! CPListImageRowItem::initWithText:images:imageTitles: not bound
!missing-selector! CPListImageRowItem::setImageTitles: not bound
!missing-selector! CPManeuver::highwayExitLabel not bound
!missing-selector! CPManeuver::junctionElementAngles not bound
!missing-selector! CPManeuver::junctionExitAngle not bound
!missing-selector! CPManeuver::junctionType not bound
!missing-selector! CPManeuver::linkedLaneGuidance not bound
!missing-selector! CPManeuver::maneuverType not bound
!missing-selector! CPManeuver::roadFollowingManeuverVariants not bound
!missing-selector! CPManeuver::setHighwayExitLabel: not bound
!missing-selector! CPManeuver::setJunctionElementAngles: not bound
!missing-selector! CPManeuver::setJunctionExitAngle: not bound
!missing-selector! CPManeuver::setJunctionType: not bound
!missing-selector! CPManeuver::setLinkedLaneGuidance: not bound
!missing-selector! CPManeuver::setManeuverType: not bound
!missing-selector! CPManeuver::setRoadFollowingManeuverVariants: not bound
!missing-selector! CPManeuver::setTrafficSide: not bound
!missing-selector! CPManeuver::trafficSide not bound
!missing-selector! CPNavigationSession::addLaneGuidances: not bound
!missing-selector! CPNavigationSession::addManeuvers: not bound
!missing-selector! CPNavigationSession::currentLaneGuidance not bound
!missing-selector! CPNavigationSession::currentRoadNameVariants not bound
!missing-selector! CPNavigationSession::maneuverState not bound
!missing-selector! CPNavigationSession::resumeTripWithUpdatedRouteInformation: not bound
!missing-selector! CPNavigationSession::setCurrentLaneGuidance: not bound
!missing-selector! CPNavigationSession::setCurrentRoadNameVariants: not bound
!missing-selector! CPNavigationSession::setManeuverState: not bound
!missing-selector! CPPointOfInterest::initWithLocation:title:subtitle:summary:detailTitle:detailSubtitle:detailSummary:pinImage:selectedPinImage: not bound
!missing-selector! CPPointOfInterest::selectedPinImage not bound
!missing-selector! CPPointOfInterest::setSelectedPinImage: not bound
!missing-selector! CPRouteInformation::currentLaneGuidance not bound
!missing-selector! CPRouteInformation::currentManeuvers not bound
!missing-selector! CPRouteInformation::initWithManeuvers:laneGuidances:currentManeuvers:currentLaneGuidance:tripTravelEstimates:maneuverTravelEstimates: not bound
!missing-selector! CPRouteInformation::laneGuidances not bound
!missing-selector! CPRouteInformation::maneuvers not bound
!missing-selector! CPRouteInformation::maneuverTravelEstimates not bound
!missing-selector! CPRouteInformation::tripTravelEstimates not bound
!missing-selector! CPTabBarTemplate::selectTemplate: not bound
!missing-selector! CPTabBarTemplate::selectTemplateAtIndex: not bound
!missing-selector! CPTravelEstimates::distanceRemainingToDisplay not bound
!missing-selector! CPTravelEstimates::initWithDistanceRemaining:distanceRemainingToDisplay:timeRemaining: not bound
!missing-selector! CPTrip::destinationNameVariants not bound
!missing-selector! CPTrip::setDestinationNameVariants: not bound
!missing-type! CPLane not bound
!missing-type! CPLaneGuidance not bound
!missing-type! CPRouteInformation not bound
!missing-selector! CPLane::angles not bound
!missing-selector! CPLane::highlightedAngle not bound
!missing-selector! CPLane::initWithAngles: not bound
!missing-selector! CPLane::initWithAngles:highlightedAngle:isPreferred: not bound
Loading

9 comments on commit 16207e9

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.