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

[DeviceDiscoveryExtension] Implement Xcode 16 beta 6 changes. #21175

Merged
merged 1 commit into from
Sep 4, 2024
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
14 changes: 7 additions & 7 deletions src/DeviceDiscoveryExtension/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

namespace DeviceDiscoveryExtension {

[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
[Native]
public enum DDDeviceProtocol : long {
Invalid = 0,
Dial = 1,
}

[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
[Native]
public enum DDDeviceCategory : long {
HiFiSpeaker = 0,
Expand All @@ -35,7 +35,7 @@ public enum DDDeviceCategory : long {
AccessorySetup = 6,
}

[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
[Native]
public enum DDDeviceState : long {
Invalid = 0,
Expand All @@ -45,15 +45,15 @@ public enum DDDeviceState : long {
Invalidating = 30,
}

[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
[Native]
public enum DDDeviceMediaPlaybackState : long {
NoContent = 0,
Paused = 1,
Playing = 2,
}

[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
[ErrorDomain ("DDErrorDomain")]
[Native]
public enum DDErrorCode : long {
Expand All @@ -68,7 +68,7 @@ public enum DDErrorCode : long {
// Next, // don't bind 'Next', it's not static and we'd have to break compat if it were ever to change
}

[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
[Native]
public enum DDEventType : long {
Unknown = 0,
Expand All @@ -77,7 +77,7 @@ public enum DDEventType : long {
DeviceChanged = 42,
}

[NoMac, iOS (18, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0), NoWatch, NoTV]
[Native]
[Flags]
public enum DDDeviceSupports : ulong {
Expand Down
1 change: 1 addition & 0 deletions src/Foundation/NSObject.mac.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public partial class NSObject {
static IntPtr sm = Dlfcn.dlopen (Constants.ServiceManagementLibrary, 1);
static IntPtr sa = Dlfcn.dlopen (Constants.SafetyKitLibrary, 1);
static IntPtr cr = Dlfcn.dlopen (Constants.CryptoTokenKitLibrary, 1);
static IntPtr dd = Dlfcn.dlopen (Constants.DeviceDiscoveryExtensionLibrary, 1);
static IntPtr fk = Dlfcn.dlopen (Constants.FSKitLibrary, 1);

#if !NET
Expand Down
2 changes: 2 additions & 0 deletions src/build/generator-frameworks.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ partial class Frameworks {
"CryptoTokenKit",
"Darwin",
"DeviceCheck",
"DeviceDiscoveryExtension",
"EventKit",
"ExecutionPolicy",
"ExtensionKit",
Expand Down Expand Up @@ -481,6 +482,7 @@ partial class Frameworks {
"CoreWlan",
"CryptoTokenKit",
"DeviceCheck",
"DeviceDiscoveryExtension",
"EventKit",
"EventKitUI",
"ExecutionPolicy",
Expand Down
8 changes: 4 additions & 4 deletions src/devicediscoveryextension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace DeviceDiscoveryExtension {

[Static]
[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
interface DDDeviceProtocolStrings {
[Field ("DDDeviceProtocolStringInvalid")]
NSString Invalid { get; }
Expand All @@ -31,7 +31,7 @@ interface DDDeviceProtocolStrings {
NSString Dial { get; }
}

[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface DDDevice {
Expand Down Expand Up @@ -98,7 +98,7 @@ interface DDDevice {
string Ssid { get; set; }
}

[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface DDDeviceEvent {
Expand All @@ -112,7 +112,7 @@ interface DDDeviceEvent {
DDEventType EventType { get; }
}

[NoMac, iOS (16, 0), NoMacCatalyst, NoWatch, NoTV]
[Mac (15, 0), iOS (16, 0), MacCatalyst (18, 0), NoWatch, NoTV]
[BaseType (typeof (NSObject))]
interface DDDiscoverySession {
[Export ("reportEvent:")]
Expand Down
2 changes: 2 additions & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -2127,6 +2127,7 @@ MACOS_FRAMEWORKS = \
CoreText \
CoreWlan \
Darwin \
DeviceDiscoveryExtension \
EventKit \
ExecutionPolicy \
ExtensionKit \
Expand Down Expand Up @@ -2452,6 +2453,7 @@ MACCATALYST_FRAMEWORKS = \
CoreTelephony \
CoreText \
CoreWlan \
DeviceDiscoveryExtension \
EventKit \
EventKitUI \
ExecutionPolicy \
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/maccatalyst-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
-d:HAS_COREWLAN
-d:HAS_CRYPTOTOKENKIT
-d:HAS_DEVICECHECK
-d:HAS_DEVICEDISCOVERYEXTENSION
-d:HAS_EVENTKIT
-d:HAS_EVENTKITUI
-d:HAS_EXECUTIONPOLICY
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/macos-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
-d:HAS_CRYPTOTOKENKIT
-d:HAS_DARWIN
-d:HAS_DEVICECHECK
-d:HAS_DEVICEDISCOVERYEXTENSION
-d:HAS_EVENTKIT
-d:HAS_EXECUTIONPOLICY
-d:HAS_EXTENSIONKIT
Expand Down
1 change: 1 addition & 0 deletions src/rsp/macos-defines.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
-d:HAS_CRYPTOTOKENKIT
-d:HAS_DARWIN
-d:HAS_DEVICECHECK
-d:HAS_DEVICEDISCOVERYEXTENSION
-d:HAS_EVENTKIT
-d:HAS_EXECUTIONPOLICY
-d:HAS_EXTENSIONKIT
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## These C methods are helpers to cast an enum value to string, but the string value is not used anywhere. Ignored them for now.
!missing-pinvoke! DDDeviceCategoryToString is not bound
!missing-pinvoke! DDDeviceMediaPlaybackStateToString is not bound
!missing-pinvoke! DDDeviceProtocolToString is not bound
!missing-pinvoke! DDDeviceStateToString is not bound
!missing-pinvoke! DDEventTypeToString is not bound

## This is a non-constant enum value, so we're not binding it so that we don't have to break compat in the future
!missing-enum-value! DDErrorCode native value DDErrorCodeNext = 350007 not bound

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## These C methods are helpers to cast an enum value to string, but the string value is not used anywhere. Ignored them for now.
!missing-pinvoke! DDDeviceCategoryToString is not bound
!missing-pinvoke! DDDeviceMediaPlaybackStateToString is not bound
!missing-pinvoke! DDDeviceProtocolToString is not bound
!missing-pinvoke! DDDeviceStateToString is not bound
!missing-pinvoke! DDEventTypeToString is not bound

## This is a non-constant enum value, so we're not binding it so that we don't have to break compat in the future
!missing-enum-value! DDErrorCode native value DDErrorCodeNext = 350007 not bound

This file was deleted.

56 changes: 4 additions & 52 deletions tests/xtro-sharpie/macOS-DeviceDiscoveryExtension.todo
Original file line number Diff line number Diff line change
@@ -1,57 +1,9 @@
!missing-enum! DDDeviceCategory not bound
!missing-enum! DDDeviceMediaPlaybackState not bound
!missing-enum! DDDeviceProtocol not bound
!missing-enum! DDDeviceState not bound
!missing-enum! DDDeviceSupports not bound
!missing-enum! DDErrorCode not bound
!missing-enum! DDEventType not bound
!missing-field! DDDeviceProtocolStringDIAL not bound
!missing-field! DDDeviceProtocolStringInvalid not bound
!missing-field! DDErrorDomain not bound
## These C methods are helpers to cast an enum value to string, but the string value is not used anywhere. Ignored them for now.
!missing-pinvoke! DDDeviceCategoryToString is not bound
!missing-pinvoke! DDDeviceMediaPlaybackStateToString is not bound
!missing-pinvoke! DDDeviceProtocolToString is not bound
!missing-pinvoke! DDDeviceStateToString is not bound
!missing-pinvoke! DDEventTypeToString is not bound
!missing-selector! DDDevice::bluetoothIdentifier not bound
!missing-selector! DDDevice::category not bound
!missing-selector! DDDevice::deviceSupports not bound
!missing-selector! DDDevice::displayImageName not bound
!missing-selector! DDDevice::displayName not bound
!missing-selector! DDDevice::identifier not bound
!missing-selector! DDDevice::initWithDisplayName:category:protocolType:identifier: not bound
!missing-selector! DDDevice::mediaContentSubtitle not bound
!missing-selector! DDDevice::mediaContentTitle not bound
!missing-selector! DDDevice::mediaPlaybackState not bound
!missing-selector! DDDevice::networkEndpoint not bound
!missing-selector! DDDevice::protocol not bound
!missing-selector! DDDevice::protocolType not bound
!missing-selector! DDDevice::setBluetoothIdentifier: not bound
!missing-selector! DDDevice::setCategory: not bound
!missing-selector! DDDevice::setDeviceSupports: not bound
!missing-selector! DDDevice::setDisplayImageName: not bound
!missing-selector! DDDevice::setDisplayName: not bound
!missing-selector! DDDevice::setIdentifier: not bound
!missing-selector! DDDevice::setMediaContentSubtitle: not bound
!missing-selector! DDDevice::setMediaContentTitle: not bound
!missing-selector! DDDevice::setMediaPlaybackState: not bound
!missing-selector! DDDevice::setNetworkEndpoint: not bound
!missing-selector! DDDevice::setProtocol: not bound
!missing-selector! DDDevice::setProtocolType: not bound
!missing-selector! DDDevice::setSSID: not bound
!missing-selector! DDDevice::setState: not bound
!missing-selector! DDDevice::setSupportsGrouping: not bound
!missing-selector! DDDevice::setTxtRecordData: not bound
!missing-selector! DDDevice::setUrl: not bound
!missing-selector! DDDevice::SSID not bound
!missing-selector! DDDevice::state not bound
!missing-selector! DDDevice::supportsGrouping not bound
!missing-selector! DDDevice::txtRecordData not bound
!missing-selector! DDDevice::url not bound
!missing-selector! DDDeviceEvent::device not bound
!missing-selector! DDDeviceEvent::eventType not bound
!missing-selector! DDDeviceEvent::initWithEventType:device: not bound
!missing-selector! DDDiscoverySession::reportEvent: not bound
!missing-type! DDDevice not bound
!missing-type! DDDeviceEvent not bound
!missing-type! DDDiscoverySession not bound

## This is a non-constant enum value, so we're not binding it so that we don't have to break compat in the future
!missing-enum-value! DDErrorCode native value DDErrorCodeNext = 350007 not bound
6 changes: 5 additions & 1 deletion tools/common/Frameworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ public static Frameworks MacFrameworks {
{ "Symbols", "Symbols", 14, 0 },
{ "SensitiveContentAnalysis", "SensitiveContentAnalysis", 14, 0 },

{ "DeviceDiscoveryExtension", "DeviceDiscoveryExtension", 15, 0},
{ "FSKit", "FSKit", 15, 0 },
};
}
Expand Down Expand Up @@ -680,6 +681,7 @@ public static Frameworks GetMacCatalystFrameworks ()
var v14_0 = new Version (14, 0);
var v14_2 = new Version (14, 2);
var v16_1 = new Version (16, 1);
var v18_0 = new Version (18, 0);
foreach (var f in catalyst_frameworks.Values) {
switch (f.Name) {
// These frameworks were added to Catalyst after they were added to iOS, so we have to adjust the Versions fields
Expand All @@ -698,8 +700,10 @@ public static Frameworks GetMacCatalystFrameworks ()
case "ThreadNetwork":
f.Version = v16_1;
break;
// These frameworks are not available on Mac Catalyst
case "DeviceDiscoveryExtension":
f.Version = v18_0;
break;
// These frameworks are not available on Mac Catalyst
case "OpenGLES":
case "NewsstandKit":
case "MediaSetup":
Expand Down