From fee66b35054140ca4dfdb4b79ceb1786b4141be7 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Tue, 18 Jun 2019 17:59:08 -0700 Subject: [PATCH] [coregraphics] Update for Xcode 11 beta 1 and 2 (#6337) along with unit tests for p/invokes --- src/CoreGraphics/CGColor.cs | 34 +++++++++ src/CoreGraphics/CGColorConversionInfo.cs | 45 +++++++++-- src/CoreGraphics/CGColorSpace.cs | 14 +++- src/CoreGraphics/CGContextPDF.cs | 42 +++++++++++ src/CoreGraphics/CGEnums.cs | 75 ++++++++++++++++++- src/coregraphics.cs | 63 ++++++++++++++++ .../CoreGraphics/ColorConversionInfoTest.cs | 34 +++++++++ .../CoreGraphics/ColorSpaceTest.cs | 10 +++ .../monotouch-test/CoreGraphics/ColorTest.cs | 21 ++++++ .../CoreGraphics/PDFContextTest.cs | 39 ++++++++++ .../CoreGraphics/PdfTagTypeTest.cs | 72 ++++++++++++++++++ tests/xtro-sharpie/iOS-CoreGraphics.todo | 19 ----- tests/xtro-sharpie/macOS-CoreGraphics.todo | 19 ----- tests/xtro-sharpie/tvOS-CoreGraphics.todo | 19 ----- tests/xtro-sharpie/watchOS-CoreGraphics.todo | 19 ----- 15 files changed, 441 insertions(+), 84 deletions(-) create mode 100644 tests/monotouch-test/CoreGraphics/PdfTagTypeTest.cs delete mode 100644 tests/xtro-sharpie/iOS-CoreGraphics.todo delete mode 100644 tests/xtro-sharpie/macOS-CoreGraphics.todo delete mode 100644 tests/xtro-sharpie/tvOS-CoreGraphics.todo delete mode 100644 tests/xtro-sharpie/watchOS-CoreGraphics.todo diff --git a/src/CoreGraphics/CGColor.cs b/src/CoreGraphics/CGColor.cs index d9825787cc..2eebdd69b8 100644 --- a/src/CoreGraphics/CGColor.cs +++ b/src/CoreGraphics/CGColor.cs @@ -275,6 +275,40 @@ namespace CoreGraphics { color == null ? IntPtr.Zero : color.Handle, options == null ? IntPtr.Zero : options.Handle); return h == IntPtr.Zero ? null : new CGColor (h); } + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + [DllImport (Constants.CoreGraphicsLibrary)] + static extern /* CGColorRef* */ IntPtr CGColorCreateSRGB (nfloat red, nfloat green, nfloat blue, nfloat alpha); + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + static public CGColor CreateSrgb (nfloat red, nfloat green, nfloat blue, nfloat alpha) + { + var h = CGColorCreateSRGB (red, green, blue, alpha); + return h == IntPtr.Zero ? null : new CGColor (h); + } + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + [DllImport (Constants.CoreGraphicsLibrary)] + static extern /* CGColorRef* */ IntPtr CGColorCreateGenericGrayGamma2_2 (nfloat gray, nfloat alpha); + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + static public CGColor CreateGenericGrayGamma2_2 (nfloat gray, nfloat alpha) + { + var h = CGColorCreateGenericGrayGamma2_2 (gray, alpha); + return h == IntPtr.Zero ? null : new CGColor (h); + } #endif // !COREBUILD } } diff --git a/src/CoreGraphics/CGColorConversionInfo.cs b/src/CoreGraphics/CGColorConversionInfo.cs index 178cb7232a..4bb77a99e9 100644 --- a/src/CoreGraphics/CGColorConversionInfo.cs +++ b/src/CoreGraphics/CGColorConversionInfo.cs @@ -121,19 +121,52 @@ namespace CoreGraphics { extern static IntPtr CGColorConversionInfoCreate (/* cg_nullable CGColorSpaceRef */ IntPtr src, /* cg_nullable CGColorSpaceRef */ IntPtr dst); [iOS (10,0)][Mac (10,12)] - public CGColorConversionInfo (CGColorSpace src, CGColorSpace dst) + public CGColorConversionInfo (CGColorSpace source, CGColorSpace destination) { // API accept null arguments but returns null, which we can't use - if (src == null) - throw new ArgumentNullException (nameof (src)); - if (dst == null) - throw new ArgumentNullException (nameof (dst)); - Handle = CGColorConversionInfoCreate (src.Handle, dst.Handle); + if (source == null) + throw new ArgumentNullException (nameof (source)); + if (destination == null) + throw new ArgumentNullException (nameof (destination)); + Handle = CGColorConversionInfoCreate (source.Handle, destination.Handle); if (Handle == IntPtr.Zero) throw new Exception ("Failed to create CGColorConversionInfo"); } + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + [DllImport(Constants.CoreGraphicsLibrary)] + static extern /* CGColorConversionInfoRef* */ IntPtr CGColorConversionInfoCreateWithOptions (/* CGColorSpaceRef* */ IntPtr src, /* CGColorSpaceRef* */ IntPtr dst, /* CFDictionaryRef _Nullable */ IntPtr options); + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + public CGColorConversionInfo (CGColorSpace source, CGColorSpace destination, NSDictionary options) + { + if (source == null) + throw new ArgumentNullException (nameof (source)); + if (destination == null) + throw new ArgumentNullException (nameof (destination)); + + Handle = CGColorConversionInfoCreateWithOptions (source.Handle, destination.Handle, options.GetHandle ()); + + if (Handle == IntPtr.Zero) + throw new Exception ("Failed to create CGColorConversionInfo"); + } + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + public CGColorConversionInfo (CGColorSpace source, CGColorSpace destination, CGColorConversionOptions options) : + this (source, destination, options?.Dictionary) + { + } + ~CGColorConversionInfo () { Dispose (false); diff --git a/src/CoreGraphics/CGColorSpace.cs b/src/CoreGraphics/CGColorSpace.cs index 54081da3b8..235adea870 100644 --- a/src/CoreGraphics/CGColorSpace.cs +++ b/src/CoreGraphics/CGColorSpace.cs @@ -532,7 +532,19 @@ namespace CoreGraphics { return null; return new CFPropertyList (x, owns: true); } - + + [Mac (10,15, onlyOn64: true)][iOS(13,0)] + [TV (13,0)][Watch (6,0)] + [DllImport (Constants.CoreGraphicsLibrary)] + static extern bool CGColorSpaceIsHDR (/* CGColorSpaceRef */ IntPtr space); + + [Mac (10,15, onlyOn64: true)][iOS(13,0)] + [TV (13,0)][Watch (6,0)] + public bool IsHdr { + get { + return CGColorSpaceIsHDR (handle); + } + } #endif // !COREBUILD } } diff --git a/src/CoreGraphics/CGContextPDF.cs b/src/CoreGraphics/CGContextPDF.cs index 6d890f78a0..689981a397 100644 --- a/src/CoreGraphics/CGContextPDF.cs +++ b/src/CoreGraphics/CGContextPDF.cs @@ -249,6 +249,48 @@ namespace CoreGraphics { using (var s = new CFString (name)) CGPDFContextSetDestinationForRect (Handle, s.Handle, rect); } + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + [DllImport (Constants.CoreGraphicsLibrary)] + static extern void CGPDFContextBeginTag (/* CGContextRef* */ IntPtr context, CGPdfTagType tagType, /* CFDictionaryRef* _Nullable */ IntPtr tagProperties); + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + public void BeginTag (CGPdfTagType tagType, NSDictionary tagProperties) + { + CGPDFContextBeginTag (Handle, tagType, tagProperties.GetHandle ()); + } + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + public void BeginTag (CGPdfTagType tagType, CGPdfTagProperties tagProperties) + { + var d = tagProperties?.Dictionary; + CGPDFContextBeginTag (Handle, tagType, d.GetHandle ()); + } + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + [DllImport (Constants.CoreGraphicsLibrary)] + static extern void CGPDFContextEndTag (/* CGContextRef* */ IntPtr context); + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + public void EndTag () + { + CGPDFContextEndTag (Handle); + } protected override void Dispose (bool disposing) { diff --git a/src/CoreGraphics/CGEnums.cs b/src/CoreGraphics/CGEnums.cs index d02754b790..d52573b429 100644 --- a/src/CoreGraphics/CGEnums.cs +++ b/src/CoreGraphics/CGEnums.cs @@ -4,13 +4,86 @@ // Author: // Vincent Dondain (vidondai@microsoft.com) // -// Copyright 2018 Microsoft +// Copyright 2018-2019 Microsoft Corporation // +using System; +using System.Runtime.InteropServices; +using ObjCRuntime; + namespace CoreGraphics { public enum MatrixOrder { Prepend = 0, Append = 1, } + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + public enum CGPdfTagType /* int32_t */ { + Document = 100, + Part, + Art, + Section, + Div, + BlockQuote, + Caption, + Toc, + Toci, + Index, + NonStructure, + Private, + Paragraph = 200, + Header, + Header1, + Header2, + Header3, + Header4, + Header5, + Header6, + List = 300, + ListItem, + Label, + ListBody, + Table = 400, + TableRow, + TableHeaderCell, + TableDataCell, + TableHeader, + TableBody, + TableFooter, + Span = 500, + Quote, + Note, + Reference, + Bibliography, + Code, + Link, + Annotation, + Ruby = 600, + RubyBaseText, + RubyAnnotationText, + RubyPunctuation, + Warichu, + WarichuText, + WarichuPunctiation, + Figure = 700, + Formula, + Form, + } + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + public static class CGPdfTagType_Extensions { + + [DllImport (Constants.CoreGraphicsLibrary)] + static extern /* const char * _Nullable */ IntPtr CGPDFTagTypeGetName (CGPdfTagType tagType); + + public static string GetName (this CGPdfTagType self) + { + return Marshal.PtrToStringAnsi (CGPDFTagTypeGetName (self)); + } + } } diff --git a/src/coregraphics.cs b/src/coregraphics.cs index 973ea2af30..9ef889fae8 100644 --- a/src/coregraphics.cs +++ b/src/coregraphics.cs @@ -194,6 +194,36 @@ namespace CoreGraphics { [iOS (11,0)][Mac (10,13)][Watch (4,0)][TV (11,0)] [Field ("kCGColorSpaceGenericLab")] NSString GenericLab { get; } + + [Mac (10,14,3, onlyOn64: true)][iOS (12,3)] + [TV (12,3)][Watch (5,3)] + [Field ("kCGColorSpaceExtendedLinearITUR_2020")] + NSString ExtendedLinearItur_2020 { get; } + + [Mac (10,14,3, onlyOn64: true)][iOS (12,3)] + [TV (12,3)][Watch (5,3)] + [Field ("kCGColorSpaceExtendedLinearDisplayP3")] + NSString ExtendedLinearDisplayP3 { get; } + + [Mac (10,14, onlyOn64: true)][iOS (12,0)] + [TV (12,0)][Watch (5,0)] + [Field ("kCGColorSpaceITUR_2020_PQ_EOTF")] + NSString Itur_2020_PQ_Eotf { get; } + + [Mac (10,14,6, onlyOn64: true)][iOS (13,0)] + [TV (13,0)][Watch (6,0)] + [Field ("kCGColorSpaceDisplayP3_PQ_EOTF")] + NSString DisplayP3_PQ_Eotf { get; } + + [Mac (10,14,6, onlyOn64: true)][iOS (13,0)] + [TV (13,0)][Watch (6,0)] + [Field ("kCGColorSpaceDisplayP3_HLG")] + NSString DisplayP3_Hlg { get; } + + [Mac (10,14,6, onlyOn64: true)][iOS (13,0)] + [TV (13,0)][Watch (6,0)] + [Field ("kCGColorSpaceITUR_2020_HLG")] + NSString Itur_2020_Hlg { get; } } [Partial] @@ -257,4 +287,37 @@ namespace CoreGraphics { CGRect DestinationRect { get; set; } #endif } + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + [Static] + [Internal] + interface CGPdfTagPropertyKeys { + [Field ("kCGPDFTagPropertyActualText")] + NSString ActualTextKey { get; } + + [Field ("kCGPDFTagPropertyAlternativeText")] + NSString AlternativeTextKey { get; } + + [Field ("kCGPDFTagPropertyTitleText")] + NSString TitleTextKey { get; } + + [Field ("kCGPDFTagPropertyLanguageText")] + NSString LanguageTextKey { get; } + } + + [Mac (10,15, onlyOn64: true)] + [iOS (13,0)] + [TV (13,0)] + [Watch (6,0)] + [StrongDictionary ("CGPdfTagPropertyKeys")] + interface CGPdfTagProperties { + // The following CGPDFTagProperty keys are to be paired with CFStringRef values + string ActualText { get; set; } + string AlternativeText { get; set; } + string TitleText { get; set; } + string LanguageText { get; set; } + } } diff --git a/tests/monotouch-test/CoreGraphics/ColorConversionInfoTest.cs b/tests/monotouch-test/CoreGraphics/ColorConversionInfoTest.cs index bd29ac443b..cdf8d6f6f0 100644 --- a/tests/monotouch-test/CoreGraphics/ColorConversionInfoTest.cs +++ b/tests/monotouch-test/CoreGraphics/ColorConversionInfoTest.cs @@ -153,6 +153,40 @@ namespace MonoTouchFixtures.CoreGraphics { Assert.Throws (() => new CGColorConversionInfo (from, to)); } } + + [Test] + public void CGColorSpace_CGColorSpace_NSDictionary () + { + TestRuntime.AssertXcodeVersion (11, 0); + using (var from = CGColorSpace.CreateGenericGray ()) + using (var to = CGColorSpace.CreateGenericRgb ()) { + using (var converter = new CGColorConversionInfo (from, to, (NSDictionary)null)) { + Assert.That (converter.Handle, Is.Not.EqualTo (IntPtr.Zero), "Handle - null"); + } + using (var d = new NSDictionary ()) + using (var converter = new CGColorConversionInfo (from, to, d)) { + Assert.That (converter.Handle, Is.Not.EqualTo (IntPtr.Zero), "Handle"); + } + } + } + + [Test] + public void CGColorSpace_CGColorSpace_CGColorConversionOptions () + { + TestRuntime.AssertXcodeVersion (11, 0); + using (var from = CGColorSpace.CreateGenericGray ()) + using (var to = CGColorSpace.CreateGenericRgb ()) { + using (var converter = new CGColorConversionInfo (from, to, (CGColorConversionOptions)null)) { + Assert.That (converter.Handle, Is.Not.EqualTo (IntPtr.Zero), "Handle-null"); + } + + var o = new CGColorConversionOptions (); + o.BlackPointCompensation = true; + using (var converter = new CGColorConversionInfo (from, to, o)) { + Assert.That (converter.Handle, Is.Not.EqualTo (IntPtr.Zero), "Handle"); + } + } + } } } diff --git a/tests/monotouch-test/CoreGraphics/ColorSpaceTest.cs b/tests/monotouch-test/CoreGraphics/ColorSpaceTest.cs index c075475eb0..9cea1d0787 100644 --- a/tests/monotouch-test/CoreGraphics/ColorSpaceTest.cs +++ b/tests/monotouch-test/CoreGraphics/ColorSpaceTest.cs @@ -398,5 +398,15 @@ namespace MonoTouchFixtures.CoreGraphics { Assert.IsNotNull (space, "all null"); } } + + [Test] + public void IsHdr () + { + TestRuntime.AssertXcodeVersion (11, 0); + using (var cs = CGColorSpace.CreateWithName (CGColorSpaceNames.GenericRgb)) + Assert.False (cs.IsHdr, "GenericRgb"); + using (var cs = CGColorSpace.CreateWithName (CGColorSpaceNames.DisplayP3_Hlg)) + Assert.True (cs.IsHdr, "DisplayP3_Hlg"); + } } } diff --git a/tests/monotouch-test/CoreGraphics/ColorTest.cs b/tests/monotouch-test/CoreGraphics/ColorTest.cs index 277601d2ac..28f36a221c 100644 --- a/tests/monotouch-test/CoreGraphics/ColorTest.cs +++ b/tests/monotouch-test/CoreGraphics/ColorTest.cs @@ -86,6 +86,27 @@ namespace MonoTouchFixtures.CoreGraphics { } } #endif + [Test] + public void CreateSrgb () + { + TestRuntime.AssertXcodeVersion (11, 0); + using (var c = CGColor.CreateSrgb (0.1f, 0.2f, 0.3f, 0.4f)) { + Assert.That (c.NumberOfComponents, Is.EqualTo (4), "NumberOfComponents"); + Assert.That (c.Alpha, Is.InRange (0.4f, 0.40001f), "Alpha"); + Assert.That (c.ColorSpace.Model, Is.EqualTo (CGColorSpaceModel.RGB), "CGColorSpaceModel"); + } + } + + [Test] + public void CreateGenericGrayGamma2_2 () + { + TestRuntime.AssertXcodeVersion (11, 0); + using (var c = CGColor.CreateGenericGrayGamma2_2 (0.1f, 0.2f)) { + Assert.That (c.NumberOfComponents, Is.EqualTo (2), "NumberOfComponents"); + Assert.That (c.Alpha, Is.InRange (0.2f, 0.20001f), "Alpha"); + Assert.That (c.ColorSpace.Model, Is.EqualTo (CGColorSpaceModel.Monochrome), "CGColorSpaceModel"); + } + } } } diff --git a/tests/monotouch-test/CoreGraphics/PDFContextTest.cs b/tests/monotouch-test/CoreGraphics/PDFContextTest.cs index 84cf0eb68a..ee75c7929b 100644 --- a/tests/monotouch-test/CoreGraphics/PDFContextTest.cs +++ b/tests/monotouch-test/CoreGraphics/PDFContextTest.cs @@ -100,5 +100,44 @@ namespace MonoTouchFixtures.CoreGraphics { Assert.Throws (() => new CGContextPDF ((NSUrl) null, null), "null NSUrl, null"); } + + [Test] + public void Context_Tag () + { + TestRuntime.AssertXcodeVersion (11, 0); + using (var d = new NSDictionary ()) + using (var url = new NSUrl (filename)) + using (var ctx = new CGContextPDF (url)) { + ctx.BeginPage (PDFInfoTest.GetInfo ()); + ctx.BeginTag (CGPdfTagType.Header, (NSDictionary) null); + ctx.EndTag (); + ctx.BeginTag (CGPdfTagType.Caption, d); + ctx.SetUrl (url, RectangleF.Empty); + ctx.EndTag (); + ctx.EndPage (); + } + } + + [Test] + public void Context_Tag_Strong () + { + TestRuntime.AssertXcodeVersion (11, 0); + using (var url = new NSUrl (filename)) + using (var ctx = new CGContextPDF (url)) { + var tp = new CGPdfTagProperties () { + ActualText = "ActualText", + AlternativeText = "AlternativeText", + TitleText = "TitleText", + LanguageText = "LanguageText", + }; + ctx.BeginPage (PDFInfoTest.GetInfo ()); + ctx.BeginTag (CGPdfTagType.Header, tp); + ctx.EndTag (); + ctx.BeginTag (CGPdfTagType.Caption, (CGPdfTagProperties) null); + ctx.SetUrl (url, RectangleF.Empty); + ctx.EndTag (); + ctx.EndPage (); + } + } } } diff --git a/tests/monotouch-test/CoreGraphics/PdfTagTypeTest.cs b/tests/monotouch-test/CoreGraphics/PdfTagTypeTest.cs new file mode 100644 index 0000000000..5f7d4f4db4 --- /dev/null +++ b/tests/monotouch-test/CoreGraphics/PdfTagTypeTest.cs @@ -0,0 +1,72 @@ +using CoreGraphics; +using Foundation; +using ObjCRuntime; +using NUnit.Framework; + +namespace MonoTouchFixtures.CoreGraphics { + + [TestFixture] + [Preserve (AllMembers = true)] + public class PdfTagTypeTest { + + [Test] + public void EnumExtension () + { + TestRuntime.AssertXcodeVersion (11, 0); + Assert.That (CGPdfTagType.Document.GetName (), Is.EqualTo ("/Document"), "Document"); + Assert.That (CGPdfTagType.Part.GetName (), Is.EqualTo ("/Part"), "Part"); + Assert.That (CGPdfTagType.Art.GetName (), Is.EqualTo ("/Art"), "Art"); + Assert.That (CGPdfTagType.Section.GetName (), Is.EqualTo ("/Sect"), "Section"); + Assert.That (CGPdfTagType.Div.GetName (), Is.EqualTo ("/Div"), "Div"); + Assert.That (CGPdfTagType.BlockQuote.GetName (), Is.EqualTo ("/BlockQuote"), "BlockQuote"); + Assert.That (CGPdfTagType.Caption.GetName (), Is.EqualTo ("/Caption"), "Caption"); + Assert.That (CGPdfTagType.Toc.GetName (), Is.EqualTo ("/TOC"), "Toc"); + Assert.That (CGPdfTagType.Toci.GetName (), Is.EqualTo ("/TOCI"), "Toci"); + Assert.That (CGPdfTagType.Index.GetName (), Is.EqualTo ("/Index"), "Index"); + Assert.That (CGPdfTagType.NonStructure.GetName (), Is.EqualTo ("/NonStruct"), "NonStructure"); + Assert.That (CGPdfTagType.Private.GetName (), Is.EqualTo ("/Private"), "Private"); + + Assert.That (CGPdfTagType.Paragraph.GetName (), Is.EqualTo ("/P"), "Paragraph"); + Assert.That (CGPdfTagType.Header.GetName (), Is.EqualTo ("/H"), "Header"); + Assert.That (CGPdfTagType.Header1.GetName (), Is.EqualTo ("/H1"), "Header1"); + Assert.That (CGPdfTagType.Header2.GetName (), Is.EqualTo ("/H2"), "Header2"); + Assert.That (CGPdfTagType.Header3.GetName (), Is.EqualTo ("/H3"), "Header3"); + Assert.That (CGPdfTagType.Header4.GetName (), Is.EqualTo ("/H4"), "Header4"); + Assert.That (CGPdfTagType.Header5.GetName (), Is.EqualTo ("/H5"), "Header5"); + Assert.That (CGPdfTagType.Header6.GetName (), Is.EqualTo ("/H6"), "Header6"); + + Assert.That (CGPdfTagType.List.GetName (), Is.EqualTo ("/L"), "List"); + Assert.That (CGPdfTagType.ListItem.GetName (), Is.EqualTo ("/LI"), "ListItem"); + Assert.That (CGPdfTagType.Label.GetName (), Is.EqualTo ("/Lbl"), "Label"); + Assert.That (CGPdfTagType.ListBody.GetName (), Is.EqualTo ("/LBody"), "ListBody"); + + Assert.That (CGPdfTagType.Table.GetName (), Is.EqualTo ("/Table"), "Table"); + Assert.That (CGPdfTagType.TableRow.GetName (), Is.EqualTo ("/TR"), "TableRow"); + Assert.That (CGPdfTagType.TableHeaderCell.GetName (), Is.EqualTo ("/TH"), "TableHeaderCell"); + Assert.That (CGPdfTagType.TableDataCell.GetName (), Is.EqualTo ("/TD"), "TableDataCell"); + Assert.That (CGPdfTagType.TableHeader.GetName (), Is.EqualTo ("/THead"), "TableHeader"); + Assert.That (CGPdfTagType.TableBody.GetName (), Is.EqualTo ("/TBody"), "TableBody"); + Assert.That (CGPdfTagType.TableFooter.GetName (), Is.EqualTo ("/TFoot"), "TableFooter"); + + Assert.That (CGPdfTagType.Span.GetName (), Is.EqualTo ("/Span"), "Span"); + Assert.That (CGPdfTagType.Quote.GetName (), Is.EqualTo ("/Quote"), "Quote"); + Assert.That (CGPdfTagType.Note.GetName (), Is.EqualTo ("/Note"), "Note"); + Assert.That (CGPdfTagType.Reference.GetName (), Is.EqualTo ("/Reference"), "Reference"); + Assert.That (CGPdfTagType.Bibliography.GetName (), Is.EqualTo ("/BibEntry"), "Bibliography"); + Assert.That (CGPdfTagType.Code.GetName (), Is.EqualTo ("/Code"), "Code"); + Assert.That (CGPdfTagType.Link.GetName (), Is.EqualTo ("/Link"), "Link"); + Assert.That (CGPdfTagType.Annotation.GetName (), Is.EqualTo ("/Annot"), "Annotation"); + + Assert.That (CGPdfTagType.Ruby.GetName (), Is.EqualTo ("/Ruby"), "Ruby"); + Assert.That (CGPdfTagType.RubyBaseText.GetName (), Is.EqualTo ("/RB"), "RubyBaseText"); + Assert.That (CGPdfTagType.RubyAnnotationText.GetName (), Is.EqualTo ("/RT"), "RubyAnnotationText"); + Assert.That (CGPdfTagType.RubyPunctuation.GetName (), Is.EqualTo ("/RP"), "RubyPunctuation"); + Assert.That (CGPdfTagType.Warichu.GetName (), Is.EqualTo ("/Warichu"), "Warichu"); + Assert.That (CGPdfTagType.WarichuText.GetName (), Is.EqualTo ("/WT"), "WarichuText"); + Assert.That (CGPdfTagType.WarichuPunctiation.GetName (), Is.EqualTo ("/WP"), "WarichuPunctiation"); + Assert.That (CGPdfTagType.Figure.GetName (), Is.EqualTo ("/Figure"), "Figure"); + Assert.That (CGPdfTagType.Formula.GetName (), Is.EqualTo ("/Formula"), "Formula"); + Assert.That (CGPdfTagType.Form.GetName (), Is.EqualTo ("/Form"), "Form"); + } + } +} diff --git a/tests/xtro-sharpie/iOS-CoreGraphics.todo b/tests/xtro-sharpie/iOS-CoreGraphics.todo deleted file mode 100644 index dcfd53be77..0000000000 --- a/tests/xtro-sharpie/iOS-CoreGraphics.todo +++ /dev/null @@ -1,19 +0,0 @@ -!missing-enum! CGPDFTagType not bound -!missing-field! kCGColorSpaceExtendedLinearDisplayP3 not bound -!missing-field! kCGColorSpaceExtendedLinearITUR_2020 not bound -!missing-field! kCGColorSpaceITUR_2020_PQ_EOTF not bound -!missing-field! kCGPDFTagPropertyActualText not bound -!missing-field! kCGPDFTagPropertyAlternativeText not bound -!missing-field! kCGPDFTagPropertyLanguageText not bound -!missing-field! kCGPDFTagPropertyTitleText not bound -!missing-pinvoke! CGColorConversionInfoCreateWithOptions is not bound -!missing-pinvoke! CGColorCreateGenericGrayGamma2_2 is not bound -!missing-pinvoke! CGColorCreateSRGB is not bound -!missing-pinvoke! CGPDFContextBeginTag is not bound -!missing-pinvoke! CGPDFContextEndTag is not bound -!missing-pinvoke! CGPDFTagTypeGetName is not bound -## appended from unclassified file -!missing-field! kCGColorSpaceDisplayP3_HLG not bound -!missing-field! kCGColorSpaceDisplayP3_PQ_EOTF not bound -!missing-field! kCGColorSpaceITUR_2020_HLG not bound -!missing-pinvoke! CGColorSpaceIsHDR is not bound diff --git a/tests/xtro-sharpie/macOS-CoreGraphics.todo b/tests/xtro-sharpie/macOS-CoreGraphics.todo deleted file mode 100644 index dcfd53be77..0000000000 --- a/tests/xtro-sharpie/macOS-CoreGraphics.todo +++ /dev/null @@ -1,19 +0,0 @@ -!missing-enum! CGPDFTagType not bound -!missing-field! kCGColorSpaceExtendedLinearDisplayP3 not bound -!missing-field! kCGColorSpaceExtendedLinearITUR_2020 not bound -!missing-field! kCGColorSpaceITUR_2020_PQ_EOTF not bound -!missing-field! kCGPDFTagPropertyActualText not bound -!missing-field! kCGPDFTagPropertyAlternativeText not bound -!missing-field! kCGPDFTagPropertyLanguageText not bound -!missing-field! kCGPDFTagPropertyTitleText not bound -!missing-pinvoke! CGColorConversionInfoCreateWithOptions is not bound -!missing-pinvoke! CGColorCreateGenericGrayGamma2_2 is not bound -!missing-pinvoke! CGColorCreateSRGB is not bound -!missing-pinvoke! CGPDFContextBeginTag is not bound -!missing-pinvoke! CGPDFContextEndTag is not bound -!missing-pinvoke! CGPDFTagTypeGetName is not bound -## appended from unclassified file -!missing-field! kCGColorSpaceDisplayP3_HLG not bound -!missing-field! kCGColorSpaceDisplayP3_PQ_EOTF not bound -!missing-field! kCGColorSpaceITUR_2020_HLG not bound -!missing-pinvoke! CGColorSpaceIsHDR is not bound diff --git a/tests/xtro-sharpie/tvOS-CoreGraphics.todo b/tests/xtro-sharpie/tvOS-CoreGraphics.todo deleted file mode 100644 index dcfd53be77..0000000000 --- a/tests/xtro-sharpie/tvOS-CoreGraphics.todo +++ /dev/null @@ -1,19 +0,0 @@ -!missing-enum! CGPDFTagType not bound -!missing-field! kCGColorSpaceExtendedLinearDisplayP3 not bound -!missing-field! kCGColorSpaceExtendedLinearITUR_2020 not bound -!missing-field! kCGColorSpaceITUR_2020_PQ_EOTF not bound -!missing-field! kCGPDFTagPropertyActualText not bound -!missing-field! kCGPDFTagPropertyAlternativeText not bound -!missing-field! kCGPDFTagPropertyLanguageText not bound -!missing-field! kCGPDFTagPropertyTitleText not bound -!missing-pinvoke! CGColorConversionInfoCreateWithOptions is not bound -!missing-pinvoke! CGColorCreateGenericGrayGamma2_2 is not bound -!missing-pinvoke! CGColorCreateSRGB is not bound -!missing-pinvoke! CGPDFContextBeginTag is not bound -!missing-pinvoke! CGPDFContextEndTag is not bound -!missing-pinvoke! CGPDFTagTypeGetName is not bound -## appended from unclassified file -!missing-field! kCGColorSpaceDisplayP3_HLG not bound -!missing-field! kCGColorSpaceDisplayP3_PQ_EOTF not bound -!missing-field! kCGColorSpaceITUR_2020_HLG not bound -!missing-pinvoke! CGColorSpaceIsHDR is not bound diff --git a/tests/xtro-sharpie/watchOS-CoreGraphics.todo b/tests/xtro-sharpie/watchOS-CoreGraphics.todo deleted file mode 100644 index dcfd53be77..0000000000 --- a/tests/xtro-sharpie/watchOS-CoreGraphics.todo +++ /dev/null @@ -1,19 +0,0 @@ -!missing-enum! CGPDFTagType not bound -!missing-field! kCGColorSpaceExtendedLinearDisplayP3 not bound -!missing-field! kCGColorSpaceExtendedLinearITUR_2020 not bound -!missing-field! kCGColorSpaceITUR_2020_PQ_EOTF not bound -!missing-field! kCGPDFTagPropertyActualText not bound -!missing-field! kCGPDFTagPropertyAlternativeText not bound -!missing-field! kCGPDFTagPropertyLanguageText not bound -!missing-field! kCGPDFTagPropertyTitleText not bound -!missing-pinvoke! CGColorConversionInfoCreateWithOptions is not bound -!missing-pinvoke! CGColorCreateGenericGrayGamma2_2 is not bound -!missing-pinvoke! CGColorCreateSRGB is not bound -!missing-pinvoke! CGPDFContextBeginTag is not bound -!missing-pinvoke! CGPDFContextEndTag is not bound -!missing-pinvoke! CGPDFTagTypeGetName is not bound -## appended from unclassified file -!missing-field! kCGColorSpaceDisplayP3_HLG not bound -!missing-field! kCGColorSpaceDisplayP3_PQ_EOTF not bound -!missing-field! kCGColorSpaceITUR_2020_HLG not bound -!missing-pinvoke! CGColorSpaceIsHDR is not bound