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

[MediaAccessibility] Add xcode 15 beta 7 support. #19016

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/mediaaccessibility.cs
Expand Up @@ -2,6 +2,7 @@

using ObjCRuntime;
using Foundation;
using Surface = IOSurface.IOSurface;

namespace MediaAccessibility {

Expand Down Expand Up @@ -45,4 +46,29 @@ interface MAVideoAccommodations {
[Field ("kMADimFlashingLightsChangedNotification")]
NSString DimFlashingLightsChangedNotification { get; }
}

[TV (17,0), Mac (14,0), iOS (17,0), MacCatalyst (17,0)]
[BaseType (typeof(NSObject))]
interface MAFlashingLightsProcessorResult
{
[Export ("surfaceProcessed")]
bool SurfaceProcessed { get; }

[Export ("mitigationLevel")]
float MitigationLevel { get; }

[Export ("intensityLevel")]
float IntensityLevel { get; }
}

[TV (17,0), Mac (14,0), iOS (17,0), MacCatalyst (17,0)]
[BaseType (typeof(NSObject))]
interface MAFlashingLightsProcessor
{
[Export ("canProcessSurface:")]
bool CanProcess (Surface surface);

[Export ("processSurface:outSurface:timestamp:options:")]
MAFlashingLightsProcessorResult Process (Surface inSurface, Surface outSurface, double timestamp, [NullAllowed] NSDictionary<NSString, NSObject> options);
Copy link
Member

Choose a reason for hiding this comment

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

Can the options be a strong dictionary?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI - I also looked at the Swift doc'n and the key, oddly enough, is not an NSString, which is an inner struct called MAFlashingLightsProcessor.OptionKey which has initializers from String - it feels like they're keeping their options open for the future, but the values of the options are also untyped there and undocumented.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did notice the same, we should leave it as open as possible.

mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
}
}

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/iOS-MediaAccessibility.todo

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/macOS-MediaAccessibility.todo

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/tvOS-MediaAccessibility.todo

This file was deleted.