Skip to content

Commit

Permalink
Address reviews.
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque committed Aug 31, 2021
1 parent e4f3c47 commit 6111f8d
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 26 deletions.
18 changes: 0 additions & 18 deletions src/CoreGraphics/CGColorSpace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,6 @@ public CGColorSpace (CFPropertyList propertyList)
this.handle = CGColorSpaceCreateWithPropertyList (propertyList.Handle);
}

#if !NET
[Mac (12,0), iOS (15,0), TV (15,0), Watch (8,0), MacCatalyst (15,0)]
#else
[SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")]
#endif
[DllImport (Constants.CoreGraphicsLibrary)]
static extern IntPtr CGColorSpaceCreateWithColorSyncProfile (/*[NullAllowed] ColorSyncProfileRef */ IntPtr profile, /*[NullAllowed] CFDictionaryRef */ IntPtr options);

#if !NET
[Mac (12,0), iOS (15,0), TV (15,0), Watch (8,0), MacCatalyst (15,0)]
#else
[SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")]
#endif
public CGColorSpace (IntPtr? profile, NSDictionary options)
{
this.handle = CGColorSpaceCreateWithColorSyncProfile (profile ?? IntPtr.Zero, options.GetHandle ());
}

[Preserve (Conditional=true)]
internal CGColorSpace (IntPtr handle, bool owns)
{
Expand Down
8 changes: 4 additions & 4 deletions src/CoreGraphics/CGDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace CoreGraphics
{

#if !NET
[MacCatalyst (15,0)]
[MacCatalyst (15,0)]
#else
[SupportedOSPlatform ("maccatalyst15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#endif
public enum CGCaptureOptions : uint
{
Expand All @@ -20,9 +20,9 @@ public enum CGCaptureOptions : uint
}

#if !NET
[MacCatalyst (15,0)]
[MacCatalyst (15,0)]
#else
[SupportedOSPlatform ("maccatalyst15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#endif
public static class CGDisplay
{
Expand Down
4 changes: 2 additions & 2 deletions src/CoreGraphics/CGEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
namespace CoreGraphics {

#if !NET
[MacCatalyst (15,0)]
[MacCatalyst (15,0)]
#else
[SupportedOSPlatform ("maccatalyst15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#endif
public sealed class CGEvent : IDisposable, INativeObject {
public delegate IntPtr CGEventTapCallback (IntPtr tapProxyEvent, CGEventType eventType, IntPtr eventRef, IntPtr userInfo);
Expand Down
2 changes: 1 addition & 1 deletion src/coregraphics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ interface CGColorSpaceNames {

[Mac (12, 0), iOS (15, 0), TV (15,0), Watch (8,0), MacCatalyst (15,0)]
[Field ("kCGColorSpaceLinearITUR_2020")]
NSString LinearITUR_2020 { get; }
NSString LinearItur_2020 { get; }
}

[Partial]
Expand Down
23 changes: 23 additions & 0 deletions tests/monotouch-test/CoreGraphics/ColorSpaceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,5 +445,28 @@ public void CreateExtendedLinearizedTest ()
Assert.That ((nint) TestRuntime.CFGetRetainCount (csl.Handle), Is.EqualTo ((nint) 1));
}
}

[Test]
public void IsHlgBasedTest ()
{
TestRuntime.AssertXcodeVersion (13,0);
using (var cs = CGColorSpace.CreateDeviceRGB ()) {
Assert.DoesNotThrow (() => {
var result = cs.IsHlgBased;
});
}
}

[Test]
public void IsPQBasedTest ()
{
TestRuntime.AssertXcodeVersion (13,0);
using (var cs = CGColorSpace.CreateDeviceRGB ()) {
Assert.DoesNotThrow (() => {
var result = cs.IsPQBased;
});
}
}
}

}
2 changes: 1 addition & 1 deletion tests/xtro-sharpie/MacCatalyst-CoreGraphics.ignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ignored in macOs too
# ignored in macOS too
!missing-enum! CGConfigureOption not bound
!missing-enum! CGDisplayChangeSummaryFlags not bound
!missing-enum! CGDisplayStreamFrameStatus not bound
Expand Down
3 changes: 3 additions & 0 deletions tests/xtro-sharpie/common-CoreGraphics.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# There's an identical function that takes a C callback instead of a block, and which we've bound, which makes this function redundant since the managed API would be identical.
!missing-pinvoke! CGPDFDictionaryApplyBlock is not bound

# not yet sure how to bind this
!missing-pinvoke! CGColorSpaceCreateWithColorSyncProfile is not bound

## unsorted

!missing-enum! CGBitmapInfo not bound
Expand Down

0 comments on commit 6111f8d

Please sign in to comment.