-
Notifications
You must be signed in to change notification settings - Fork 517
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
[CoreGraphics] Add support for xcode13 beta 5. #12589
[CoreGraphics] Add support for xcode13 beta 5. #12589
Conversation
src/CoreGraphics/CGColorSpace.cs
Outdated
#else | ||
[SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] | ||
#endif | ||
public CGColorSpace (IntPtr? profile, NSDictionary options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure I like a nullable IntPtr
ideally we should not expose IntPtr
and, if we must, it should be straightforward and similar to the low-level API we have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not clear why this is available for iOS since it's only exposed in macOS' NSColorSpace
and the framework, ColorSync, is not available outside macOS
https://developer.apple.com/documentation/colorsync/1462094-colorsyncprofilecreate?language=objc
I suggest disabling the API, at least for iOS/tvOS/watchOS, until we know It can be somehow used on those platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was in the same feeling, we do not suppose that so might not give too much to users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure I parse the last part ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tldr; I agree :)
src/CoreGraphics/CGDisplay.cs
Outdated
#if !NET | ||
[MacCatalyst (15,0)] | ||
#else | ||
[SupportedOSPlatform ("maccatalyst15.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ indent
src/CoreGraphics/CGDisplay.cs
Outdated
#if !NET | ||
[MacCatalyst (15,0)] | ||
#else | ||
[SupportedOSPlatform ("maccatalyst15.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
src/CoreGraphics/CGEvent.cs
Outdated
#if !NET | ||
[MacCatalyst (15,0)] | ||
#else | ||
[SupportedOSPlatform ("maccatalyst15.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
src/coregraphics.cs
Outdated
|
||
[Mac (12, 0), iOS (15, 0), TV (15,0), Watch (8,0), MacCatalyst (15,0)] | ||
[Field ("kCGColorSpaceLinearITUR_2020")] | ||
NSString LinearITUR_2020 { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Itur
@@ -1,30 +1,15 @@ | |||
!missing-enum! CGCaptureOptions not bound | |||
# ignored in macOs too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: macOS
@@ -9,5 +9,8 @@ namespace ObjCRuntime { | |||
|
|||
// iOS 9.0 | |||
public const string libcompressionLibrary = "/usr/lib/libcompression.dylib"; | |||
|
|||
// xcode 13 | |||
public const string ApplicationServicesCoreGraphicsLibrary = "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/CoreGraphics"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is it used ?
https://developer.apple.com/documentation/colorsync/colorsyncprofileref?changes=_4&language=objc hints to it, but no DllImport uses that constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used in src/CoreGraphics/CGEvent.cs https://github.com/xamarin/xamarin-macios/pull/12589/files#diff-c22d9304f9f0fa2e7659f5a3ec3e9a4e9d5fac1ab8375bf81bd5a26583edb7c9L27 which was added for maccatalyst.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the constant string ApplicationServicesCoreGraphicsLibrary
used there ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes github links to a line number of a file in a PR SUCK, better link: https://github.com/xamarin/xamarin-macios/blob/main/src/CoreGraphics/CGEvent.cs#L80
[DllImport (Constants.ApplicationServicesCoreGraphicsLibrary)]
extern static IntPtr CGEventCreateMouseEvent(IntPtr source, CGEventType mouseType, CGPoint mouseCursorPosition, CGMouseButton mouseButton);
public CGEvent (CGEventSource source, CGEventType mouseType, CGPoint mouseCursorPosition, CGMouseButton mouseButton)
{
handle = CGEventCreateMouseEvent (source == null ? IntPtr.Zero : source.Handle, mouseType, mouseCursorPosition, mouseButton);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I see it now 👓 thanks!
also new manual API needs manual unit tests :-) |
✅ [PR Build] Tests passed on Build. ✅Tests passed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diffℹ️ API Diff (from PR only) (please review changes) GitHub pagesResults can be found in the following github pages (it might take some time to publish): 🎉 All 108 tests passed 🎉Pipeline on Agent XAMBOT-1094.BigSur' |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diffℹ️ API Diff (from PR only) (please review changes) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results3 tests failed, 105 tests passed.Failed tests
Pipeline on Agent XAMBOT-1098.BigSur' |
No description provided.