]> O.S.I.I.S - jp/crow.git/commitdiff
wip, lots to do... vkvg_backend
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 19 Apr 2021 16:19:42 +0000 (18:19 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 19 Apr 2021 16:19:42 +0000 (18:19 +0200)
179 files changed:
Crow/Crow.csproj
Crow/src/Cairo/CairoHelpers.cs
Crow/src/ExtensionsMethods.cs
Crow/src/Fill/BmpPicture.cs
Crow/src/Fill/Fill.cs
Crow/src/Fill/Gradient.cs
Crow/src/Fill/Picture.cs
Crow/src/Fill/SolidColor.cs
Crow/src/Fill/SvgPicture.cs
Crow/src/Font.cs
Crow/src/GraphicBackends/Mono.Cairo/Antialias.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Cairo.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/CairoDebug.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Content.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Context.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/DRMDevice.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/DRMSurface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Device.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/DirectFBSurface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Distance.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/EGLDevice.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Extend.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/FillRule.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Filter.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/FontExtents.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/FontFace.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/FontOptions.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/FontSlant.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/FontType.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/FontWeight.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Format.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/GLSurface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/GLXDevice.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/GlitzSurface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Glyph.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Gradient.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/HintMetrics.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/HintStyle.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/ImageSurface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/LineCap.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/LineJoin.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/LinearGradient.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Matrix.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/MeshPattern.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/NativeMethods-internal.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/NativeMethods.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Operator.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/PSSurface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Path.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Pattern.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/PatternType.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/PdfSurface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/RadialGradient.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Region.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/ScaledFont.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/SolidPattern.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Status.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/SubpixelOrder.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Surface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/SurfacePattern.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/SurfaceType.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/SvgSurface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/SvgVersion.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/TextExtents.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/WGLDevice.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/Win32Surface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/XcbSurface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/Mono.Cairo/XlibSurface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/Context.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/Device.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/Enums.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/FontExtents.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/Matrix.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/NativeMethods.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/Pattern.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/Surface.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/TextExtents.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/TextRun.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/tmp/FontOptions.cs [new file with mode: 0644]
Crow/src/GraphicBackends/vkvg/tmp/Rectangles.cs [new file with mode: 0644]
Crow/src/Interface.cs
Crow/src/Mono.Cairo/Antialias.cs [deleted file]
Crow/src/Mono.Cairo/Cairo.cs [deleted file]
Crow/src/Mono.Cairo/CairoDebug.cs [deleted file]
Crow/src/Mono.Cairo/Content.cs [deleted file]
Crow/src/Mono.Cairo/Context.cs [deleted file]
Crow/src/Mono.Cairo/DRMDevice.cs [deleted file]
Crow/src/Mono.Cairo/DRMSurface.cs [deleted file]
Crow/src/Mono.Cairo/Device.cs [deleted file]
Crow/src/Mono.Cairo/DirectFBSurface.cs [deleted file]
Crow/src/Mono.Cairo/Distance.cs [deleted file]
Crow/src/Mono.Cairo/EGLDevice.cs [deleted file]
Crow/src/Mono.Cairo/Extend.cs [deleted file]
Crow/src/Mono.Cairo/FillRule.cs [deleted file]
Crow/src/Mono.Cairo/Filter.cs [deleted file]
Crow/src/Mono.Cairo/FontExtents.cs [deleted file]
Crow/src/Mono.Cairo/FontFace.cs [deleted file]
Crow/src/Mono.Cairo/FontOptions.cs [deleted file]
Crow/src/Mono.Cairo/FontSlant.cs [deleted file]
Crow/src/Mono.Cairo/FontType.cs [deleted file]
Crow/src/Mono.Cairo/FontWeight.cs [deleted file]
Crow/src/Mono.Cairo/Format.cs [deleted file]
Crow/src/Mono.Cairo/GLSurface.cs [deleted file]
Crow/src/Mono.Cairo/GLXDevice.cs [deleted file]
Crow/src/Mono.Cairo/GlitzSurface.cs [deleted file]
Crow/src/Mono.Cairo/Glyph.cs [deleted file]
Crow/src/Mono.Cairo/Gradient.cs [deleted file]
Crow/src/Mono.Cairo/HintMetrics.cs [deleted file]
Crow/src/Mono.Cairo/HintStyle.cs [deleted file]
Crow/src/Mono.Cairo/ImageSurface.cs [deleted file]
Crow/src/Mono.Cairo/LineCap.cs [deleted file]
Crow/src/Mono.Cairo/LineJoin.cs [deleted file]
Crow/src/Mono.Cairo/LinearGradient.cs [deleted file]
Crow/src/Mono.Cairo/Matrix.cs [deleted file]
Crow/src/Mono.Cairo/MeshPattern.cs [deleted file]
Crow/src/Mono.Cairo/NativeMethods-internal.cs [deleted file]
Crow/src/Mono.Cairo/NativeMethods.cs [deleted file]
Crow/src/Mono.Cairo/Operator.cs [deleted file]
Crow/src/Mono.Cairo/PSSurface.cs [deleted file]
Crow/src/Mono.Cairo/Path.cs [deleted file]
Crow/src/Mono.Cairo/Pattern.cs [deleted file]
Crow/src/Mono.Cairo/PatternType.cs [deleted file]
Crow/src/Mono.Cairo/PdfSurface.cs [deleted file]
Crow/src/Mono.Cairo/RadialGradient.cs [deleted file]
Crow/src/Mono.Cairo/Region.cs [deleted file]
Crow/src/Mono.Cairo/ScaledFont.cs [deleted file]
Crow/src/Mono.Cairo/SolidPattern.cs [deleted file]
Crow/src/Mono.Cairo/Status.cs [deleted file]
Crow/src/Mono.Cairo/SubpixelOrder.cs [deleted file]
Crow/src/Mono.Cairo/Surface.cs [deleted file]
Crow/src/Mono.Cairo/SurfacePattern.cs [deleted file]
Crow/src/Mono.Cairo/SurfaceType.cs [deleted file]
Crow/src/Mono.Cairo/SvgSurface.cs [deleted file]
Crow/src/Mono.Cairo/SvgVersion.cs [deleted file]
Crow/src/Mono.Cairo/TextExtents.cs [deleted file]
Crow/src/Mono.Cairo/WGLDevice.cs [deleted file]
Crow/src/Mono.Cairo/Win32Surface.cs [deleted file]
Crow/src/Mono.Cairo/XcbSurface.cs [deleted file]
Crow/src/Mono.Cairo/XlibSurface.cs [deleted file]
Crow/src/Text/IEditableTextWidget.cs
Crow/src/Widgets/Border.cs
Crow/src/Widgets/ColorSlider.cs
Crow/src/Widgets/DockWindow.cs
Crow/src/Widgets/Gauge.cs
Crow/src/Widgets/GraduatedSlider.cs
Crow/src/Widgets/Group.cs
Crow/src/Widgets/GroupBase.cs
Crow/src/Widgets/HueSelector.cs
Crow/src/Widgets/Image.cs
Crow/src/Widgets/Label.cs
Crow/src/Widgets/OldLabel.cs
Crow/src/Widgets/OldTextBox.cs
Crow/src/Widgets/PrivateContainer.cs
Crow/src/Widgets/ProgressBar.cs
Crow/src/Widgets/SaturationValueSelector.cs
Crow/src/Widgets/Scroller.cs
Crow/src/Widgets/Shape.cs
Crow/src/Widgets/Slider.cs
Crow/src/Widgets/TabView.cs
Crow/src/Widgets/Table copy.cs
Crow/src/Widgets/Table.cs
Crow/src/Widgets/TableRow copy.cs
Crow/src/Widgets/TableRow.cs
Crow/src/Widgets/TemplatedControl.cs
Crow/src/Widgets/TemplatedGroup.cs
Crow/src/Widgets/TestCairoPatch.cs
Crow/src/Widgets/TextBox.cs
Crow/src/Widgets/TextRun.cs
Crow/src/Widgets/Trend.cs
Crow/src/Widgets/Widget.cs
Crow/src/rsvg/Handle.cs
Directory.Build.props
Samples/DebugLogAnalyzer/src/DbgEventWidget.cs
Samples/DebugLogAnalyzer/src/DbgLogViewer.cs
Samples/DebugLogAnalyzer/src/DebugInterface.cs
Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs
Samples/PathPainter/Painter.cs
Samples/common/Editor.cs
Samples/dragNdrop/dragNdrop.cs

index 083b19892f7a5ef5571c7f309bd1ddefe547af99..4c40be8137cf75857088a97fc220e8aa568cfec5 100644 (file)
                <PackageReference Include="glfw-sharp" Version="$(GlfwSharpVersion)" />
        </ItemGroup>
 
-       <PropertyGroup Condition=" '$(CrowVkvgBackend)' == 'true'">
-               <DefineConstants>$(DefineConstants);VKVG</DefineConstants>
-       </PropertyGroup>
-       <ItemGroup Condition=" '$(CrowVkvgBackend)' == 'true'">
-               <PackageReference Include="vkvg.net" Version="0.2.2-beta" />
-       </ItemGroup>
-
        <PropertyGroup Condition=" '$(CrowStbSharp)' == 'true'">
                <DefineConstants>$(DefineConstants);STB_SHARP</DefineConstants>
        </PropertyGroup>
                <ProjectReference Include="..\CrowDbgShared\CrowDbgShared.csproj" />
        </ItemGroup>
 
+       <PropertyGroup Condition=" '$(CrowVkvgBackend)' == 'true'">
+               <DefineConstants>$(DefineConstants);VKVG</DefineConstants>
+       </PropertyGroup>
+       <ItemGroup Condition=" '$(CrowVkvgBackend)' == 'true'">
+               <Compile Include="src\GraphicBackends\vkvg\**\*.*" />
+       </ItemGroup>
+
+       <ItemGroup Condition=" '$(CrowVkvgBackend)' != 'true'">
+               <Compile Include="src\GraphicBackends\Mono.Cairo\**\*.*"
+                       Exclude="src\GraphicBackends\Mono.Cairo\NativeMethods-internal.cs" />
+       </ItemGroup>
+
        <ItemGroup>
                <Content Include="..\Images\crow.png" Pack="true" PackagePath="" />
-               <Compile Include="src\**\*.cs" Exclude="src\Mono.Cairo\NativeMethods-internal.cs" />
+               <Compile Include="src\**\*.cs" Exclude="src\GraphicBackends\**\*.*" />
                <EmbeddedResource Include="Templates\*.*">
                        <LogicalName>Crow.%(Filename).template</LogicalName>
                </EmbeddedResource>
index a2e036ac385e61ac9330db6b9f5f1c6c9d65f95b..129879a14b47b570f53cf603c643929ddcc9321e 100644 (file)
@@ -1,38 +1,22 @@
-//
-// CairoHelpers.cs
+// Copyright (c) 2013-2021  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
 //
-// Author:
-//       Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 
+#if VKVG
+using vkvg;
+#else
+using Crow.Cairo;
+#endif
+
 namespace Crow
 {
     public static class CairoHelpers
-    {
+    {          
                public static T Clamp<T>(this T val, T min, T max) where T : IComparable<T>
                {
                    if (val.CompareTo(min) < 0) return min;
@@ -57,18 +41,18 @@ namespace Crow
 
             return arr[minp];
         }
-               public static void CairoRectangle(Cairo.Context gr, RectangleD r, double radius, double stroke = 0.0)
+               public static void CairoRectangle(Context gr, RectangleD r, double radius, double stroke = 0.0)
                {
                        if (radius > 0)
                                DrawRoundedRectangle (gr, r, radius, stroke);
                        else
                                gr.Rectangle (r, stroke);
                }
-               public static void CairoCircle(Cairo.Context gr, RectangleD r)
+               public static void CairoCircle(Context gr, RectangleD r)
                {
                        gr.Arc(r.X + r.Width/2.0, r.Y + r.Height/2.0, Math.Min(r.Width,r.Height)/2.0, 0, 2.0*Math.PI);
                }
-               public static void DrawRoundedRectangle(Cairo.Context gr, RectangleD r, double radius, double stroke = 0.0)
+               public static void DrawRoundedRectangle(Context gr, RectangleD r, double radius, double stroke = 0.0)
         {
                        if (stroke>0.0) {
                                gr.LineWidth = stroke;
@@ -78,7 +62,7 @@ namespace Crow
                        }else
                                DrawRoundedRectangle(gr, r.X, r.Y, r.Width, r.Height, radius);
         }
-        public static void DrawRoundedRectangle(Cairo.Context gr, double x, double y, double width, double height, double radius)
+        public static void DrawRoundedRectangle(Context gr, double x, double y, double width, double height, double radius)
         {
             gr.Save();
 
@@ -96,7 +80,7 @@ namespace Crow
             gr.ClosePath();
             gr.Restore();
         }
-        public static void StrokeRaisedRectangle(Cairo.Context gr, Rectangle r, double width = 1)
+        public static void StrokeRaisedRectangle(Context gr, Rectangle r, double width = 1)
         {
             gr.Save();
             r.Inflate((int)-width / 2, (int)-width / 2);
@@ -115,7 +99,7 @@ namespace Crow
 
             gr.Restore();
         }
-        public static void StrokeLoweredRectangle(Cairo.Context gr, Rectangle r, double width = 1)
+        public static void StrokeLoweredRectangle(Context gr, Rectangle r, double width = 1)
         {
             gr.Save();
             r.Inflate((int)-width / 2, (int)-width / 2);
index f8aefaf1d026b0b637ac290072c6b58a7fa96aad..d7ebb3f24067b65bf32c98d9321a2e19e7343437 100644 (file)
@@ -8,13 +8,19 @@ using System.IO;
 using System.Linq;
 using System.Linq.Expressions;
 
+#if VKVG
+using vkvg;
+#else
+using Crow.Cairo;
+#endif
+
 namespace Crow
 {
        public static class ExtensionsMethods
        {
                #region Cairo extensions
 
-               public static void Rectangle(this Cairo.Context ctx, Rectangle r, double stroke = 0.0)
+               public static void Rectangle(this Context ctx, Rectangle r, double stroke = 0.0)
                {
                        if (stroke > 0.0) {
                                ctx.LineWidth = stroke;
@@ -48,7 +54,7 @@ namespace Crow
                public static PointD Multiply(this PointD p1, double v){
                        return new PointD(p1.X * v, p1.Y * v);
                }
-               public static void DrawCote(this Cairo.Context ctx, PointD p1, PointD p2,
+               public static void DrawCote(this Context ctx, PointD p1, PointD p2,
                        double stroke = 1.0, bool fill = false, double arrowWidth = 3.0, double arrowLength = 7.0)
                {                       
                        PointD vDir = p2.Substract(p1);
@@ -85,7 +91,7 @@ namespace Crow
                        ctx.LineWidth = stroke;
                        ctx.Stroke ();
                }
-               public static void DrawCoteInverse(this Cairo.Context ctx, PointD p1, PointD p2,
+               public static void DrawCoteInverse(this Context ctx, PointD p1, PointD p2,
                        double stroke = 1.0, bool fill = false, double arrowWidth = 3.0, double arrowLength = 7.0)
                {                       
                        PointD vDir = p2.Substract(p1);
@@ -117,7 +123,7 @@ namespace Crow
                        ctx.LineWidth = stroke;
                        ctx.Stroke ();
                }
-               public static void DrawCoteFixed(this Cairo.Context ctx, PointD p1, PointD p2,
+               public static void DrawCoteFixed(this Context ctx, PointD p1, PointD p2,
                        double stroke = 1.0, double coteWidth = 3.0)
                {                       
                        PointD vDir = p2.Substract(p1);
@@ -135,7 +141,7 @@ namespace Crow
                        ctx.Stroke ();
                }
 
-               public static void AddColorStop(this Cairo.Gradient grad, double offset, Color c)
+               public static void AddColorStop(this Gradient grad, double offset, Color c)
                {
                        grad.AddColorStop (offset, c);
                }
index 0f67323d2810f1dd4fbe8916ba8d1501d3595607..e8df72693fb646327e0c25ea79582078f11b8f46 100644 (file)
@@ -5,7 +5,11 @@
 using System;
 using System.IO;
 using System.Runtime.InteropServices;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index a11b666e60e4c336ef5db459711159be8867a087..d9f3c69a280ff6887a1a3678e344f6b0ae3f0dc5 100644 (file)
@@ -3,7 +3,11 @@
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index ac6a638ef27aa64b4977ce63542f65e5a736bfe7..680e1d0fdc46e8cd916c73e62373203c26912af5 100644 (file)
 
 using System;
 using System.Collections.Generic;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index c9b234041d6c4092c18849d9d7f7ff3c2765d1b3..8c885bc87f37203e2d08239eb90cf8608bc1e8d0 100644 (file)
 
 using System;
 using System.IO;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.Collections.Generic;
 
 namespace Crow
index 8ed77fbeeda4df37b9818f514e6372aef8a6720a..1c183d97f9f55861401119d84693db2b27a83e7d 100644 (file)
@@ -9,7 +9,11 @@ using System.Text;
 using System.Xml.Serialization;
 using System.Reflection;
 using System.Diagnostics;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 
 
index fcd5c4d25c19e1f5c60b32c53d4236ae414eb2d4..6ce111490180829098b2a90798b67679c31f0991 100644 (file)
@@ -4,7 +4,11 @@
 
 using System;
 using System.IO;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index f05c6fb1e08d7659e31c7039870916b2494393fe..9ad794502a209e1276bd81a4f4106351e1eb7500 100644 (file)
@@ -3,7 +3,11 @@
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using FastEnumUtility;
 
 namespace Crow
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Antialias.cs b/Crow/src/GraphicBackends/Mono.Cairo/Antialias.cs
new file mode 100644 (file)
index 0000000..64da644
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// Mono.Cairo.Antialias.cs
+//
+// Authors:
+//   Duncan Mak (duncan@ximian.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum Antialias
+       {
+               Default,
+               None,
+               Grey,
+               Subpixel,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Cairo.cs b/Crow/src/GraphicBackends/Mono.Cairo/Cairo.cs
new file mode 100644 (file)
index 0000000..c32c00d
--- /dev/null
@@ -0,0 +1,53 @@
+//
+// Cairo.cs - a simplistic binding of the Cairo API to C#.
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//          John Luke (john.luke@gmail.com)
+//          Alp Toker (alp@atoker.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005 John Luke
+// Copyright (C) 2006 Alp Toker
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Crow.Cairo
+{
+       public static class CairoAPI {
+               static public int Version {
+                       get {
+                               return Cairo.NativeMethods.cairo_version ();
+                       }
+               }
+
+               static public string VersionString {
+                       get {
+                               IntPtr x = Cairo.NativeMethods.cairo_version_string ();
+                               return Marshal.PtrToStringAnsi (x);
+                       }
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/CairoDebug.cs b/Crow/src/GraphicBackends/Mono.Cairo/CairoDebug.cs
new file mode 100644 (file)
index 0000000..a669d84
--- /dev/null
@@ -0,0 +1,82 @@
+//
+// CairoDebug.cs
+//
+// Author:
+//   Michael Hutchinson (mhutch@xamarin.com)
+//
+// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       static class CairoDebug
+       {
+               static System.Collections.Generic.Dictionary<IntPtr,string> traces;
+
+               public static readonly bool Enabled;
+
+               static CairoDebug ()
+               {
+                       var dbg = Environment.GetEnvironmentVariable ("MONO_CAIRO_DEBUG_DISPOSE");
+                       if (dbg == null)
+                               return;
+                       Enabled = true;
+                       traces = new System.Collections.Generic.Dictionary<IntPtr,string> ();
+               }
+
+               public static void OnAllocated (IntPtr obj)
+               {
+                       if (!Enabled)
+                               throw new InvalidOperationException ();
+
+                       traces[obj] = Environment.StackTrace;
+               }
+
+               public static void OnDisposed<T> (IntPtr obj, bool disposing)
+               {
+                       if (disposing && !Enabled)
+                               throw new InvalidOperationException ();
+
+                       if (Environment.HasShutdownStarted)
+                               return;
+
+                       if (!disposing) {
+                               System.Diagnostics.Debug.WriteLine ("{0} is leaking, programmer is missing a call to Dispose", typeof(T).FullName);
+                               if (Enabled) {
+                                       string val;
+                                       if (traces.TryGetValue (obj, out val)) {
+                                               System.Diagnostics.Debug.WriteLine ("Allocated from:");
+                                               System.Diagnostics.Debug.WriteLine (val);
+                                       }
+                               } else {
+                                       System.Diagnostics.Debug.WriteLine ("Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces");
+                               }
+                       }
+
+                       if (Enabled)
+                               traces.Remove (obj);
+               }
+       }
+
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Content.cs b/Crow/src/GraphicBackends/Mono.Cairo/Content.cs
new file mode 100644 (file)
index 0000000..f14305a
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// Mono.Cairo.Content.cs
+//
+// Authors:
+//   Duncan Mak (duncan@ximian.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       //[Flags]
+       
+       public enum Content
+       {
+               Color = 0x1000,
+               Alpha = 0x2000,
+               ColorAlpha = 0x3000,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Context.cs b/Crow/src/GraphicBackends/Mono.Cairo/Context.cs
new file mode 100644 (file)
index 0000000..5cd60dc
--- /dev/null
@@ -0,0 +1,924 @@
+//
+// Mono.Cairo.Context.cs
+//
+// Author:
+//   Duncan Mak (duncan@ximian.com)
+//   Miguel de Icaza (miguel@novell.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//   Alp Toker (alp@atoker.com)
+//
+// (C) Ximian Inc, 2003.
+// (C) Novell Inc, 2003.
+//
+// This is an OO wrapper API for the Cairo API.
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace Crow.Cairo { 
+
+       [Obsolete ("Renamed Cairo.Context per suggestion from cairo binding guidelines.")]
+       public class Graphics : Context {
+               public Graphics (IntPtr state) : base (state) {}
+               public Graphics (Surface surface) : base (surface) {}
+       }
+
+       public class Context : IDisposable
+       {
+               IntPtr handle = IntPtr.Zero;
+
+               static int native_glyph_size, c_compiler_long_size;
+
+               static Context ()
+               {
+                       //
+                       // This is used to determine what kind of structure
+                       // we should use to marshal Glyphs, as the public
+                       // definition in Cairo uses `long', which can be
+                       // 32 bits or 64 bits depending on the platform.
+                       //
+                       // We assume that sizeof(long) == sizeof(void*)
+                       // except in the case of Win64 where sizeof(long)
+                       // is 32 bits
+                       //
+                       int ptr_size = Marshal.SizeOf (typeof (IntPtr));
+
+                       PlatformID platform = Environment.OSVersion.Platform;
+                       if (platform == PlatformID.Win32NT ||
+                           platform == PlatformID.Win32S ||
+                           platform == PlatformID.Win32Windows ||
+                           platform == PlatformID.WinCE ||
+                           ptr_size == 4){
+                               c_compiler_long_size = 4;
+                               native_glyph_size = Marshal.SizeOf (typeof (NativeGlyph_4byte_longs));
+                       } else {
+                               c_compiler_long_size = 8;
+                               native_glyph_size = Marshal.SizeOf (typeof (Glyph));
+                       }
+               }
+
+               public Context (Surface surface) : this (NativeMethods.cairo_create (surface.Handle), true)
+               {
+               }
+
+
+               public Context (IntPtr handle, bool owner)
+               {
+                       this.handle = handle;
+                       if (!owner)
+                               NativeMethods.cairo_reference (handle);
+                       if (CairoDebug.Enabled)
+                               CairoDebug.OnAllocated (handle);
+               }
+
+               [Obsolete]
+               public Context (IntPtr state) : this (state, true)
+               {
+               }
+
+               ~Context ()
+               {
+                       Dispose (false);
+               }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || CairoDebug.Enabled)
+                               CairoDebug.OnDisposed<Context> (handle, disposing);
+
+                       if (!disposing|| handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.cairo_destroy (handle);
+                       handle = IntPtr.Zero;
+
+               }
+
+               public void Save ()
+               {
+                       NativeMethods.cairo_save (handle);
+               }
+
+               public void Restore ()
+               {
+                       NativeMethods.cairo_restore (handle);
+               }
+
+               public Antialias Antialias {
+                       get { return NativeMethods.cairo_get_antialias (handle); }
+                       set { NativeMethods.cairo_set_antialias (handle, value); }
+               }
+
+               public Cairo.Status Status {
+                       get {
+                               return NativeMethods.cairo_status (handle);
+                       }
+               }
+
+               public IntPtr Handle {
+                       get {
+                               return handle;
+                       }
+               }
+
+               public Operator Operator {
+                       set {
+                               NativeMethods.cairo_set_operator (handle, value);
+                       }
+
+                       get {
+                               return NativeMethods.cairo_get_operator (handle);
+                       }
+               }
+
+               public double Tolerance {
+                       get {
+                               return NativeMethods.cairo_get_tolerance (handle);
+                       }
+
+                       set {
+                               NativeMethods.cairo_set_tolerance (handle, value);
+                       }
+               }
+
+               public Cairo.FillRule FillRule {
+                       set {
+                               NativeMethods.cairo_set_fill_rule (handle, value);
+                       }
+
+                       get {
+                               return NativeMethods.cairo_get_fill_rule (handle);
+                       }
+               }
+
+               public double LineWidth {
+                       set {
+                               NativeMethods.cairo_set_line_width (handle, value);
+                       }
+
+                       get {
+                               return NativeMethods.cairo_get_line_width (handle);
+                       }
+               }
+
+               public Cairo.LineCap LineCap {
+                       set {
+                               NativeMethods.cairo_set_line_cap (handle, value);
+                       }
+
+                       get {
+                               return NativeMethods.cairo_get_line_cap (handle);
+                       }
+               }
+
+               public Cairo.LineJoin LineJoin {
+                       set {
+                               NativeMethods.cairo_set_line_join (handle, value);
+                       }
+
+                       get {
+                               return NativeMethods.cairo_get_line_join (handle);
+                       }
+               }
+
+               public void SetDash (double [] dashes, double offset)
+               {
+                       NativeMethods.cairo_set_dash (handle, dashes, dashes.Length, offset);
+               }
+
+               [Obsolete("Use GetSource/SetSource")]
+               public Pattern Pattern {
+                       set {
+                               SetSource (value);
+                       }
+                       get {
+                               return GetSource ();
+                       }
+               }
+
+               //This is obsolete because it wasn't obvious it needed to be disposed
+               [Obsolete("Use GetSource/SetSource")]
+               public Pattern Source {
+                       set {
+                               SetSource (value);
+                       }
+                       get {
+                               return GetSource ();
+                       }
+               }
+
+               public void SetSource (Pattern source)
+               {
+                       NativeMethods.cairo_set_source (handle, source.Handle);
+               }
+
+               public Pattern GetSource ()
+               {
+                       var ptr = NativeMethods.cairo_get_source (handle);
+                       return Cairo.Pattern.Lookup (ptr, false);
+               }
+
+               public double MiterLimit {
+                       set {
+                               NativeMethods.cairo_set_miter_limit (handle, value);
+                       }
+
+                       get {
+                               return NativeMethods.cairo_get_miter_limit (handle);
+                       }
+               }
+
+               public PointD CurrentPoint {
+                       get {
+                               double x, y;
+                               NativeMethods.cairo_get_current_point (handle, out x, out y);
+                               return new PointD (x, y);
+                       }
+               }
+
+               public bool HasCurrentPoint {
+                       get {
+                               return NativeMethods.cairo_has_current_point (handle);
+                       }
+               }
+
+               [Obsolete ("Use GetTarget/SetTarget")]
+               public Cairo.Surface Target {
+                       set {
+                               if (handle != IntPtr.Zero)
+                                       NativeMethods.cairo_destroy (handle);
+
+                               handle = NativeMethods.cairo_create (value.Handle);
+                       }
+
+                       get {
+                               return GetTarget ();
+                       }
+               }
+
+               public Surface GetTarget ()
+               {
+                       return Surface.Lookup (NativeMethods.cairo_get_target (handle), false);
+               }
+
+               public void SetTarget (Surface target)
+               {
+                       if (handle != IntPtr.Zero)
+                               NativeMethods.cairo_destroy (handle);
+                       handle = NativeMethods.cairo_create (target.Handle);
+               }
+
+               [Obsolete("Use GetScaledFont/SetScaledFont")]
+               public ScaledFont ScaledFont {
+                       set {
+                               SetScaledFont (value);
+                       }
+
+                       get {
+                               return GetScaledFont ();
+                       }
+               }
+
+               public ScaledFont GetScaledFont ()
+               {
+                       return new ScaledFont (NativeMethods.cairo_get_scaled_font (handle), false);
+               }
+
+               public void SetScaledFont (ScaledFont font)
+               {
+                       NativeMethods.cairo_set_scaled_font (handle, font.Handle);
+               }
+
+               public uint ReferenceCount {
+                       get { return NativeMethods.cairo_get_reference_count (handle); }
+               }
+
+               public void SetSource (Color color)
+               {
+                       NativeMethods.cairo_set_source_rgba (handle, color.R / 255.0, color.G / 255.0, color.B / 255.0, color.A / 255.0);
+               }
+
+               public void SetSource (double r, double g, double b)
+               {
+                       NativeMethods.cairo_set_source_rgb (handle, r, g, b);
+               }
+
+               public void SetSource (double r, double g, double b, double a)
+               {
+                       NativeMethods.cairo_set_source_rgba (handle, r, g, b, a);
+               }
+
+               //[Obsolete ("Use SetSource method (with double parameters)")]
+               public void SetSource (Surface source, int x = 0, int y = 0)
+               {
+                       NativeMethods.cairo_set_source_surface (handle, source.Handle, x, y);
+               }
+
+               public void SetSource (Surface source, double x, double y)
+               {
+                       NativeMethods.cairo_set_source_surface (handle, source.Handle, x, y);
+               }
+
+               public void SetSource (Surface source)
+               {
+                       NativeMethods.cairo_set_source_surface (handle, source.Handle, 0, 0);
+               }
+
+#region Path methods
+
+               public void NewPath ()
+               {
+                       NativeMethods.cairo_new_path (handle);
+               }
+
+               public void NewSubPath ()
+               {
+                       NativeMethods.cairo_new_sub_path (handle);
+               }
+
+               public void MoveTo (PointD p)
+               {
+                       MoveTo (p.X, p.Y);
+               }
+
+               public void MoveTo (double x, double y)
+               {
+                       NativeMethods.cairo_move_to (handle, x, y);
+               }
+
+               public void LineTo (PointD p)
+               {
+                       LineTo (p.X, p.Y);
+               }
+
+               public void LineTo (double x, double y)
+               {
+                       NativeMethods.cairo_line_to (handle, x, y);
+               }
+
+               public void CurveTo (PointD p1, PointD p2, PointD p3)
+               {
+                       CurveTo (p1.X, p1.Y, p2.X, p2.Y, p3.X, p3.Y);
+               }
+
+               public void CurveTo (double x1, double y1, double x2, double y2, double x3, double y3)
+               {
+                       NativeMethods.cairo_curve_to (handle, x1, y1, x2, y2, x3, y3);
+               }
+
+               public void RelMoveTo (Distance d)
+               {
+                       RelMoveTo (d.Dx, d.Dy);
+               }
+
+               public void RelMoveTo (double dx, double dy)
+               {
+                       NativeMethods.cairo_rel_move_to (handle, dx, dy);
+               }
+
+               public void RelLineTo (Distance d)
+               {
+                       RelLineTo (d.Dx, d.Dy);
+               }
+
+               public void RelLineTo (double dx, double dy)
+               {
+                       NativeMethods.cairo_rel_line_to (handle, dx, dy);
+               }
+
+               public void RelCurveTo (Distance d1, Distance d2, Distance d3)
+               {
+                       RelCurveTo (d1.Dx, d1.Dy, d2.Dx, d2.Dy, d3.Dx, d3.Dy);
+               }
+
+               public void RelCurveTo (double dx1, double dy1, double dx2, double dy2, double dx3, double dy3)
+               {
+                       NativeMethods.cairo_rel_curve_to (handle, dx1, dy1, dx2, dy2, dx3, dy3);
+               }
+
+               public void Arc (double xc, double yc, double radius, double angle1, double angle2)
+               {
+                       NativeMethods.cairo_arc (handle, xc, yc, radius, angle1, angle2);
+               }
+               public void Arc (PointD center, double radius, double angle1, double angle2)
+               {
+                       NativeMethods.cairo_arc (handle, center.X, center.Y, radius, angle1, angle2);
+               }
+
+               public void ArcNegative (double xc, double yc, double radius, double angle1, double angle2)
+               {
+                       NativeMethods.cairo_arc_negative (handle, xc, yc, radius, angle1, angle2);
+               }
+
+               public void Rectangle (Crow.Rectangle rectangle)
+               {
+                       Rectangle (rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
+               }
+               public void Rectangle (Crow.RectangleD rectangle)
+               {
+                       Rectangle (rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
+               }
+
+               public void Rectangle (PointD p, double width, double height)
+               {
+                       Rectangle (p.X, p.Y, width, height);
+               }
+
+               public void Rectangle (double x, double y, double width, double height)
+               {
+                       NativeMethods.cairo_rectangle (handle, x, y, width, height);
+               }
+
+               public void ClosePath ()
+               {
+                       NativeMethods.cairo_close_path (handle);
+               }
+
+               public Path CopyPath ()
+               {
+                       return new Path (NativeMethods.cairo_copy_path (handle));
+               }
+
+               public Path CopyPathFlat ()
+               {
+                       return new Path (NativeMethods.cairo_copy_path_flat (handle));
+               }
+
+               public void AppendPath (Path path)
+               {
+                       NativeMethods.cairo_append_path (handle, path.Handle);
+               }
+
+#endregion
+
+#region Painting Methods
+               public void Paint ()
+               {
+                       NativeMethods.cairo_paint (handle);
+               }
+
+               public void PaintWithAlpha (double alpha)
+               {
+                       NativeMethods.cairo_paint_with_alpha (handle, alpha);
+               }
+
+               public void Mask (Pattern pattern)
+               {
+                       NativeMethods.cairo_mask (handle, pattern.Handle);
+               }
+
+               public void MaskSurface (Surface surface, double surface_x, double surface_y)
+               {
+                       NativeMethods.cairo_mask_surface (handle, surface.Handle, surface_x, surface_y);
+               }
+
+               public void Stroke ()
+               {
+                       NativeMethods.cairo_stroke (handle);
+               }
+
+               public void StrokePreserve ()
+               {
+                       NativeMethods.cairo_stroke_preserve (handle);
+               }
+
+               public Crow.Rectangle StrokeExtents ()
+               {
+                       double x1, y1, x2, y2;
+                       NativeMethods.cairo_stroke_extents (handle, out x1, out y1, out x2, out y2);
+                       return new Crow.Rectangle ((int)x1, (int)y1, (int)(x2 - x1), (int)(y2 - y1));
+               }
+
+               public void Fill ()
+               {
+                       NativeMethods.cairo_fill (handle);
+               }
+
+               public Crow.Rectangle FillExtents ()
+               {
+                       double x1, y1, x2, y2;
+                       NativeMethods.cairo_fill_extents (handle, out x1, out y1, out x2, out y2);
+                       return new Crow.Rectangle ((int)x1, (int)y1, (int)(x2 - x1), (int)(y2 - y1));
+               }
+
+               public void FillPreserve ()
+               {
+                       NativeMethods.cairo_fill_preserve (handle);
+               }
+
+#endregion
+
+               public void Clip ()
+               {
+                       NativeMethods.cairo_clip (handle);
+               }
+
+               public void ClipPreserve ()
+               {
+                       NativeMethods.cairo_clip_preserve (handle);
+               }
+
+               public void ResetClip ()
+               {
+                       NativeMethods.cairo_reset_clip (handle);
+               }
+
+               public bool InClip (double x, double y)
+               {
+                       return NativeMethods.cairo_in_clip (handle, x, y);
+               }
+               public RectangleList GetClipRectangles (){
+                       return (RectangleList)Marshal.PtrToStructure (NativeMethods.cairo_copy_clip_rectangle_list (handle), typeof(RectangleList));
+               }
+               public void ClipExtendRectangle (){
+                       double x1, y1, x2, y2;
+                       NativeMethods.cairo_clip_extents (handle, out x1, out y1, out x2, out y2);
+                       NativeMethods.cairo_rectangle (handle, x1, y1, x2 - x1, y2 - y1); 
+               }
+               public bool InStroke (double x, double y)
+               {
+                       return NativeMethods.cairo_in_stroke (handle, x, y);
+               }
+
+               public bool InFill (double x, double y)
+               {
+                       return NativeMethods.cairo_in_fill (handle, x, y);
+               }
+
+               public Pattern PopGroup ()
+               {
+                       return Pattern.Lookup (NativeMethods.cairo_pop_group (handle), true);
+               }
+
+               public void PopGroupToSource ()
+               {
+                       NativeMethods.cairo_pop_group_to_source (handle);
+               }
+
+               public void PushGroup ()
+               {
+                       NativeMethods.cairo_push_group (handle);
+               }
+
+               public void PushGroup (Content content)
+               {
+                       NativeMethods.cairo_push_group_with_content (handle, content);
+               }
+
+               [Obsolete ("Use GetGroupTarget()")]
+               public Surface GroupTarget {
+                       get {
+                               return GetGroupTarget ();
+                       }
+               }
+
+               public Surface GetGroupTarget ()
+               {
+                       IntPtr surface = NativeMethods.cairo_get_group_target (handle);
+                       return Surface.Lookup (surface, false);
+               }
+
+               public void Rotate (double angle)
+               {
+                       NativeMethods.cairo_rotate (handle, angle);
+               }
+
+               public void Scale (double sx, double sy)
+               {
+                       NativeMethods.cairo_scale (handle, sx, sy);
+               }
+
+               public void Translate (double tx, double ty)
+               {
+                       NativeMethods.cairo_translate (handle, tx, ty);
+               }
+
+               public void Transform (Matrix m)
+               {
+                       NativeMethods.cairo_transform (handle, m);
+               }
+
+               [Obsolete("Use UserToDevice instead")]
+               public void TransformPoint (ref double x, ref double y)
+               {
+                       NativeMethods.cairo_user_to_device (handle, ref x, ref y);
+               }
+
+               [Obsolete("Use UserToDeviceDistance instead")]
+               public void TransformDistance (ref double dx, ref double dy)
+               {
+                       NativeMethods.cairo_user_to_device_distance (handle, ref dx, ref dy);
+               }
+
+               [Obsolete("Use InverseTransformPoint instead")]
+               public void InverseTransformPoint (ref double x, ref double y)
+               {
+                       NativeMethods.cairo_device_to_user (handle, ref x, ref y);
+               }
+
+               [Obsolete("Use DeviceToUserDistance instead")]
+               public void InverseTransformDistance (ref double dx, ref double dy)
+               {
+                       NativeMethods.cairo_device_to_user_distance (handle, ref dx, ref dy);
+               }
+
+               public void UserToDevice (ref double x, ref double y)
+               {
+                       NativeMethods.cairo_user_to_device (handle, ref x, ref y);
+               }
+
+               public void UserToDeviceDistance (ref double dx, ref double dy)
+               {
+                       NativeMethods.cairo_user_to_device_distance (handle, ref dx, ref dy);
+               }
+
+               public void DeviceToUser (ref double x, ref double y)
+               {
+                       NativeMethods.cairo_device_to_user (handle, ref x, ref y);
+               }
+
+               public void DeviceToUserDistance (ref double dx, ref double dy)
+               {
+                       NativeMethods.cairo_device_to_user_distance (handle, ref dx, ref dy);
+               }
+
+               public Matrix Matrix {
+                       set {
+                               NativeMethods.cairo_set_matrix (handle, value);
+                       }
+
+                       get {
+                               Matrix m = new Matrix();
+                               NativeMethods.cairo_get_matrix (handle, m);
+                               return m;
+                       }
+               }
+
+               public void SetFontSize (double scale)
+               {
+                       NativeMethods.cairo_set_font_size (handle, scale);
+               }
+
+               public void IdentityMatrix ()
+               {
+                       NativeMethods.cairo_identity_matrix (handle);
+               }
+
+               [Obsolete ("Use SetFontSize() instead.")]
+               public void FontSetSize (double scale)
+               {
+                       SetFontSize (scale);
+               }
+
+               [Obsolete ("Use SetFontSize() instead.")]
+               public double FontSize {
+                       set { SetFontSize (value); }
+               }
+
+               public Matrix FontMatrix {
+                       get {
+                               Matrix m;
+                               NativeMethods.cairo_get_font_matrix (handle, out m);
+                               return m;
+                       }
+                       set { NativeMethods.cairo_set_font_matrix (handle, value); }
+               }
+
+               public FontOptions FontOptions {
+                       get {
+                               FontOptions options = new FontOptions ();
+                               NativeMethods.cairo_get_font_options (handle, options.Handle);
+                               return options;
+                       }
+                       set { NativeMethods.cairo_set_font_options (handle, value.Handle); }
+               }
+
+               [StructLayout(LayoutKind.Sequential)]
+               internal struct NativeGlyph_4byte_longs {
+                       public int index;
+                       public double x;
+                       public double y;
+
+                       public NativeGlyph_4byte_longs (Glyph source)
+                       {
+                               index = (int) source.index;
+                               x = source.x;
+                               y = source.y;
+                       }
+               }
+
+               static internal IntPtr FromGlyphToUnManagedMemory(Glyph [] glyphs)
+               {
+                       IntPtr dest = Marshal.AllocHGlobal (native_glyph_size * glyphs.Length);
+                       long pos = dest.ToInt64();
+
+                       if (c_compiler_long_size == 8){
+                               foreach (Glyph g in glyphs){
+                                       Marshal.StructureToPtr (g, (IntPtr)pos, false);
+                                       pos += native_glyph_size;
+                               }
+                       } else {
+                               foreach (Glyph g in glyphs){
+                                       NativeGlyph_4byte_longs n = new NativeGlyph_4byte_longs (g);
+
+                                       Marshal.StructureToPtr (n, (IntPtr)pos, false);
+                                       pos += native_glyph_size;
+                               }
+                       }
+
+                       return dest;
+               }
+
+               public void ShowGlyphs (Glyph[] glyphs)
+               {
+                       IntPtr ptr;
+
+                       ptr = FromGlyphToUnManagedMemory (glyphs);
+
+                       NativeMethods.cairo_show_glyphs (handle, ptr, glyphs.Length);
+
+                       Marshal.FreeHGlobal (ptr);
+               }
+
+               [Obsolete("The matrix argument was never used, use ShowGlyphs(Glyphs []) instead")]
+               public void ShowGlyphs (Matrix matrix, Glyph[] glyphs)
+               {
+                       ShowGlyphs (glyphs);
+               }
+
+               [Obsolete("The matrix argument was never used, use GlyphPath(Glyphs []) instead")]
+               public void GlyphPath (Matrix matrix, Glyph[] glyphs)
+               {
+                       GlyphPath (glyphs);
+               }
+
+               public void GlyphPath (Glyph[] glyphs)
+               {
+                       IntPtr ptr;
+
+                       ptr = FromGlyphToUnManagedMemory (glyphs);
+
+                       NativeMethods.cairo_glyph_path (handle, ptr, glyphs.Length);
+
+                       Marshal.FreeHGlobal (ptr);
+
+               }
+
+               public FontExtents FontExtents {
+                       get {
+                               FontExtents f_extents;
+                               NativeMethods.cairo_font_extents (handle, out f_extents);
+                               return f_extents;
+                       }
+               }
+
+               public void CopyPage ()
+               {
+                       NativeMethods.cairo_copy_page (handle);
+               }
+
+               [Obsolete ("Use SelectFontFace() instead.")]
+               public void FontFace (string family, FontSlant slant, FontWeight weight)
+               {
+                       SelectFontFace (family, slant, weight);
+               }
+
+               [Obsolete("Use GetFontFace/SetFontFace")]
+               public FontFace ContextFontFace {
+                       get {
+                               return GetContextFontFace ();
+                       }
+                       set {
+                               SetContextFontFace (value);
+                       }
+               }
+
+               public FontFace GetContextFontFace ()
+               {
+                       return Cairo.FontFace.Lookup (NativeMethods.cairo_get_font_face (handle), false);
+               }
+
+               public void SetContextFontFace (FontFace value)
+               {
+                       NativeMethods.cairo_set_font_face (handle, value == null ? IntPtr.Zero : value.Handle);
+               }
+
+               public void SelectFontFace (string family, FontSlant slant, FontWeight weight)
+               {
+                       NativeMethods.cairo_select_font_face (handle, family, slant, weight);
+               }
+
+               public void ShowPage ()
+               {
+                       NativeMethods.cairo_show_page (handle);
+               }
+
+               private static byte[] TerminateUtf8(byte[] utf8)
+               {
+                       if (utf8.Length > 0 && utf8[utf8.Length - 1] == 0)
+                               return utf8;
+                       var termedArray = new byte[utf8.Length + 1];
+                       Array.Copy(utf8, termedArray, utf8.Length);
+                       termedArray[utf8.Length] = 0;
+                       return termedArray;
+               }
+
+               private static byte[] TerminateUtf8(string s)
+               {
+                       // compute the byte count including the trailing \0
+                       var byteCount = Encoding.UTF8.GetMaxByteCount(s.Length + 1);
+                       var bytes = new byte[byteCount];
+                       Encoding.UTF8.GetBytes(s, 0, s.Length, bytes, 0);
+                       return bytes;
+               }
+
+               public void ShowText(string str)
+               {
+                       NativeMethods.cairo_show_text (handle, TerminateUtf8 (str));
+               }
+
+
+               public void TextPath(string str)
+               {
+                       NativeMethods.cairo_text_path (handle, TerminateUtf8(str));
+               }
+
+               public void TextPath(byte[] utf8)
+               {
+                       NativeMethods.cairo_text_path (handle, TerminateUtf8(utf8));
+               }
+
+               public TextExtents TextExtents(string s)
+               {
+                       TextExtents extents;
+                       NativeMethods.cairo_text_extents (handle, TerminateUtf8(s), out extents);
+                       return extents;
+               }
+               public void ShowText (ReadOnlySpan<char> s, int tabSize) {
+                       int size = s.Length * 4 + 1;
+                       Span<byte> bytes = size > 512 ? new byte[size] : stackalloc byte[size];
+                       int encodedBytes = Crow.Text.Encoding.ToUtf8 (s, bytes, tabSize);
+                       bytes[encodedBytes] = 0;
+                       ShowText (bytes.Slice (0, encodedBytes + 1));
+               }
+               public TextExtents TextExtents (ReadOnlySpan<char> s, int tabSize) {
+                       TextExtents (s, tabSize, out TextExtents extents);                      
+                       return extents;
+               }
+               public void TextExtents (ReadOnlySpan<char> s, int tabSize, out TextExtents extents) {
+                       int size = s.Length * 4 + 1;
+                       Span<byte> bytes = size > 512 ? new byte[size] : stackalloc byte[size];
+                       int encodedBytes = Crow.Text.Encoding.ToUtf8 (s, bytes, tabSize);
+                       bytes[encodedBytes] = 0;
+                       TextExtents (bytes.Slice (0, encodedBytes + 1), out extents);
+               }
+               public void ShowText (Span<byte> bytes) {
+                       NativeMethods.cairo_show_text (handle, ref bytes.GetPinnableReference());
+               }
+               public void TextExtents (Span<byte> bytes, out TextExtents extents) {
+                       NativeMethods.cairo_text_extents (handle, ref bytes.GetPinnableReference (), out extents);
+               }
+
+               public TextExtents GlyphExtents (Glyph[] glyphs)
+               {
+                       IntPtr ptr = FromGlyphToUnManagedMemory (glyphs);
+
+                       TextExtents extents;
+
+                       NativeMethods.cairo_glyph_extents (handle, ptr, glyphs.Length, out extents);
+
+                       Marshal.FreeHGlobal (ptr);
+
+                       return extents;
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/DRMDevice.cs b/Crow/src/GraphicBackends/Mono.Cairo/DRMDevice.cs
new file mode 100644 (file)
index 0000000..05e142c
--- /dev/null
@@ -0,0 +1,53 @@
+//
+// Mono.Cairo.Device.cs
+//
+// Authors:
+//                     JP Bruyère (jp_bruyere@hotmail.com)
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2016 JP Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+
+namespace Crow.Cairo
+{
+       public class DRMDevice : Device
+       {
+               public DRMDevice () : base (NativeMethods.cairo_drm_device_default (), true)
+               {
+               }
+               public DRMDevice (int fd) : base (NativeMethods.cairo_drm_device_get_for_fd (fd), true)
+               {
+               }
+               public DRMDevice (IntPtr udev_device) : base (NativeMethods.cairo_drm_device_get (udev_device), true)
+               {
+               }
+
+               public int FileDescriptor {
+                       get { return NativeMethods.cairo_drm_device_get_fd (Handle); }
+               }
+
+               public void DeviceThrottle () { NativeMethods.cairo_drm_device_throttle (Handle);}
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/DRMSurface.cs b/Crow/src/GraphicBackends/Mono.Cairo/DRMSurface.cs
new file mode 100644 (file)
index 0000000..f624967
--- /dev/null
@@ -0,0 +1,53 @@
+//
+// Mono.Cairo.GLSurface.cs
+//
+// Authors:
+//                     JP Bruyère (jp_bruyere@hotmail.com)
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2016 JP Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       public class DRMSurface : Surface
+       {
+               
+               public DRMSurface (IntPtr ptr, bool own) : base (ptr, own)
+               {}
+
+               public DRMSurface (DRMDevice device, Format format, int width, int height)
+                       : base (NativeMethods.cairo_drm_surface_create (device.Handle, format, width, height), true)
+               {}
+
+               public DRMSurface (DRMDevice device, uint name, Format format, int width, int height, int stride)
+                       : base (NativeMethods.cairo_drm_surface_create_for_name (device.Handle, name, format, width, height, stride), true)
+               {}
+
+               public DRMSurface (DRMDevice device, IntPtr imageSurface)
+                       : base (NativeMethods.cairo_drm_surface_create_from_cacheable_image (device.Handle, imageSurface), true)
+               {}
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Device.cs b/Crow/src/GraphicBackends/Mono.Cairo/Device.cs
new file mode 100644 (file)
index 0000000..484264f
--- /dev/null
@@ -0,0 +1,101 @@
+//
+// Mono.Cairo.Device.cs
+//
+// Authors:
+//                     JP Bruyère (jp_bruyere@hotmail.com)
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2016 JP Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+
+namespace Crow.Cairo
+{
+       public class Device : IDisposable
+       {
+               IntPtr handle = IntPtr.Zero;
+
+               protected Device()
+               {
+               }
+
+               protected Device (IntPtr ptr) : this (ptr, true)
+               {
+               }
+
+               protected Device (IntPtr handle, bool owner)
+               {
+                       this.handle = handle;
+                       if (!owner)
+                               NativeMethods.cairo_device_reference (handle);
+                       if (CairoDebug.Enabled)
+                               CairoDebug.OnAllocated (handle);
+               }
+
+               ~Device ()
+               {
+                       Dispose (false);
+               }
+
+               public IntPtr Handle {
+                       get {
+                               return handle;
+                       }
+               }
+               public string Status {
+                       get {
+                return System.Runtime.InteropServices.Marshal.PtrToStringAuto(NativeMethods.cairo_status_to_string (NativeMethods.cairo_device_status (handle)));
+                       }
+               }
+               public void SetThreadAware (bool value){
+                       NativeMethods.cairo_gl_device_set_thread_aware (handle, value ? 1 : 0);
+               }
+               public Status Acquire()
+               {
+                       return NativeMethods.cairo_device_acquire (handle);
+               }
+               public void Release()
+               {
+                       NativeMethods.cairo_device_release (handle);
+               }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || CairoDebug.Enabled)
+                               CairoDebug.OnDisposed<Device> (handle, disposing);
+
+                       if (!disposing || handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.cairo_device_destroy (handle);
+                       handle = IntPtr.Zero;
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/DirectFBSurface.cs b/Crow/src/GraphicBackends/Mono.Cairo/DirectFBSurface.cs
new file mode 100644 (file)
index 0000000..6443157
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// Mono.Cairo.DirectFBSurface.cs
+//
+// Authors:
+//    Alp Toker
+//
+// (C) Alp Toker, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+       public class DirectFBSurface : Surface
+       {
+               internal DirectFBSurface (IntPtr handle, bool owns) : base (handle, owns)
+               {
+               }
+
+               public DirectFBSurface (IntPtr dfb, IntPtr dfb_surface)
+                       : base (NativeMethods.cairo_directfb_surface_create (dfb, dfb_surface), true)
+               {
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Distance.cs b/Crow/src/GraphicBackends/Mono.Cairo/Distance.cs
new file mode 100644 (file)
index 0000000..d716ab1
--- /dev/null
@@ -0,0 +1,58 @@
+//
+// Mono.Cairo.Context.cs
+//
+// Author:
+//   Duncan Mak (duncan@ximian.com)
+//   Miguel de Icaza (miguel@novell.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//   Alp Toker (alp@atoker.com)
+//
+// (C) Ximian Inc, 2003.
+// (C) Novell Inc, 2003.
+//
+// This is an OO wrapper API for the Cairo API.
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Crow.Cairo {
+
+       public struct Distance
+       {
+               public Distance (double dx, double dy)
+               {
+                       this.dx = dx;
+                       this.dy = dy;
+               }
+
+               double dx, dy;
+               public double Dx {
+                       get { return dx; }
+                       set { dx = value; }
+               }
+
+               public double Dy {
+                       get { return dy; }
+                       set { dy = value; }
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/EGLDevice.cs b/Crow/src/GraphicBackends/Mono.Cairo/EGLDevice.cs
new file mode 100644 (file)
index 0000000..44590c7
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// Mono.Cairo.Device.cs
+//
+// Authors:
+//                     JP Bruyère (jp_bruyere@hotmail.com)
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2016 JP Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+
+namespace Crow.Cairo
+{
+       public class EGLDevice : Device
+       {
+               public EGLDevice (IntPtr dpy, IntPtr gl_ctx) : base (NativeMethods.cairo_egl_device_create (dpy, gl_ctx), true)
+               {
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Extend.cs b/Crow/src/GraphicBackends/Mono.Cairo/Extend.cs
new file mode 100644 (file)
index 0000000..4af536d
--- /dev/null
@@ -0,0 +1,45 @@
+//
+// Mono.Cairo.Extend.cs
+//
+// Authors:
+//   Duncan Mak (duncan@ximian.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//   John Luke (john.luke@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005 John Luke
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum Extend
+       {
+               None,
+               Repeat,
+               Reflect,
+               Pad,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/FillRule.cs b/Crow/src/GraphicBackends/Mono.Cairo/FillRule.cs
new file mode 100644 (file)
index 0000000..80f61ed
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// Mono.Cairo.FillRule.cs
+//
+// Authors:
+//   Duncan Mak (duncan@ximian.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum FillRule
+       {
+               Winding,
+               EvenOdd
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Filter.cs b/Crow/src/GraphicBackends/Mono.Cairo/Filter.cs
new file mode 100644 (file)
index 0000000..a73ea58
--- /dev/null
@@ -0,0 +1,45 @@
+//
+// Mono.Cairo.Filter.cs
+//
+// Authors:
+//   Duncan Mak (duncan@ximian.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum Filter
+       {
+               Fast,
+               Good,
+               Best,
+               Nearest,
+               Bilinear,
+               Gaussian,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/FontExtents.cs b/Crow/src/GraphicBackends/Mono.Cairo/FontExtents.cs
new file mode 100644 (file)
index 0000000..ea26d9b
--- /dev/null
@@ -0,0 +1,104 @@
+//
+// Mono.Cairo.FontExtents.cs
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+//
+// This is a simplistic binding of the Cairo API to C#. All functions
+// in cairo.h are transcribed into their C# equivelants
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Crow.Cairo
+{
+       [StructLayout (LayoutKind.Sequential)]
+       public struct FontExtents
+       {
+               double ascent;
+               double descent;
+               double height;
+               double maxXAdvance;
+               double maxYAdvance;
+               
+               public double Ascent {
+                       get { return ascent; }
+                       set { ascent = value; }
+               }
+               
+               public double Descent {
+                       get { return descent; }
+                       set { descent = value; }
+               }
+               
+               public double Height {
+                       get { return height; }
+                       set { height = value; }
+               }
+               
+               public double MaxXAdvance {
+                       get { return maxXAdvance; }
+                       set { maxXAdvance = value; }
+               }
+               
+               public double MaxYAdvance {
+                       get { return maxYAdvance; }
+                       set { maxYAdvance = value; }
+               }
+
+               public FontExtents (double ascent, double descent, double height, double maxXAdvance, double maxYAdvance)
+               {
+                       this.ascent = ascent;
+                       this.descent = descent;
+                       this.height = height;
+                       this.maxXAdvance = maxXAdvance;
+                       this.maxYAdvance = maxYAdvance;
+               }
+
+               public override bool Equals (object obj)
+               {
+                       if (obj is FontExtents)
+                               return this == (FontExtents) obj;
+                       return false;
+               }
+
+               public override int GetHashCode ()
+               {
+                       return (int) Ascent ^ (int) Descent ^ (int) Height ^ (int) MaxXAdvance ^ (int) MaxYAdvance;
+               }
+
+               public static bool operator == (FontExtents extents, FontExtents other)
+               {
+                       return extents.Ascent == other.Ascent && extents.Descent == other.Descent && extents.Height == other.Height && extents.MaxXAdvance == other.MaxXAdvance && extents.MaxYAdvance == other.MaxYAdvance;
+               }
+
+               public static bool operator != (FontExtents extents, FontExtents other)
+               {
+                       return !(extents == other);
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/FontFace.cs b/Crow/src/GraphicBackends/Mono.Cairo/FontFace.cs
new file mode 100644 (file)
index 0000000..64c428e
--- /dev/null
@@ -0,0 +1,108 @@
+//
+// Mono.Cairo.FontFace.cs
+//
+// Author:
+//   Alp Toker (alp@atoker.com)
+//   Miguel de Icaza (miguel@novell.com)
+//
+// (C) Ximian Inc, 2003.
+//
+// This is an OO wrapper API for the Cairo API.
+//
+// Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+
+namespace Crow.Cairo
+{
+       public class FontFace : IDisposable
+       {
+               IntPtr handle;
+
+               internal static FontFace Lookup (IntPtr handle, bool owner)
+               {
+                       if (handle == IntPtr.Zero)
+                               return null;
+                       return new FontFace (handle, owner);
+               }
+
+               ~FontFace ()
+               {
+                       Dispose (false);
+               }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || CairoDebug.Enabled)
+                               CairoDebug.OnDisposed<FontFace> (handle, disposing);
+
+                       if (!disposing|| handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.cairo_font_face_destroy (handle);
+                       handle = IntPtr.Zero;
+               }
+
+               [Obsolete]
+               public FontFace (IntPtr handle) : this (handle, true)
+               {
+               }
+
+               public FontFace (IntPtr handle, bool owned)
+               {
+                       this.handle = handle;
+                       if (!owned)
+                               NativeMethods.cairo_font_face_reference (handle);
+                       if (CairoDebug.Enabled)
+                               CairoDebug.OnAllocated (handle);
+               }
+
+               public IntPtr Handle {
+                       get {
+                               return handle;
+                       }
+               }
+
+               public Status Status {
+                       get {
+                               return NativeMethods.cairo_font_face_status (handle);
+                       }
+               }
+               
+               public FontType FontType {
+                       get {
+                               return NativeMethods.cairo_font_face_get_type (handle);
+                       }
+               }
+
+               public uint ReferenceCount {
+                       get { return NativeMethods.cairo_font_face_get_reference_count (handle); }
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/FontOptions.cs b/Crow/src/GraphicBackends/Mono.Cairo/FontOptions.cs
new file mode 100644 (file)
index 0000000..f90a3a4
--- /dev/null
@@ -0,0 +1,143 @@
+//
+// Mono.Cairo.FontOptions.cs
+//
+// Author:
+//   John Luke (john.luke@gmail.com)
+//
+// (C) John Luke 2005.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       public class FontOptions : IDisposable
+       {
+               IntPtr handle;
+
+               public FontOptions () : this (NativeMethods.cairo_font_options_create ())
+               {
+               }
+
+               ~FontOptions ()
+               {
+                       Dispose (false);
+               }
+
+               internal FontOptions (IntPtr handle)
+               {
+                       this.handle = handle;
+                       if (CairoDebug.Enabled)
+                               CairoDebug.OnAllocated (handle);
+               }
+
+               public FontOptions Copy ()
+               {
+                       return new FontOptions (NativeMethods.cairo_font_options_copy (handle));
+               }
+
+               [Obsolete ("Use Dispose()")]
+               public void Destroy ()
+               {
+                       Dispose ();
+               }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || CairoDebug.Enabled)
+                               CairoDebug.OnDisposed<FontOptions> (handle, disposing);
+
+                       if (!disposing|| handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.cairo_font_options_destroy (handle);
+                       handle = IntPtr.Zero;
+               }
+
+               public static bool operator == (FontOptions options, FontOptions other)
+               {
+                       return Equals (options, other);
+               }
+
+               public static bool operator != (FontOptions options, FontOptions other)
+               {
+                       return !(options == other);
+               }
+
+               public override bool Equals (object other)
+               {
+                       return Equals (other as FontOptions);
+               }
+
+               bool Equals (FontOptions options)
+               {
+                       return options != null && NativeMethods.cairo_font_options_equal (Handle, options.Handle);
+               }
+
+               public IntPtr Handle {
+                       get { return handle; }
+               }
+
+               public override int GetHashCode ()
+               {
+                       return (int) NativeMethods.cairo_font_options_hash (handle);
+               }
+               
+               public void Merge (FontOptions other)
+               {
+                       if (other == null)
+                               throw new ArgumentNullException ("other");
+                       NativeMethods.cairo_font_options_merge (handle, other.Handle);
+               }
+
+               public Antialias Antialias {
+                       get { return NativeMethods.cairo_font_options_get_antialias (handle); }
+                       set { NativeMethods.cairo_font_options_set_antialias (handle, value); }
+               }
+
+               public HintMetrics HintMetrics {
+                       get { return NativeMethods.cairo_font_options_get_hint_metrics (handle);}
+                       set { NativeMethods.cairo_font_options_set_hint_metrics (handle, value); }
+               }
+
+               public HintStyle HintStyle {
+                       get { return NativeMethods.cairo_font_options_get_hint_style (handle);}
+                       set { NativeMethods.cairo_font_options_set_hint_style (handle, value); }
+               }
+
+               public Status Status {
+                       get { return NativeMethods.cairo_font_options_status (handle); }
+               }
+
+               public SubpixelOrder SubpixelOrder {
+                       get { return NativeMethods.cairo_font_options_get_subpixel_order (handle);}
+                       set { NativeMethods.cairo_font_options_set_subpixel_order (handle, value); }
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/FontSlant.cs b/Crow/src/GraphicBackends/Mono.Cairo/FontSlant.cs
new file mode 100644 (file)
index 0000000..b3d8a1a
--- /dev/null
@@ -0,0 +1,42 @@
+//
+// Mono.Cairo.FontSlant.cs
+//
+// Authors:
+//   Duncan Mak (duncan@ximian.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum FontSlant
+       {
+               Normal,
+               Italic,
+               Oblique
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/FontType.cs b/Crow/src/GraphicBackends/Mono.Cairo/FontType.cs
new file mode 100644 (file)
index 0000000..5db44d4
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// Mono.Cairo.FontType.cs
+//
+// Authors:
+//    John Luke
+//
+// (C) John Luke, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       
+       public enum FontType
+       {
+               Toy,
+               FreeType,
+               Win32,
+               Atsui,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/FontWeight.cs b/Crow/src/GraphicBackends/Mono.Cairo/FontWeight.cs
new file mode 100644 (file)
index 0000000..0b8fc6a
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// Mono.Cairo.FontWeight.cs
+//
+// Authors:
+//   Duncan Mak (duncan@ximian.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum FontWeight
+       {
+               Normal,
+               Bold,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Format.cs b/Crow/src/GraphicBackends/Mono.Cairo/Format.cs
new file mode 100644 (file)
index 0000000..54c8be1
--- /dev/null
@@ -0,0 +1,48 @@
+//
+// Mono.Cairo.Format.cs
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum Format
+       {
+               Argb32  = 0,
+               Rgb24   = 1,
+               A8      = 2,
+               A1      = 3,
+               Rgb16565 = 4,
+
+               //[Obsolete ("Use Argb32")]
+               ARGB32 = Argb32,
+               //[Obsolete ("Use Rgb24")]
+               RGB24   = Rgb24,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/GLSurface.cs b/Crow/src/GraphicBackends/Mono.Cairo/GLSurface.cs
new file mode 100644 (file)
index 0000000..60384b0
--- /dev/null
@@ -0,0 +1,61 @@
+//
+// Mono.Cairo.GLSurface.cs
+//
+// Authors:
+//                     JP Bruyère (jp_bruyere@hotmail.com)
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2016 JP Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       public class GLSurface : Surface
+       {
+               
+               public GLSurface (IntPtr ptr, bool own) : base (ptr, own)
+               {}
+
+               public GLSurface (Device device, Cairo.Content content, uint tex, int width, int height)
+                       : base (NativeMethods.cairo_gl_surface_create_for_texture (device.Handle, (uint)content, tex, width, height), true)
+               {}
+
+               public GLSurface (EGLDevice device, IntPtr eglSurf, int width, int height)
+                       : base (NativeMethods.cairo_gl_surface_create_for_egl (device.Handle, eglSurf, width, height), true)
+               {}
+
+               public GLSurface (GLXDevice device, IntPtr window, int width, int height)
+                       : base (NativeMethods.cairo_gl_surface_create_for_window (device.Handle, window, width, height),true)
+               {}
+
+               public GLSurface (WGLDevice device, IntPtr hdc, int width, int height)
+                       : base (NativeMethods.cairo_gl_surface_create_for_dc (device.Handle, hdc, width, height), true)
+               {}
+
+               public void SwapBuffers(){
+                       NativeMethods.cairo_gl_surface_swapbuffers (this.Handle);
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/GLXDevice.cs b/Crow/src/GraphicBackends/Mono.Cairo/GLXDevice.cs
new file mode 100644 (file)
index 0000000..00cbce1
--- /dev/null
@@ -0,0 +1,49 @@
+//
+// Mono.Cairo.Device.cs
+//
+// Authors:
+//                     JP Bruyère (jp_bruyere@hotmail.com)
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2016 JP Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+
+namespace Crow.Cairo
+{
+       public class GLXDevice : Device
+       {
+               public GLXDevice (IntPtr dpy, IntPtr gl_ctx) : base (NativeMethods.cairo_glx_device_create (dpy, gl_ctx), true)
+               {
+               }
+
+               public IntPtr Display {
+                       get { return NativeMethods.cairo_glx_device_get_display (Handle); }
+               }
+
+               public IntPtr Context {
+                       get { return NativeMethods.cairo_glx_device_get_context (Handle); }
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/GlitzSurface.cs b/Crow/src/GraphicBackends/Mono.Cairo/GlitzSurface.cs
new file mode 100644 (file)
index 0000000..4aa2498
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// Mono.Cairo.GlitzSurface.cs
+//
+// Authors:
+//    Alp Toker
+//
+// (C) Alp Toker, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+       public class GlitzSurface : Surface
+       {
+               internal GlitzSurface (IntPtr handle, bool owns) : base (handle, owns)
+               {
+               }
+
+               public GlitzSurface (IntPtr glitz_surface)
+                       : base (NativeMethods.cairo_glitz_surface_create (glitz_surface), true)
+               {
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Glyph.cs b/Crow/src/GraphicBackends/Mono.Cairo/Glyph.cs
new file mode 100644 (file)
index 0000000..ad51156
--- /dev/null
@@ -0,0 +1,96 @@
+//
+// Mono.Cairo.Glyph.cs
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Crow.Cairo
+{
+       [StructLayout(LayoutKind.Sequential)]
+       public struct Glyph
+       {
+               internal long index;
+               internal double x;
+               internal double y;
+               
+               public Glyph (long index, double x, double y)
+               {
+                       this.index = index;
+                       this.x = x;
+                       this.y = y;
+               }
+               
+               public long Index {
+                       get { return index; }
+                       set { index = value; }
+               }
+               
+               public double X {
+                       get { return x; }
+                       set { x = value; }
+               }
+               
+               public double Y {
+                       get { return y; }
+                       set { y = value; }
+               }
+
+               public override bool Equals (object obj)
+               {
+                       if (obj is Glyph)
+                               return this == (Glyph)obj;
+                       return false;
+               }
+
+               public override int GetHashCode ()
+               {
+                       return (int) Index ^ (int) X ^ (int) Y;
+               }
+
+               internal static IntPtr GlyphsToIntPtr (Glyph[] glyphs)
+               {
+                       int size = Marshal.SizeOf (glyphs[0]);
+                       IntPtr dest = Marshal.AllocHGlobal (size * glyphs.Length);
+                       long pos = dest.ToInt64 ();
+                       for (int i = 0; i < glyphs.Length; i++, pos += size)
+                               Marshal.StructureToPtr (glyphs[i], (IntPtr) pos, false);
+                       return dest;
+               }
+
+               public static bool operator == (Glyph glyph, Glyph other)
+               {
+                       return glyph.Index == other.Index && glyph.X == other.X && glyph.Y == other.Y;
+               }
+
+               public static bool operator != (Glyph glyph, Glyph other)
+               {
+                       return !(glyph == other);
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Gradient.cs b/Crow/src/GraphicBackends/Mono.Cairo/Gradient.cs
new file mode 100644 (file)
index 0000000..a1799e3
--- /dev/null
@@ -0,0 +1,66 @@
+//
+// Mono.Cairo.Gradient.cs
+//
+// Author: Jordi Mas (jordi@ximian.com)
+//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
+// (C) Ximian Inc, 2004.
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Color = Crow.Color;
+namespace Crow.Cairo {
+
+       public class Gradient : Pattern
+       {
+               protected Gradient (IntPtr handle, bool owned) : base (handle, owned)
+               {
+               }
+
+               [Obsolete]
+               protected Gradient ()
+               {
+               }
+
+               public int ColorStopCount {
+                       get {
+                               int cnt;
+                               NativeMethods.cairo_pattern_get_color_stop_count (Handle, out cnt);
+                               return cnt;
+                       }
+               }
+
+               public Status AddColorStop (double offset, Color c)
+               {
+                       NativeMethods.cairo_pattern_add_color_stop_rgba (Handle, offset, c.R / 255.0, c.G / 255.0, c.B / 255.0, c.A / 255.0);
+                       return Status;
+               }
+
+               public Status AddColorStopRgb (double offset, Color c)
+               {
+                       NativeMethods.cairo_pattern_add_color_stop_rgb (Handle, offset, c.R / 255.0, c.G / 255.0 / 255.0, c.B / 255.0);
+                       return Status;
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/HintMetrics.cs b/Crow/src/GraphicBackends/Mono.Cairo/HintMetrics.cs
new file mode 100644 (file)
index 0000000..d830f3e
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// Mono.Cairo.HintMetrics.cs
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum HintMetrics
+       {
+               Default,
+               Off,
+               On,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/HintStyle.cs b/Crow/src/GraphicBackends/Mono.Cairo/HintStyle.cs
new file mode 100644 (file)
index 0000000..343daf3
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// Mono.Cairo.HintStyle.cs
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum HintStyle
+       {
+               Default,
+               None,
+               Slight,
+               Medium,
+               Full,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/ImageSurface.cs b/Crow/src/GraphicBackends/Mono.Cairo/ImageSurface.cs
new file mode 100644 (file)
index 0000000..7c70569
--- /dev/null
@@ -0,0 +1,99 @@
+//
+// Mono.Cairo.ImageSurface.cs
+//
+// Authors:
+//    Duncan Mak
+//    Miguel de Icaza.
+//
+// (C) Ximian Inc, 2003.
+// (C) Novell, Inc. 2003.
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Crow.Cairo {
+
+       public class ImageSurface : Surface
+       {
+               internal ImageSurface (IntPtr handle, bool owns) : base (handle, owns)
+               {
+               }
+
+               public ImageSurface (Format format, int width, int height)
+                       : base (NativeMethods.cairo_image_surface_create (format, width, height), true)
+               {
+               }
+
+               [Obsolete ("Use ImageSurface (byte[] data, Cairo.Format format, int width, int height, int stride)")]
+               public ImageSurface (ref byte[] data, Cairo.Format format, int width, int height, int stride)
+                       : this (data, format, width, height, stride)
+               {
+               }
+
+               public ImageSurface (byte[] data, Format format, int width, int height, int stride)
+                       : base (NativeMethods.cairo_image_surface_create_for_data (data, format, width, height, stride), true)
+               {
+               }
+
+               public ImageSurface (IntPtr data, Format format, int width, int height, int stride)
+                       : base (NativeMethods.cairo_image_surface_create_for_data (data, format, width, height, stride), true)
+               {
+               }
+
+               public ImageSurface (string filename)
+                       : base (NativeMethods.cairo_image_surface_create_from_png (filename), true)
+               {
+               }
+
+               public override int Width => NativeMethods.cairo_image_surface_get_width (Handle);
+               public override int Height => NativeMethods.cairo_image_surface_get_height (Handle);            
+
+               public byte[] Data {
+                       get {
+                               IntPtr ptr = NativeMethods.cairo_image_surface_get_data (Handle);
+                               int length = Height * Stride;
+                               byte[] data = new byte[length];
+                               Marshal.Copy (ptr, data, 0, length);
+                               return data;
+                       }
+               }
+
+               public IntPtr DataPtr {
+                       get {
+                               return NativeMethods.cairo_image_surface_get_data (Handle);
+                       }
+               }
+
+               public Format Format {
+                       get { return NativeMethods.cairo_image_surface_get_format (Handle); }
+               }
+
+               public int Stride {
+                       get { return NativeMethods.cairo_image_surface_get_stride (Handle); }
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/LineCap.cs b/Crow/src/GraphicBackends/Mono.Cairo/LineCap.cs
new file mode 100644 (file)
index 0000000..1560cda
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// Mono.Cairo.LineCap.cs
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum LineCap
+       {
+               Butt,
+               Round,
+               Square,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/LineJoin.cs b/Crow/src/GraphicBackends/Mono.Cairo/LineJoin.cs
new file mode 100644 (file)
index 0000000..1d5389b
--- /dev/null
@@ -0,0 +1,42 @@
+//
+// Mono.Cairo.LineJoin.cs
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum LineJoin
+       {
+               Miter,
+               Round,
+               Bevel
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/LinearGradient.cs b/Crow/src/GraphicBackends/Mono.Cairo/LinearGradient.cs
new file mode 100644 (file)
index 0000000..100d1e6
--- /dev/null
@@ -0,0 +1,59 @@
+//
+// Mono.Cairo.LinearGradient.cs
+//
+// Author: Jordi Mas (jordi@ximian.com)
+//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
+// (C) Ximian Inc, 2004.
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       public class LinearGradient : Gradient
+       {
+               internal LinearGradient (IntPtr handle, bool owned) : base (handle, owned)
+               {
+               }
+
+               public LinearGradient (double x0, double y0, double x1, double y1)
+                       : base (NativeMethods.cairo_pattern_create_linear (x0, y0, x1, y1), true)
+               {
+               }
+
+               public PointD[] LinearPoints {
+                       get {
+                               double x0, y0, x1, y1;
+                               PointD[] points = new PointD [2];
+
+                               NativeMethods.cairo_pattern_get_linear_points (Handle, out x0, out y0, out x1, out y1);
+
+                               points[0] = new PointD (x0, y0);
+                               points[1] = new PointD (x1, y1);
+                               return points;
+                       }
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Matrix.cs b/Crow/src/GraphicBackends/Mono.Cairo/Matrix.cs
new file mode 100644 (file)
index 0000000..7d5a6ac
--- /dev/null
@@ -0,0 +1,193 @@
+//
+// Mono.Cairo.Matrix.cs
+//
+// Author: Duncan Mak
+//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//         Idan Gazit (idan@fastmail.fm)
+//
+// (C) Ximian Inc, 2003 - 2005.
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Crow.Cairo {
+
+       [StructLayout(LayoutKind.Sequential)]
+       public class Matrix //: ICloneable
+       {
+               public double Xx;
+               public double Yx;
+               public double Xy;
+               public double Yy;
+               public double X0;
+               public double Y0;
+
+               public Matrix (double xx, double yx, double xy, double yy,
+                               double x0, double y0)
+               {
+                       this.Xx = xx; this.Yx = yx; this.Xy = xy;
+                       this.Yy = yy; this.X0 = x0; this.Y0 = y0;
+               }
+
+               public Matrix ()
+               {
+                       this.InitIdentity ();
+               }
+
+               public bool IsIdentity ()
+               {
+                       return (this == new Matrix ());
+               }
+
+               public void InitIdentity ()
+               {
+                       // this.Init(1,0,0,1,0,0);
+                       NativeMethods.cairo_matrix_init_identity (this);
+               }
+
+               public void Init (double xx, double yx, double xy, double yy,
+                                 double x0, double y0)
+               {
+                       this.Xx = xx; this.Yx = yx; this.Xy = xy;
+                       this.Yy = yy; this.X0 = x0; this.Y0 = y0;
+               }
+
+               public void InitTranslate (double tx, double ty)
+               {
+                       //this.Init (1, 0, 0, 1, tx, ty);
+                       NativeMethods.cairo_matrix_init_translate (this, tx, ty);
+               }
+
+               public void Translate (double tx, double ty)
+               {
+                       NativeMethods.cairo_matrix_translate (this, tx, ty);
+               }
+
+               public void InitScale (double sx, double sy)
+               {
+                       //this.Init (sx, 0, 0, sy, 0, 0);
+                       NativeMethods.cairo_matrix_init_scale (this, sx, sy);
+               }
+
+               public void Scale (double sx, double sy)
+               {
+                       NativeMethods.cairo_matrix_scale (this, sx, sy);
+               }
+
+               public void InitRotate (double radians)
+               {
+                       /*
+                       double s, c;
+                       s = Math.Sin (radians);
+                       c = Math.Cos (radians);
+                       this.Init (c, s, -s, c, 0, 0);
+                       */
+                       NativeMethods.cairo_matrix_init_rotate (this, radians);
+               }
+
+               public void Rotate (double radians)
+               {
+                       NativeMethods.cairo_matrix_rotate (this, radians);
+               }
+
+               public Cairo.Status Invert ()
+               {
+                       return NativeMethods.cairo_matrix_invert (this);
+               }
+
+               public void Multiply (Matrix b)
+               {
+                       Matrix a = (Matrix) this.Clone ();
+                       NativeMethods.cairo_matrix_multiply (this, a, b);
+               }
+
+               public static Matrix Multiply (Matrix a, Matrix b) {
+                       Matrix result = new Matrix ();
+                       NativeMethods.cairo_matrix_multiply (result, a, b);
+                       return result;
+               }
+
+
+               public void TransformDistance (ref double dx, ref double dy)
+               {
+                       NativeMethods.cairo_matrix_transform_distance (this, ref dx, ref dy);
+               }
+
+               public void TransformPoint (ref double x, ref double y)
+               {
+                       NativeMethods.cairo_matrix_transform_point (this, ref x, ref y);
+               }
+
+               public override String ToString ()
+               {
+                       String s = String.Format ("xx:{0:##0.0#} yx:{1:##0.0#} xy:{2:##0.0#} yy:{3:##0.0#} x0:{4:##0.0#} y0:{5:##0.0#}",
+                               this.Xx, this.Yx, this.Xy, this.Yy, this.X0, this.Y0);
+                       return s;
+               }
+
+               public static bool operator == (Matrix lhs, Matrix rhs)
+               {
+                       return (lhs.Xx == rhs.Xx &&
+                               lhs.Xy == rhs.Xy &&
+                               lhs.Yx == rhs.Yx &&
+                               lhs.Yy == rhs.Yy &&
+                               lhs.X0 == rhs.X0 &&
+                               lhs.Y0 == rhs.Y0 );
+               }
+
+               public static bool operator != (Matrix lhs, Matrix rhs)
+               {
+                       return !(lhs==rhs);
+               }
+
+
+
+               public override bool Equals(object o)
+               {
+                       if (! (o is Matrix))
+                               return false;
+                       else
+                               return (this == (Matrix) o);
+               }
+
+               public override int GetHashCode()
+               {
+                       return  (int)this.Xx ^ (int)this.Xx>>32 ^
+                               (int)this.Xy ^ (int)this.Xy>>32 ^
+                               (int)this.Yx ^ (int)this.Yx>>32 ^
+                               (int)this.Yy ^ (int)this.Yy>>32 ^
+                               (int)this.X0 ^ (int)this.X0>>32 ^
+                               (int)this.Y0 ^ (int)this.Y0>>32;
+               }
+
+               public object Clone()
+               {
+                       return this.MemberwiseClone ();
+               }
+
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/MeshPattern.cs b/Crow/src/GraphicBackends/Mono.Cairo/MeshPattern.cs
new file mode 100644 (file)
index 0000000..83da70b
--- /dev/null
@@ -0,0 +1,112 @@
+//
+// Mono.Cairo.Pattern.cs
+//
+// Author: Jordi Mas (jordi@ximian.com)
+//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
+// (C) Ximian Inc, 2004.
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       public class MeshPattern : Pattern
+       {
+               internal MeshPattern (IntPtr handle, bool owned) : base (handle, owned)
+               {
+               }
+
+               public MeshPattern ()
+                       : base (NativeMethods.cairo_pattern_create_mesh(), true)
+               {
+               }
+
+               //no idea why this is here, the base one is identical, but we can't remove it now
+               public new Extend Extend {
+                       set { NativeMethods.cairo_pattern_set_extend (Handle, value); }
+                       get { return NativeMethods.cairo_pattern_get_extend (Handle); }
+               }
+
+               public Filter Filter {
+                       set { NativeMethods.cairo_pattern_set_filter (Handle, value); }
+                       get { return NativeMethods.cairo_pattern_get_filter (Handle); }
+               }
+
+               public void BeginPatch(){
+                       NativeMethods.cairo_mesh_pattern_begin_patch (Handle);
+               }
+               public void EndPatch(){
+                       NativeMethods.cairo_mesh_pattern_end_patch (Handle);
+               }
+               public void MoveTo(double x, double y){
+                       NativeMethods.cairo_mesh_pattern_move_to (Handle, x, y);
+               }
+               public void MoveTo (PointD p) {
+                       NativeMethods.cairo_mesh_pattern_move_to (Handle, p.X, p.Y);
+               }
+               public void LineTo(double x, double y){
+                       NativeMethods.cairo_mesh_pattern_line_to (Handle, x, y);
+               }
+               public void LineTo (PointD p) {
+                       NativeMethods.cairo_mesh_pattern_line_to (Handle, p.X, p.Y);
+               }
+               public void CurveTo(double x1, double y1, double x2, double y2, double x3, double y3)
+               {
+                       NativeMethods.cairo_mesh_pattern_curve_to (Handle, x1, y1, x2, y2, x3, y3);
+               }
+               public void SetControlPoint(uint point_num, double x, double y){
+                       NativeMethods.cairo_mesh_pattern_set_control_point (Handle, point_num, x, y);
+               }
+               public void SetControlPoint (uint point_num, PointD p) {
+                       NativeMethods.cairo_mesh_pattern_set_control_point (Handle, point_num, p.X, p.Y);
+               }
+               public void SetCornerColorRGB(uint corner_num, double r, double g, double b){
+                       NativeMethods.cairo_mesh_pattern_set_corner_color_rgb (Handle, corner_num, r, g, b);
+               }
+               public void SetCornerColorRGBA(uint corner_num, double r, double g, double b, double a){
+                       NativeMethods.cairo_mesh_pattern_set_corner_color_rgba (Handle, corner_num, r, g, b, a);
+               }
+               public void SetCornerColor (uint corner_num, Color c) {
+                       NativeMethods.cairo_mesh_pattern_set_corner_color_rgba (Handle, corner_num, c.R, c.G, c.B, c.A);
+               }
+               public uint PatchCount {
+                       get {
+                               uint count = 0;
+                               NativeMethods.cairo_mesh_pattern_get_patch_count(Handle, out count);
+                               return count;
+                       }       
+               }
+               public Path GetPath(uint patch_num){
+                       return new Path(NativeMethods.cairo_mesh_pattern_get_path(Handle, patch_num));
+               }
+               public PointD GetControlPoint(uint point_num, uint patch_num = 0) {
+                       NativeMethods.cairo_mesh_pattern_get_control_point (Handle, patch_num, point_num, out double x, out double y);
+                       return new PointD (x, y);
+               }
+               public void GetCornerColorRGBA(){
+                       
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/NativeMethods-internal.cs b/Crow/src/GraphicBackends/Mono.Cairo/NativeMethods-internal.cs
new file mode 100644 (file)
index 0000000..6e6d507
--- /dev/null
@@ -0,0 +1,1026 @@
+//
+// Cairo.cs - a simplistic binding of the Cairo API to C#.
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//          John Luke (john.luke@gmail.com)
+//          Alp Toker (alp@atoker.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005 John Luke
+// Copyright (C) 2006 Alp Toker
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace Cairo
+{
+       // sort the functions like in the following page so it is easier to find what is missing
+       // http://cairographics.org/manual/index-all.html
+
+       public static class NativeMethods
+       {
+               #if MONOTOUCH
+               const string cairo = "__Internal";
+               #else
+               const string cairo = "libcairo-2.dll";
+               #endif
+
+               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               //public static extern void cairo_append_path (IntPtr cr, Path path);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_arc (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_arc_negative (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2);
+
+               //              [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               //              public static extern IntPtr cairo_atsui_font_face_create_for_atsu_font_id (IntPtr font_id);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_clip (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_clip_preserve (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_clip_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_close_path (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_copy_page (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_copy_path (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_copy_path_flat (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_append_path (IntPtr cr, IntPtr path);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_create (IntPtr target);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_curve_to (IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_debug_reset_static_data ();
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_destroy (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_device_to_user (IntPtr cr, ref double x, ref double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_device_to_user_distance (IntPtr cr, ref double dx, ref double dy);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_fill (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_fill_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_fill_preserve (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_font_extents (IntPtr cr, out FontExtents extents);
+
+               #region FontFace
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_font_face_destroy (IntPtr font_face);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern FontType cairo_font_face_get_type (IntPtr font_face);
+
+               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               //public static extern void cairo_font_face_get_user_data (IntPtr font_face);
+
+               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               //public static extern void cairo_font_face_set_user_data (IntPtr font_face);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_font_face_reference (IntPtr font_face);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_font_face_status (IntPtr font_face);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern uint cairo_font_face_get_reference_count (IntPtr surface);
+               #endregion
+
+               #region FontOptions
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_font_options_copy (IntPtr original);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_font_options_create ();
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_font_options_destroy (IntPtr options);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern bool cairo_font_options_equal (IntPtr options, IntPtr other);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Antialias cairo_font_options_get_antialias (IntPtr options);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern HintMetrics cairo_font_options_get_hint_metrics (IntPtr options);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern HintStyle cairo_font_options_get_hint_style (IntPtr options);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern SubpixelOrder cairo_font_options_get_subpixel_order (IntPtr options);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern long cairo_font_options_hash (IntPtr options);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_font_options_merge (IntPtr options, IntPtr other);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_font_options_set_antialias (IntPtr options, Antialias aa);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_font_options_set_hint_metrics (IntPtr options, HintMetrics metrics);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_font_options_set_hint_style (IntPtr options, HintStyle style);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_font_options_set_subpixel_order (IntPtr options, SubpixelOrder order);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_font_options_status (IntPtr options);
+               #endregion
+
+               #region Freetype / FontConfig
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_ft_font_face_create_for_ft_face (IntPtr face, int load_flags);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_ft_font_face_create_for_pattern (IntPtr fc_pattern);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_ft_font_options_substitute (FontOptions options, IntPtr pattern);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_ft_scaled_font_lock_face (IntPtr scaled_font);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_ft_scaled_font_unlock_face (IntPtr scaled_font);
+               #endregion
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Antialias cairo_get_antialias (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_get_current_point (IntPtr cr, out double x, out double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern FillRule cairo_get_fill_rule (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_get_font_face (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_get_font_matrix (IntPtr cr, out Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_get_font_options (IntPtr cr, IntPtr options);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_get_group_target (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern LineCap cairo_get_line_cap (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern LineJoin cairo_get_line_join (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern double cairo_get_line_width (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_get_matrix (IntPtr cr, Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern double cairo_get_miter_limit (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Operator cairo_get_operator (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern uint cairo_get_reference_count (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_get_source (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_get_target (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern double cairo_get_tolerance (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_glitz_surface_create (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_glyph_extents (IntPtr cr, IntPtr glyphs, int num_glyphs, out TextExtents extents);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_glyph_path (IntPtr cr, IntPtr glyphs, int num_glyphs);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               [return: MarshalAs (UnmanagedType.U1)]
+               public static extern bool cairo_has_current_point (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_identity_matrix (IntPtr cr);
+
+               #region Image Surface
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_image_surface_create (Cairo.Format format, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               public static extern IntPtr cairo_image_surface_create_for_data (byte[] data, Cairo.Format format, int width, int height, int stride);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_image_surface_create_for_data (IntPtr data, Cairo.Format format, int width, int height, int stride);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_image_surface_create_from_png  (string filename);
+
+               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               //public static extern IntPtr cairo_image_surface_create_from_png_stream  (string filename);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_image_surface_get_data (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Format cairo_image_surface_get_format (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_image_surface_get_height (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_image_surface_get_stride (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_image_surface_get_width  (IntPtr surface);
+               #endregion
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               [return: MarshalAs (UnmanagedType.U1)]
+               public static extern bool cairo_in_clip (IntPtr cr, double x, double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               [return: MarshalAs (UnmanagedType.U1)]
+               public static extern bool cairo_in_fill (IntPtr cr, double x, double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               [return: MarshalAs (UnmanagedType.U1)]
+               public static extern bool cairo_in_stroke (IntPtr cr, double x, double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_line_to (IntPtr cr, double x, double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_mask (IntPtr cr, IntPtr pattern);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_mask_surface (IntPtr cr, IntPtr surface, double x, double y);
+
+               #region Matrix
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_init (Matrix matrix, double xx, double yx, double xy, double yy, double x0, double y0);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_init_identity (Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_init_rotate (Matrix matrix, double radians);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_init_scale (Matrix matrix, double sx, double sy);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_init_translate (Matrix matrix, double tx, double ty);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_matrix_invert (Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_multiply (Matrix result, Matrix a, Matrix b);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_scale (Matrix matrix, double sx, double sy);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_rotate (Matrix matrix, double radians);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_transform_distance (Matrix matrix, ref double dx, ref double dy);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_transform_point (Matrix matrix, ref double x, ref double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_matrix_translate (Matrix matrix, double tx, double ty);
+               #endregion
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_move_to (IntPtr cr, double x, double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_new_path (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_new_sub_path (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_paint (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_paint_with_alpha (IntPtr cr, double alpha);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_path_destroy (IntPtr path);
+
+               #region Pattern
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_pattern_add_color_stop_rgb (IntPtr pattern, double offset, double red, double green, double blue);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_pattern_add_color_stop_rgba (IntPtr pattern, double offset, double red, double green, double blue, double alpha);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_pattern_get_color_stop_count (IntPtr pattern, out int count);
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_pattern_get_color_stop_rgba (IntPtr pattern, int index, out double offset, out double red, out double green, out double blue, out double alpha);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_pattern_get_surface (IntPtr pattern, out IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_pattern_create_linear (double x0, double y0, double x1, double y1);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_pattern_get_linear_points (IntPtr pattern, out double x0, out double y0, out double x1, out double y1);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_pattern_get_radial_circles (IntPtr pattern, out double x0, out double y0, out double r0, out double x1, out double y1, out double r1);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_pattern_create_rgb (double r, double g, double b);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_pattern_create_rgba (double r, double g, double b, double a);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_pattern_get_rgba (IntPtr pattern, out double red, out double green, out double blue, out double alpha);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_pattern_destroy (IntPtr pattern);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Extend cairo_pattern_get_extend (IntPtr pattern);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Filter cairo_pattern_get_filter (IntPtr pattern);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_pattern_get_matrix (IntPtr pattern, Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern PatternType cairo_pattern_get_type (IntPtr pattern);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_pattern_reference (IntPtr pattern);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_pattern_set_extend (IntPtr pattern, Extend extend);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_pattern_set_filter (IntPtr pattern, Filter filter);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_pattern_set_matrix (IntPtr pattern, Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_pattern_status (IntPtr pattern);
+               #endregion
+
+               #region PdfSurface
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_pdf_surface_create (string filename, double width, double height);
+
+               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               //public static extern IntPtr cairo_pdf_surface_create_for_stream (string filename, double width, double height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_pdf_surface_set_size (IntPtr surface, double x, double y);
+               #endregion
+
+               #region PostscriptSurface
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_ps_surface_create (string filename, double width, double height);
+
+               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               //public static extern IntPtr cairo_ps_surface_create_for_stream (string filename, double width, double height);
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_ps_surface_dsc_begin_page_setup (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_ps_surface_dsc_begin_setup (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_ps_surface_dsc_comment (IntPtr surface, string comment);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_ps_surface_set_size (IntPtr surface, double x, double y);
+               #endregion
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_pop_group (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_pop_group_to_source (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_push_group (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_push_group_with_content (IntPtr cr, Content content);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_quartz_surface_create (IntPtr context, bool flipped, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_reference (IntPtr cr);
+
+               #region Regions
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern bool cairo_region_contains_point (IntPtr region, int x, int y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern RegionOverlap cairo_region_contains_rectangle (IntPtr region, ref Crow.Rectangle rectangle);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_region_copy (IntPtr original);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_region_create ();
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_region_create_rectangle (ref Crow.Rectangle rect);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_region_create_rectangles (IntPtr rects, int count);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_region_destroy (IntPtr region);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern bool cairo_region_equal (IntPtr a, IntPtr b);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_region_get_extents (IntPtr region, out Crow.Rectangle extents);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_region_get_rectangle (IntPtr region, int nth, out Crow.Rectangle rectangle);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_region_intersect (IntPtr dst, IntPtr other);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_region_intersect_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern bool cairo_region_is_empty (IntPtr region);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_region_num_rectangles (IntPtr region);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_region_reference (IntPtr region);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_region_status (IntPtr region);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_region_subtract (IntPtr dst, IntPtr other);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_region_subtract_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_region_translate (IntPtr region, int dx, int dy);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_region_union (IntPtr dst, IntPtr other);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_region_union_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_region_xor (IntPtr dst, IntPtr other);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_region_xor_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
+               #endregion
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_rel_curve_to (IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_reset_clip (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_restore (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_rotate (IntPtr cr, double angle);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_save (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_scale (IntPtr cr, double sx, double sy);
+
+               #region ScaledFont
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_scaled_font_create (IntPtr fontFace, Matrix matrix, Matrix ctm, IntPtr options);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_scaled_font_destroy (IntPtr scaled_font);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_scaled_font_extents (IntPtr scaled_font, out FontExtents extents);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_scaled_font_get_ctm (IntPtr scaled_font, out Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_scaled_font_get_font_face (IntPtr scaled_font);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_scaled_font_get_font_matrix (IntPtr scaled_font, out Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_scaled_font_get_font_options (IntPtr scaled_font);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern FontType cairo_scaled_font_get_type (IntPtr scaled_font);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_scaled_font_glyph_extents (IntPtr scaled_font, IntPtr glyphs, int num_glyphs, out TextExtents extents);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_scaled_font_reference (IntPtr scaled_font);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_scaled_font_status (IntPtr scaled_font);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_scaled_font (IntPtr cr, IntPtr scaled_font);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_get_scaled_font (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               public static extern void cairo_scaled_font_text_extents (IntPtr scaled_font, byte[] utf8, out TextExtents extents);
+               #endregion
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_select_font_face (IntPtr cr, string family, FontSlant slant, FontWeight weight);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_antialias (IntPtr cr, Antialias antialias);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               public static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_get_dash (IntPtr cr, IntPtr dashes, out double offset);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_get_dash_count (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               public static extern void cairo_set_font_matrix (IntPtr cr, Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_font_options (IntPtr cr, IntPtr options);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_font_size (IntPtr cr, double size);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_line_cap (IntPtr cr, LineCap line_cap);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_line_join (IntPtr cr, LineJoin line_join);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_line_width (IntPtr cr, double width);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_matrix (IntPtr cr, Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_miter_limit (IntPtr cr, double limit);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_operator (IntPtr cr, Cairo.Operator op);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_source (IntPtr cr, IntPtr pattern);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_source_rgb (IntPtr cr, double red, double green, double blue);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_source_rgba (IntPtr cr, double red, double green, double blue, double alpha);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_source_surface (IntPtr cr, IntPtr surface, double x, double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_set_tolerance (IntPtr cr, double tolerance);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_show_glyphs (IntPtr ct, IntPtr glyphs, int num_glyphs);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_show_page (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_show_text (IntPtr cr, string str);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_status (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_status_to_string (Status status);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_stroke (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_stroke_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_stroke_preserve (IntPtr cr);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_rectangle_list_destroy (IntPtr rectangle_list);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_copy_clip_rectangle_list (IntPtr cr);
+
+               #region Surface
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_surface_create_similar (IntPtr surface, Cairo.Content content, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_surface_destroy (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_surface_finish (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_surface_flush (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Content cairo_surface_get_content (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_surface_get_device_offset (IntPtr surface, out double x, out double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_surface_get_font_options (IntPtr surface, IntPtr FontOptions);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern uint cairo_surface_get_reference_count (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern SurfaceType cairo_surface_get_type (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_surface_mark_dirty (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_surface_mark_dirty_rectangle (IntPtr surface, int x, int y, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_surface_reference (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_surface_set_device_offset (IntPtr surface, double x, double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_surface_set_fallback_resolution (IntPtr surface, double x, double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_surface_status (IntPtr surface);
+               #endregion
+
+               #region SVG surface
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_surface_write_to_png (IntPtr surface, string filename);
+
+               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               //public static extern void cairo_surface_write_to_png_stream (IntPtr surface, WriteFunc writeFunc);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_svg_surface_create (string fileName, double width, double height);
+
+               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               //public static extern IntPtr cairo_svg_surface_create_for_stream (double width, double height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_svg_surface_restrict_to_version (IntPtr surface, SvgVersion version);
+               #endregion
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_text_extents (IntPtr cr, string txt, out TextExtents extents);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               public static extern void cairo_text_path (IntPtr ct, byte[] utf8);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_transform (IntPtr cr, Matrix matrix);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_translate (IntPtr cr, double tx, double ty);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_user_to_device_distance (IntPtr cr, ref double dx, ref double dy);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_version ();
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_version_string ();
+
+               #region DirectFBSurface
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_directfb_surface_create (IntPtr dfb, IntPtr surface);
+               #endregion
+
+               #region win32 fonts
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_win32_font_face_create_for_logfontw (IntPtr logfontw);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_win32_scaled_font_done_font (IntPtr scaled_font);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern double cairo_win32_scaled_font_get_metrics_factor (IntPtr scaled_font);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_win32_scaled_font_select_font (IntPtr scaled_font, IntPtr hdc);
+               #endregion
+
+               #region win32 surface
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_win32_surface_create (IntPtr hdc);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_win32_surface_create_with_ddb (IntPtr hdc, Format format, int width, int height);
+               #endregion
+
+               #region XcbSurface
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_xcb_surface_create (IntPtr connection, uint drawable, IntPtr visual, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_xcb_surface_create_for_bitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_xcb_surface_set_size (IntPtr surface, int width, int height);
+               #endregion
+
+               #region XlibSurface
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_xlib_surface_create (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_xlib_surface_create_for_bitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_xlib_surface_get_depth (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_xlib_surface_get_display (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_xlib_surface_get_drawable (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_xlib_surface_get_height (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_xlib_surface_get_screen (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_xlib_surface_get_visual (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_xlib_surface_get_width (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_xlib_surface_set_drawable (IntPtr surface, IntPtr drawable, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_xlib_surface_set_size (IntPtr surface, int width, int height);
+               #endregion
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_gl_device_set_thread_aware(IntPtr device, int value);
+
+               #region GLSurface
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_gl_surface_create (IntPtr device, uint content, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_gl_surface_create_for_texture (IntPtr device, uint content, uint tex, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_gl_surface_set_size (IntPtr surface, int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_gl_surface_get_width (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_gl_surface_get_height (IntPtr surface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_gl_surface_swapbuffers (IntPtr surf);
+               #endregion
+
+               #region GLX Functions
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_glx_device_create (IntPtr dpy, IntPtr gl_ctx);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_glx_device_get_display (IntPtr device);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_glx_device_get_context (IntPtr device);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_gl_surface_create_for_window (IntPtr device, IntPtr window, int width, int height);
+               #endregion
+
+               #region WGL Fucntions
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_wgl_device_create (IntPtr hglrc);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_wgl_device_get_context (IntPtr device);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_gl_surface_create_for_dc (IntPtr device, IntPtr hdc, int width, int height);
+               #endregion
+
+               #region EGL Functions
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_egl_device_create (IntPtr dpy, IntPtr gl_ctx);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_gl_surface_create_for_egl (IntPtr device, IntPtr eglSurface, int width, int height);
+               #endregion
+
+               #region DRM Functions
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_drm_device_get (IntPtr udev_device);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_drm_device_get_for_fd (int fd);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_drm_device_default ();
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_drm_device_get_fd (IntPtr cairo_device);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern  void cairo_drm_device_throttle (IntPtr cairo_device);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_drm_surface_create (IntPtr cairo_device, Format format,       int width, int height);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_drm_surface_create_for_name (IntPtr cairo_device, uint name, Format format,   int width, int height, int stride);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_drm_surface_create_from_cacheable_image (IntPtr cairo_device, IntPtr imageSurface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_drm_surface_enable_scan_out (IntPtr drmSurface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_drm_surface_get_handle (IntPtr drmSurface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_drm_surface_get_name (IntPtr drmSurface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Format cairo_drm_surface_get_format (IntPtr drmSurface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_drm_surface_get_width (IntPtr drmSurface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_drm_surface_get_height (IntPtr drmSurface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern int cairo_drm_surface_get_stride (IntPtr drmSurface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_drm_surface_map_to_image (IntPtr drmSurface);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void       cairo_drm_surface_unmap (IntPtr drmSurface,     IntPtr imageSurface);
+               #endregion
+
+               #region Device
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_device_acquire(IntPtr device);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_device_destroy (IntPtr device);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern IntPtr cairo_device_reference (IntPtr device);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void cairo_device_release(IntPtr device);
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern Status cairo_device_status(IntPtr device);
+               #endregion
+
+
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
+               public static extern void crow_cairo_region_clear(IntPtr ctx, IntPtr reg);
+
+       }
+}
\ No newline at end of file
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/NativeMethods.cs b/Crow/src/GraphicBackends/Mono.Cairo/NativeMethods.cs
new file mode 100644 (file)
index 0000000..4f93c41
--- /dev/null
@@ -0,0 +1,1071 @@
+//
+// Cairo.cs - a simplistic binding of the Cairo API to C#.
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//          John Luke (john.luke@gmail.com)
+//          Alp Toker (alp@atoker.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005 John Luke
+// Copyright (C) 2006 Alp Toker
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Crow.Cairo
+{
+       // sort the functions like in the following page so it is easier to find what is missing
+       // http://cairographics.org/manual/index-all.html
+
+       internal static class NativeMethods
+       {
+#if MONOTOUCH
+               const string cairo = "__Internal";
+#else
+       const string cairo = "cairo";
+#endif
+
+        //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+        //internal static extern void cairo_append_path (IntPtr cr, Path path);
+
+        [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_arc (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_arc_negative (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_atsui_font_face_create_for_atsu_font_id (IntPtr font_id);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_clip (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_clip_preserve (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_clip_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_close_path (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_copy_page (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_copy_path (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_copy_path_flat (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_append_path (IntPtr cr, IntPtr path);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_create (IntPtr target);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_curve_to (IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_debug_reset_static_data ();
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_destroy (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_device_to_user (IntPtr cr, ref double x, ref double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_device_to_user_distance (IntPtr cr, ref double dx, ref double dy);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_fill (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_fill_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_fill_preserve (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_font_extents (IntPtr cr, out FontExtents extents);
+
+               #region FontFace
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_font_face_destroy (IntPtr font_face);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern FontType cairo_font_face_get_type (IntPtr font_face);
+
+               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               //internal static extern void cairo_font_face_get_user_data (IntPtr font_face);
+
+               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               //internal static extern void cairo_font_face_set_user_data (IntPtr font_face);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_font_face_reference (IntPtr font_face);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_font_face_status (IntPtr font_face);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern uint cairo_font_face_get_reference_count (IntPtr surface);
+               #endregion
+
+               #region FontOptions
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_font_options_copy (IntPtr original);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_font_options_create ();
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_font_options_destroy (IntPtr options);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               [return: MarshalAs (UnmanagedType.U1)]
+               internal static extern bool cairo_font_options_equal (IntPtr options, IntPtr other);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Antialias cairo_font_options_get_antialias (IntPtr options);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern HintMetrics cairo_font_options_get_hint_metrics (IntPtr options);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern HintStyle cairo_font_options_get_hint_style (IntPtr options);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern SubpixelOrder cairo_font_options_get_subpixel_order (IntPtr options);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern long cairo_font_options_hash (IntPtr options);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_font_options_merge (IntPtr options, IntPtr other);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_font_options_set_antialias (IntPtr options, Antialias aa);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_font_options_set_hint_metrics (IntPtr options, HintMetrics metrics);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_font_options_set_hint_style (IntPtr options, HintStyle style);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_font_options_set_subpixel_order (IntPtr options, SubpixelOrder order);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_font_options_status (IntPtr options);
+               #endregion
+
+               #region Freetype / FontConfig
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_ft_font_face_create_for_ft_face (IntPtr face, int load_flags);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_ft_font_face_create_for_pattern (IntPtr fc_pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_ft_font_options_substitute (FontOptions options, IntPtr pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_ft_scaled_font_lock_face (IntPtr scaled_font);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_ft_scaled_font_unlock_face (IntPtr scaled_font);
+               #endregion
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Antialias cairo_get_antialias (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_get_current_point (IntPtr cr, out double x, out double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern FillRule cairo_get_fill_rule (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_get_font_face (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_get_font_matrix (IntPtr cr, out Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_get_font_options (IntPtr cr, IntPtr options);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_get_group_target (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern LineCap cairo_get_line_cap (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern LineJoin cairo_get_line_join (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern double cairo_get_line_width (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_get_matrix (IntPtr cr, Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern double cairo_get_miter_limit (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Operator cairo_get_operator (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern uint cairo_get_reference_count (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_get_source (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_get_target (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern double cairo_get_tolerance (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_glitz_surface_create (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_glyph_extents (IntPtr cr, IntPtr glyphs, int num_glyphs, out TextExtents extents);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_glyph_path (IntPtr cr, IntPtr glyphs, int num_glyphs);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               [return: MarshalAs (UnmanagedType.U1)]
+               internal static extern bool cairo_has_current_point (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_identity_matrix (IntPtr cr);
+
+               #region Image Surface
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_image_surface_create (Cairo.Format format, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_image_surface_create_for_data (byte[] data, Cairo.Format format, int width, int height, int stride);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_image_surface_create_for_data (IntPtr data, Cairo.Format format, int width, int height, int stride);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_image_surface_create_from_png  (string filename);
+
+               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               //internal static extern IntPtr cairo_image_surface_create_from_png_stream  (string filename);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_image_surface_get_data (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Format cairo_image_surface_get_format (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_image_surface_get_height (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_image_surface_get_stride (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_image_surface_get_width  (IntPtr surface);
+               #endregion
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               [return: MarshalAs (UnmanagedType.U1)]
+               internal static extern bool cairo_in_clip (IntPtr cr, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               [return: MarshalAs (UnmanagedType.U1)]
+               internal static extern bool cairo_in_fill (IntPtr cr, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               [return: MarshalAs (UnmanagedType.U1)]
+               internal static extern bool cairo_in_stroke (IntPtr cr, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_line_to (IntPtr cr, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_mask (IntPtr cr, IntPtr pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_mask_surface (IntPtr cr, IntPtr surface, double x, double y);
+
+               #region Matrix
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_init (Matrix matrix, double xx, double yx, double xy, double yy, double x0, double y0);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_init_identity (Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_init_rotate (Matrix matrix, double radians);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_init_scale (Matrix matrix, double sx, double sy);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_init_translate (Matrix matrix, double tx, double ty);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_matrix_invert (Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_multiply (Matrix result, Matrix a, Matrix b);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_scale (Matrix matrix, double sx, double sy);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_rotate (Matrix matrix, double radians);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_transform_distance (Matrix matrix, ref double dx, ref double dy);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_transform_point (Matrix matrix, ref double x, ref double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_matrix_translate (Matrix matrix, double tx, double ty);
+               #endregion
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_move_to (IntPtr cr, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_new_path (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_new_sub_path (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_paint (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_paint_with_alpha (IntPtr cr, double alpha);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_path_destroy (IntPtr path);
+
+               #region Pattern
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_pattern_add_color_stop_rgb (IntPtr pattern, double offset, double red, double green, double blue);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_pattern_add_color_stop_rgba (IntPtr pattern, double offset, double red, double green, double blue, double alpha);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_pattern_get_color_stop_count (IntPtr pattern, out int count);
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_pattern_get_color_stop_rgba (IntPtr pattern, int index, out double offset, out double red, out double green, out double blue, out double alpha);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_pattern_get_surface (IntPtr pattern, out IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_pattern_create_linear (double x0, double y0, double x1, double y1);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_pattern_get_linear_points (IntPtr pattern, out double x0, out double y0, out double x1, out double y1);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_pattern_get_radial_circles (IntPtr pattern, out double x0, out double y0, out double r0, out double x1, out double y1, out double r1);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_pattern_create_rgb (double r, double g, double b);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_pattern_create_rgba (double r, double g, double b, double a);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_pattern_get_rgba (IntPtr pattern, out double red, out double green, out double blue, out double alpha);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_pattern_destroy (IntPtr pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Extend cairo_pattern_get_extend (IntPtr pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Filter cairo_pattern_get_filter (IntPtr pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_pattern_get_matrix (IntPtr pattern, Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern PatternType cairo_pattern_get_type (IntPtr pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_pattern_reference (IntPtr pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_pattern_set_extend (IntPtr pattern, Extend extend);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_pattern_set_filter (IntPtr pattern, Filter filter);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_pattern_set_matrix (IntPtr pattern, Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_pattern_status (IntPtr pattern);
+
+               //mesh pattern
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_pattern_create_mesh ();
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_mesh_pattern_begin_patch (IntPtr pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_mesh_pattern_end_patch (IntPtr pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_mesh_pattern_move_to (IntPtr pattern, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_mesh_pattern_line_to (IntPtr pattern, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_mesh_pattern_curve_to (IntPtr pattern, double x1, double y1,
+                       double x2, double y2, double x3, double y3);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_mesh_pattern_set_control_point (IntPtr pattern, uint point_num, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_mesh_pattern_set_corner_color_rgb (IntPtr pattern, uint corner_num,
+                       double r, double g, double b);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_mesh_pattern_set_corner_color_rgba (IntPtr pattern, uint corner_num,
+                       double r, double g, double b, double a);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_mesh_pattern_get_patch_count (IntPtr pattern, out uint count);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_mesh_pattern_get_path (IntPtr pattern, uint patch_num);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_mesh_pattern_get_control_point (IntPtr pattern,
+                       uint patch_num, uint point_num, out double x, out double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_mesh_pattern_get_corner_color_rgba (IntPtr pattern,
+                       uint patch_num, uint point_num, out double r, out double g, out double b, out double a);
+               #endregion
+
+               #region PdfSurface
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_pdf_surface_create (string filename, double width, double height);
+
+               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               //internal static extern IntPtr cairo_pdf_surface_create_for_stream (string filename, double width, double height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_pdf_surface_set_size (IntPtr surface, double x, double y);
+               #endregion
+
+               #region PostscriptSurface
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_ps_surface_create (string filename, double width, double height);
+
+               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               //internal static extern IntPtr cairo_ps_surface_create_for_stream (string filename, double width, double height);
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_ps_surface_dsc_begin_page_setup (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_ps_surface_dsc_begin_setup (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_ps_surface_dsc_comment (IntPtr surface, string comment);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_ps_surface_set_size (IntPtr surface, double x, double y);
+               #endregion
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_pop_group (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_pop_group_to_source (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_push_group (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_push_group_with_content (IntPtr cr, Content content);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_quartz_surface_create (IntPtr context, bool flipped, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_reference (IntPtr cr);
+
+               #region Regions
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern bool cairo_region_contains_point (IntPtr region, int x, int y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern RegionOverlap cairo_region_contains_rectangle (IntPtr region, ref Crow.Rectangle rectangle);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_region_copy (IntPtr original);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_region_create ();
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_region_create_rectangle (ref Crow.Rectangle rect);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_region_create_rectangles (IntPtr rects, int count);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_region_destroy (IntPtr region);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern bool cairo_region_equal (IntPtr a, IntPtr b);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_region_get_extents (IntPtr region, out Crow.Rectangle extents);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_region_get_rectangle (IntPtr region, int nth, out Crow.Rectangle rectangle);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_region_intersect (IntPtr dst, IntPtr other);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_region_intersect_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern bool cairo_region_is_empty (IntPtr region);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_region_num_rectangles (IntPtr region);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_region_reference (IntPtr region);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_region_status (IntPtr region);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_region_subtract (IntPtr dst, IntPtr other);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_region_subtract_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_region_translate (IntPtr region, int dx, int dy);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_region_union (IntPtr dst, IntPtr other);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_region_union_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_region_xor (IntPtr dst, IntPtr other);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_region_xor_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
+               #endregion
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_rel_curve_to (IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_reset_clip (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_restore (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_rotate (IntPtr cr, double angle);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_save (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_scale (IntPtr cr, double sx, double sy);
+
+               #region ScaledFont
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_scaled_font_create (IntPtr fontFace, Matrix matrix, Matrix ctm, IntPtr options);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_scaled_font_destroy (IntPtr scaled_font);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_scaled_font_extents (IntPtr scaled_font, out FontExtents extents);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_scaled_font_get_ctm (IntPtr scaled_font, out Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_scaled_font_get_font_face (IntPtr scaled_font);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_scaled_font_get_font_matrix (IntPtr scaled_font, out Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_scaled_font_get_font_options (IntPtr scaled_font);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern FontType cairo_scaled_font_get_type (IntPtr scaled_font);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_scaled_font_glyph_extents (IntPtr scaled_font, IntPtr glyphs, int num_glyphs, out TextExtents extents);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_scaled_font_reference (IntPtr scaled_font);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_scaled_font_status (IntPtr scaled_font);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_scaled_font (IntPtr cr, IntPtr scaled_font);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_get_scaled_font (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_scaled_font_text_extents (IntPtr scaled_font, byte[] utf8, out TextExtents extents);
+               #endregion
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_select_font_face (IntPtr cr, string family, FontSlant slant, FontWeight weight);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_antialias (IntPtr cr, Antialias antialias);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_get_dash (IntPtr cr, IntPtr dashes, out double offset);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_get_dash_count (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_font_matrix (IntPtr cr, Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_font_options (IntPtr cr, IntPtr options);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_font_size (IntPtr cr, double size);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_line_cap (IntPtr cr, LineCap line_cap);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_line_join (IntPtr cr, LineJoin line_join);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_line_width (IntPtr cr, double width);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_matrix (IntPtr cr, Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_miter_limit (IntPtr cr, double limit);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_operator (IntPtr cr, Cairo.Operator op);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_source (IntPtr cr, IntPtr pattern);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_source_rgb (IntPtr cr, double red, double green, double blue);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_source_rgba (IntPtr cr, double red, double green, double blue, double alpha);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_source_surface (IntPtr cr, IntPtr surface, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_set_tolerance (IntPtr cr, double tolerance);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_show_glyphs (IntPtr ct, IntPtr glyphs, int num_glyphs);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_show_page (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_status (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_status_to_string (Status status);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_stroke (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_stroke_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_stroke_preserve (IntPtr cr);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_rectangle_list_destroy (IntPtr rectangle_list);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_copy_clip_rectangle_list (IntPtr cr);
+
+               #region Surface
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_surface_create_similar (IntPtr surface, Cairo.Content content, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_surface_destroy (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_surface_finish (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_surface_flush (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Content cairo_surface_get_content (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_surface_get_device_offset (IntPtr surface, out double x, out double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_surface_get_font_options (IntPtr surface, IntPtr FontOptions);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern uint cairo_surface_get_reference_count (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern SurfaceType cairo_surface_get_type (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_surface_mark_dirty (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_surface_mark_dirty_rectangle (IntPtr surface, int x, int y, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_surface_reference (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_surface_set_device_offset (IntPtr surface, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_surface_set_fallback_resolution (IntPtr surface, double x, double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_surface_status (IntPtr surface);
+               #endregion
+
+               #region SVG surface
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_surface_write_to_png (IntPtr surface, string filename);
+
+               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               //internal static extern void cairo_surface_write_to_png_stream (IntPtr surface, WriteFunc writeFunc);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_svg_surface_create (string fileName, double width, double height);
+
+               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               //internal static extern IntPtr cairo_svg_surface_create_for_stream (double width, double height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_svg_surface_restrict_to_version (IntPtr surface, SvgVersion version);
+               #endregion
+
+               [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)]
+               internal static extern void cairo_show_text (IntPtr cr, byte[] text);
+
+               [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)]
+               internal static extern void cairo_text_extents (IntPtr cr, byte[] utf8, out TextExtents extents);
+
+               [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)]
+               internal static extern void cairo_show_text (IntPtr cr, ref byte utf8);
+
+               [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)]
+               internal static extern void cairo_text_extents (IntPtr cr, ref byte utf8, out TextExtents extents);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_text_path (IntPtr ct, byte[] utf8);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_transform (IntPtr cr, Matrix matrix);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_translate (IntPtr cr, double tx, double ty);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_user_to_device_distance (IntPtr cr, ref double dx, ref double dy);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_version ();
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_version_string ();
+
+               #region DirectFBSurface
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_directfb_surface_create (IntPtr dfb, IntPtr surface);
+               #endregion
+
+               #region win32 fonts
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_win32_font_face_create_for_logfontw (IntPtr logfontw);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_win32_scaled_font_done_font (IntPtr scaled_font);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern double cairo_win32_scaled_font_get_metrics_factor (IntPtr scaled_font);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_win32_scaled_font_select_font (IntPtr scaled_font, IntPtr hdc);
+               #endregion
+
+               #region win32 surface
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_win32_surface_create (IntPtr hdc);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_win32_surface_create_with_ddb (IntPtr hdc, Format format, int width, int height);
+               #endregion
+
+               #region XcbSurface
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_xcb_surface_create (IntPtr connection, uint drawable, IntPtr visual, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_xcb_surface_create_for_bitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_xcb_surface_set_size (IntPtr surface, int width, int height);
+               #endregion
+
+               #region XlibSurface
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_xlib_surface_create (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_xlib_surface_create_for_bitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_xlib_surface_get_depth (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_xlib_surface_get_display (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_xlib_surface_get_drawable (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_xlib_surface_get_height (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_xlib_surface_get_screen (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_xlib_surface_get_visual (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_xlib_surface_get_width (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_xlib_surface_set_drawable (IntPtr surface, IntPtr drawable, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_xlib_surface_set_size (IntPtr surface, int width, int height);
+               #endregion
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_gl_device_set_thread_aware(IntPtr device, int value);
+
+               #region GLSurface
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_gl_surface_create (IntPtr device, uint content, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_gl_surface_create_for_texture (IntPtr device, uint content, uint tex, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_gl_surface_set_size (IntPtr surface, int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_gl_surface_get_width (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_gl_surface_get_height (IntPtr surface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_gl_surface_swapbuffers (IntPtr surf);
+               #endregion
+
+               #region GLX Functions
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_glx_device_create (IntPtr dpy, IntPtr gl_ctx);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_glx_device_get_display (IntPtr device);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_glx_device_get_context (IntPtr device);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_gl_surface_create_for_window (IntPtr device, IntPtr window, int width, int height);
+               #endregion
+
+               #region WGL Fucntions
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_wgl_device_create (IntPtr hglrc);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_wgl_device_get_context (IntPtr device);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_gl_surface_create_for_dc (IntPtr device, IntPtr hdc, int width, int height);
+               #endregion
+
+               #region EGL Functions
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_egl_device_create (IntPtr dpy, IntPtr gl_ctx);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_gl_surface_create_for_egl (IntPtr device, IntPtr eglSurface, int width, int height);
+               #endregion
+
+               #region DRM Functions
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_drm_device_get (IntPtr udev_device);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_drm_device_get_for_fd (int fd);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_drm_device_default ();
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_drm_device_get_fd (IntPtr cairo_device);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern  void cairo_drm_device_throttle (IntPtr cairo_device);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_drm_surface_create (IntPtr cairo_device, Format format,     int width, int height);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_drm_surface_create_for_name (IntPtr cairo_device, uint name, Format format, int width, int height, int stride);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_drm_surface_create_from_cacheable_image (IntPtr cairo_device, IntPtr imageSurface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_drm_surface_enable_scan_out (IntPtr drmSurface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_drm_surface_get_handle (IntPtr drmSurface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_drm_surface_get_name (IntPtr drmSurface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Format cairo_drm_surface_get_format (IntPtr drmSurface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_drm_surface_get_width (IntPtr drmSurface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_drm_surface_get_height (IntPtr drmSurface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern int cairo_drm_surface_get_stride (IntPtr drmSurface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_drm_surface_map_to_image (IntPtr drmSurface);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void     cairo_drm_surface_unmap (IntPtr drmSurface,     IntPtr imageSurface);
+               #endregion
+
+               #region Device
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_device_acquire(IntPtr device);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_device_destroy (IntPtr device);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern IntPtr cairo_device_reference (IntPtr device);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern void cairo_device_release(IntPtr device);
+
+               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
+               internal static extern Status cairo_device_status(IntPtr device);
+               #endregion
+       }
+}
\ No newline at end of file
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Operator.cs b/Crow/src/GraphicBackends/Mono.Cairo/Operator.cs
new file mode 100644 (file)
index 0000000..1c11ccc
--- /dev/null
@@ -0,0 +1,62 @@
+//
+// Mono.Cairo.Operator.cs
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//          John Luke (john.luke@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005 John Luke
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum Operator
+       {
+               Clear,
+               Source,
+               Over,
+               In,
+               Out,
+               Atop,
+
+               Dest,
+               DestOver,
+               DestIn,
+               DestOut,
+               DestAtop,
+               
+               Xor,
+               Add,
+               Saturate,
+               Multiply,
+               Screen,
+               Overlay,
+               Darken,
+               Lighten,
+
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/PSSurface.cs b/Crow/src/GraphicBackends/Mono.Cairo/PSSurface.cs
new file mode 100644 (file)
index 0000000..cf90794
--- /dev/null
@@ -0,0 +1,64 @@
+//
+// Mono.Cairo.PostscriptSurface.cs
+//
+// Authors:
+//    John Luke
+//
+// (C) John Luke, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       public class PSSurface : Surface
+       {
+               internal PSSurface (IntPtr handle, bool owns) : base (handle, owns)
+               {
+               }
+
+               public PSSurface (string filename, double width, double height)
+                       : base (NativeMethods.cairo_ps_surface_create (filename, width, height), true)
+               {
+               }
+
+               public void BeginPageSetup ()
+               {
+                       NativeMethods.cairo_ps_surface_dsc_begin_page_setup (Handle);
+               }
+
+               public void BeginSetup ()
+               {
+                       NativeMethods.cairo_ps_surface_dsc_begin_setup (Handle);
+               }
+
+               public void DscComment (string comment)
+               {
+                       NativeMethods.cairo_ps_surface_dsc_comment (Handle, comment);
+               }
+
+               public void SetSize (double width, double height)
+               {
+                       NativeMethods.cairo_ps_surface_set_size (Handle, width, height);
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Path.cs b/Crow/src/GraphicBackends/Mono.Cairo/Path.cs
new file mode 100644 (file)
index 0000000..881aa42
--- /dev/null
@@ -0,0 +1,77 @@
+//
+// Mono.Cairo.Context.cs
+//
+// Author:
+//   Miguel de Icaza (miguel@novell.com)
+//
+// This is an OO wrapper API for the Cairo API.
+//
+// Copyright 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+#if VKVG
+using vkvg;
+#else
+using Crow.Cairo;
+#endif
+
+namespace Crow.Cairo {
+
+       public class Path : IDisposable
+       {
+               IntPtr handle = IntPtr.Zero;
+
+               internal Path (IntPtr handle)
+               {
+                       this.handle = handle;
+                       if (CairoDebug.Enabled)
+                               CairoDebug.OnAllocated (handle);
+               }
+
+               ~Path ()
+               {
+                       Dispose (false);
+               }
+
+               public IntPtr Handle { get { return handle; } }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || CairoDebug.Enabled)
+                               CairoDebug.OnDisposed<Path> (handle, disposing);
+
+                       if (!disposing|| handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.cairo_path_destroy (handle);
+                       handle = IntPtr.Zero;
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Pattern.cs b/Crow/src/GraphicBackends/Mono.Cairo/Pattern.cs
new file mode 100644 (file)
index 0000000..3e933a1
--- /dev/null
@@ -0,0 +1,155 @@
+//
+// Mono.Cairo.Pattern.cs
+//
+// Author: Jordi Mas (jordi@ximian.com)
+//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
+// (C) Ximian Inc, 2004.
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+
+namespace Crow.Cairo {
+   
+       public class Pattern : IDisposable
+       {
+               [Obsolete]
+               protected IntPtr pattern = IntPtr.Zero;
+
+               public static Pattern Lookup (IntPtr pattern, bool owner)
+               {
+                       if (pattern == IntPtr.Zero)
+                               return null;
+                       
+                       PatternType pt = NativeMethods.cairo_pattern_get_type (pattern);
+                       switch (pt) {
+                       case PatternType.Solid:
+                               return new SolidPattern (pattern, owner);
+                       case PatternType.Surface:
+                               return new SurfacePattern (pattern, owner);
+                       case PatternType.Linear:
+                               return new LinearGradient (pattern, owner);
+                       case PatternType.Radial:
+                               return new RadialGradient (pattern, owner);
+                       default:
+                               return new Pattern (pattern, owner);
+                       }
+               }
+
+               [Obsolete]
+               protected Pattern ()
+               {
+               }
+               
+               internal Pattern (IntPtr handle, bool owned)
+               {
+                       Handle = handle;
+                       if (!owned)
+                               NativeMethods.cairo_pattern_reference (handle);
+                       if (CairoDebug.Enabled)
+                               CairoDebug.OnAllocated (handle);
+               }
+
+               ~Pattern ()
+               {
+                       Dispose (false);
+               }
+               
+               [Obsolete ("Use the SurfacePattern constructor")]
+               public Pattern (Surface surface)
+                       : this ( NativeMethods.cairo_pattern_create_for_surface (surface.Handle), true)
+               {
+               }
+               
+               [Obsolete]
+               protected void Reference ()
+               {
+                       NativeMethods.cairo_pattern_reference (pattern);
+               }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || CairoDebug.Enabled)
+                               CairoDebug.OnDisposed<Pattern> (Handle, disposing);
+
+                       if (!disposing|| Handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.cairo_pattern_destroy (Handle);
+                       Handle = IntPtr.Zero;
+               }
+
+               [Obsolete ("Use Dispose()")]
+               public void Destroy ()
+               {
+                       Dispose ();
+               }
+
+               public Status Status
+               {
+                       get { return NativeMethods.cairo_pattern_status (Handle); }
+               }
+
+               public Extend Extend
+               {
+                       get { return NativeMethods.cairo_pattern_get_extend (Handle); }
+                       set { NativeMethods.cairo_pattern_set_extend (Handle, value); }
+               }
+
+               public Matrix Matrix {
+                       set {
+                               NativeMethods.cairo_pattern_set_matrix (Handle, value);
+                       }
+
+                       get {
+                               Matrix m = new Matrix ();
+                               NativeMethods.cairo_pattern_get_matrix (Handle, m);
+                               return m;
+                       }
+               }
+
+#pragma warning disable 612
+               public IntPtr Handle {
+                       get { return pattern; }
+                       private set { pattern = value; }
+               }
+#pragma warning restore 612
+
+               [Obsolete]
+               public IntPtr Pointer {
+                       get { return pattern; }
+               }
+
+               public PatternType PatternType {
+                       get { return NativeMethods.cairo_pattern_get_type (Handle); }
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/PatternType.cs b/Crow/src/GraphicBackends/Mono.Cairo/PatternType.cs
new file mode 100644 (file)
index 0000000..deac3ab
--- /dev/null
@@ -0,0 +1,44 @@
+//
+// Mono.Cairo.PatternType.cs
+//
+// Authors:
+//    John Luke
+//
+// (C) John Luke, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       
+       public enum PatternType
+       {
+               Solid,
+               Surface,
+               Linear,
+               Radial,
+               Mesh,
+               RasterSource
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/PdfSurface.cs b/Crow/src/GraphicBackends/Mono.Cairo/PdfSurface.cs
new file mode 100644 (file)
index 0000000..09a2d12
--- /dev/null
@@ -0,0 +1,50 @@
+//
+// Mono.Cairo.PdfSurface.cs
+//
+// Authors:
+//    John Luke
+//
+// (C) John Luke, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       public class PdfSurface : Surface
+       {
+               internal PdfSurface (IntPtr handle, bool owns) : base (handle, owns)
+               {
+               }
+
+               public PdfSurface (string filename, double width, double height)
+                       : base (NativeMethods.cairo_pdf_surface_create (filename, width, height), true)
+               {
+               }
+
+               public void SetSize (double width, double height)
+               {
+                       NativeMethods.cairo_pdf_surface_set_size (Handle, width, height);
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/RadialGradient.cs b/Crow/src/GraphicBackends/Mono.Cairo/RadialGradient.cs
new file mode 100644 (file)
index 0000000..6abe267
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// Mono.Cairo.Pattern.cs
+//
+// Author: Jordi Mas (jordi@ximian.com)
+//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
+// (C) Ximian Inc, 2004.
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       public class RadialGradient : Gradient
+       {
+               internal RadialGradient (IntPtr handle, bool owned) : base (handle, owned)
+               {
+               }
+
+               public RadialGradient (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1)
+                       : base (NativeMethods.cairo_pattern_create_radial (cx0, cy0, radius0, cx1, cy1, radius1), true)
+               {
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Region.cs b/Crow/src/GraphicBackends/Mono.Cairo/Region.cs
new file mode 100644 (file)
index 0000000..f2c111d
--- /dev/null
@@ -0,0 +1,202 @@
+// Copyright (C) 2011 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Crow.Cairo
+{
+       [StructLayout(LayoutKind.Sequential)]
+       public struct RectangleList {
+               public Status Status;
+               public IntPtr Rectangles;
+               public int NumRectangles;
+       }
+
+       public enum RegionOverlap {
+               In,
+               Out,
+               Part,
+       }
+
+       public class Region : IDisposable {
+
+               IntPtr handle;
+               public IntPtr Handle {
+                       get { return handle; }
+               }
+
+               [Obsolete]
+               public Region (IntPtr handle) : this (handle, false) {}
+
+               public Region (IntPtr handle, bool owned)
+               {
+                       this.handle = handle;
+                       if (!owned)
+                               NativeMethods.cairo_region_reference (handle);
+                       if (CairoDebug.Enabled)
+                               CairoDebug.OnAllocated (handle);
+               }
+
+               public Region () : this (NativeMethods.cairo_region_create () , true)
+               {
+               }
+
+               public Region (Crow.Rectangle rect)
+               {
+                       handle = NativeMethods.cairo_region_create_rectangle (ref rect);
+               }
+
+               public Region (RectangleList rects)
+               {
+                       handle = NativeMethods.cairo_region_create_rectangles (rects.Rectangles, rects.NumRectangles);
+               }
+
+               public Region Copy ()
+               {
+                       return new Region (NativeMethods.cairo_region_copy (Handle), true);
+               }
+
+               #region IDisposable
+               ~Region ()
+               {
+                       Dispose (false);
+               }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || CairoDebug.Enabled)
+                               CairoDebug.OnDisposed<Region> (handle, disposing);
+
+                       if (!disposing|| handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.cairo_region_destroy (Handle);
+                       handle = IntPtr.Zero;
+               }
+               #endregion
+
+               public override bool Equals (object obj)
+               {
+                       return (obj is Region) && NativeMethods.cairo_region_equal (Handle, (obj as Region).Handle);
+               }
+
+               public override int GetHashCode ()
+               {
+                       return Handle.GetHashCode ();
+               }
+
+               public Status Status {
+                       get { return NativeMethods.cairo_region_status (Handle); }
+               }
+
+               public Crow.Rectangle Extents {
+                       get {
+                               Crow.Rectangle result;
+                               NativeMethods.cairo_region_get_extents (Handle, out result);
+                               return result;
+                       }
+               }
+
+               public int NumRectangles {
+                       get { return NativeMethods.cairo_region_num_rectangles (Handle); }
+               }
+
+               public Crow.Rectangle GetRectangle (int nth)
+               {
+                       Crow.Rectangle val;
+                       NativeMethods.cairo_region_get_rectangle (Handle, nth, out val);
+                       return val;
+               }
+
+               public bool IsEmpty {
+                       get { return NativeMethods.cairo_region_is_empty (Handle); }
+               }
+
+               public RegionOverlap Contains (Crow.Rectangle rectangle)
+               {
+                       return NativeMethods.cairo_region_contains_rectangle (Handle, ref rectangle);
+               }
+
+               public bool Contains (int x, int y)
+               {
+                       return NativeMethods.cairo_region_contains_point (Handle, x, y);
+               }
+
+               public void Translate (int dx, int dy)
+               {
+                       NativeMethods.cairo_region_translate (Handle, dx, dy);
+               }
+
+               public Status Subtract (Region other)
+               {
+                       return NativeMethods.cairo_region_subtract (Handle, other.Handle);
+               }
+
+               public Status SubtractRectangle (Crow.Rectangle rectangle)
+               {
+                       return NativeMethods.cairo_region_subtract_rectangle (Handle, ref rectangle);
+               }
+
+               public Status Intersect (Region other)
+               {
+                       return NativeMethods.cairo_region_intersect (Handle, other.Handle);
+               }
+
+               public Status IntersectRectangle (Crow.Rectangle rectangle)
+               {
+                       return NativeMethods.cairo_region_intersect_rectangle (Handle, ref rectangle);
+               }
+
+               public Status Union (Region other)
+               {
+                       return NativeMethods.cairo_region_union (Handle, other.Handle);
+               }
+
+               public Status UnionRectangle (Crow.Rectangle rectangle)
+               {
+                       return NativeMethods.cairo_region_union_rectangle (Handle, ref rectangle);
+               }
+
+               public Status Xor (Region other)
+               {
+                       return NativeMethods.cairo_region_xor (Handle, other.Handle);
+               }
+
+               public Status XorRectangle (Crow.Rectangle rectangle)
+               {
+                       return NativeMethods.cairo_region_xor_rectangle (Handle, ref rectangle);
+               }
+               public void Reset () {
+                       if (IsEmpty)
+                               return;
+                       NativeMethods.cairo_region_destroy (Handle);
+                       handle = NativeMethods.cairo_region_create ();                  
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/ScaledFont.cs b/Crow/src/GraphicBackends/Mono.Cairo/ScaledFont.cs
new file mode 100644 (file)
index 0000000..594d1be
--- /dev/null
@@ -0,0 +1,123 @@
+//
+// Mono.Cairo.ScaledFont.cs
+//
+// (c) 2008 Jordi Mas i Hernandez (jordimash@gmail.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Crow.Cairo {
+   
+       public class ScaledFont : IDisposable
+       {
+               protected IntPtr handle = IntPtr.Zero;
+
+               internal ScaledFont (IntPtr handle, bool owner)
+               {
+                       this.handle = handle;
+                       if (!owner)
+                               NativeMethods.cairo_scaled_font_reference (handle);
+                       if (CairoDebug.Enabled)
+                               CairoDebug.OnAllocated (handle);
+               }
+
+               public ScaledFont (FontFace fontFace, Matrix matrix, Matrix ctm, FontOptions options)
+                       : this (NativeMethods.cairo_scaled_font_create (fontFace.Handle, matrix, ctm, options.Handle), true)
+               {
+               }
+
+               ~ScaledFont ()
+               {
+                       Dispose (false);
+               }
+
+               public IntPtr Handle {
+                       get {
+                               return handle;
+                       }
+               }
+
+               public FontExtents FontExtents {
+                       get {
+                               FontExtents extents;
+                               NativeMethods.cairo_scaled_font_extents (handle, out extents);
+                               return extents;
+                       }
+               }
+
+               public Matrix FontMatrix {
+                       get {
+                               Matrix m;
+                               NativeMethods.cairo_scaled_font_get_font_matrix (handle, out m);
+                               return m;
+                       }
+               }
+
+               public FontType FontType {
+                       get {
+                               return NativeMethods.cairo_scaled_font_get_type (handle);
+                       }
+               }
+
+               public TextExtents GlyphExtents (Glyph[] glyphs)
+               {
+                       IntPtr ptr = Context.FromGlyphToUnManagedMemory (glyphs);
+                       TextExtents extents;
+
+                       NativeMethods.cairo_scaled_font_glyph_extents (handle, ptr, glyphs.Length, out extents);
+
+                       Marshal.FreeHGlobal (ptr);
+                       return extents;
+               }
+       
+               public Status Status
+               {
+                       get { return NativeMethods.cairo_scaled_font_status (handle); }
+               }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || CairoDebug.Enabled)
+                               CairoDebug.OnDisposed<ScaledFont> (handle, disposing);
+
+                       if (!disposing|| handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.cairo_scaled_font_destroy (handle);
+                       handle = IntPtr.Zero;
+               }
+
+               [Obsolete]
+               protected void Reference ()
+               {
+                       NativeMethods.cairo_scaled_font_reference (handle);
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/SolidPattern.cs b/Crow/src/GraphicBackends/Mono.Cairo/SolidPattern.cs
new file mode 100644 (file)
index 0000000..6cd89f8
--- /dev/null
@@ -0,0 +1,72 @@
+//
+// Mono.Cairo.Pattern.cs
+//
+// Author: Jordi Mas (jordi@ximian.com)
+//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
+// (C) Ximian Inc, 2004.
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Color = Crow.Color;
+namespace Crow.Cairo {
+
+       public class SolidPattern : Pattern
+       {
+               internal SolidPattern (IntPtr handle, bool owned) : base (handle, owned)
+               {
+               }
+
+               public SolidPattern (Color color)
+                       : base (NativeMethods.cairo_pattern_create_rgba (color.R, color.G, color.B, color.A), true)
+               {
+               }
+
+               public SolidPattern (double r, double g, double b)
+                       : base (NativeMethods.cairo_pattern_create_rgb (r, g, b), true)
+               {
+               }
+
+               public SolidPattern (double r, double g, double b, double a)
+                       : base (NativeMethods.cairo_pattern_create_rgba (r, g, b, a), true)
+               {
+               }
+
+               public SolidPattern (Color color, bool solid)
+                       : base (solid
+                                       ? NativeMethods.cairo_pattern_create_rgb (color.R, color.G, color.B)
+                                       : NativeMethods.cairo_pattern_create_rgba (color.R, color.G, color.B, color.A),
+                               true)
+               {
+               }
+
+               public Color Color {
+                       get {
+                               double red, green, blue, alpha;
+                               NativeMethods.cairo_pattern_get_rgba  (Handle, out red, out green, out blue, out alpha);
+                               return new Color (red, green, blue, alpha);
+                       }
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Status.cs b/Crow/src/GraphicBackends/Mono.Cairo/Status.cs
new file mode 100644 (file)
index 0000000..2df1558
--- /dev/null
@@ -0,0 +1,64 @@
+//
+// Mono.Cairo.Status.cs
+//
+// Authors:
+//   Duncan Mak (duncan@ximian.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//   John Luke (john.luke@gmail.com)
+//   Alp Toker (alp@atoker.com)
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005 John Luke
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum Status
+       {
+               Success = 0,
+               NoMemory,
+               InvalidRestore,
+               InvalidPopGroup,
+               NoCurrentPoint,
+               InvalidMatrix,
+               InvalidStatus,
+               NullPointer,
+               InvalidString,
+               InvalidPathData,
+               ReadError,
+               WriteError,
+               SurfaceFinished,
+               SurfaceTypeMismatch,
+               PatternTypeMismatch,
+               InvalidContent,
+               InvalidFormat,
+               InvalidVisual,
+               FileNotFound,
+               InvalidDash,
+               InvalidDscComment,
+               InvalidIndex,
+               ClipNotRepresentable,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/SubpixelOrder.cs b/Crow/src/GraphicBackends/Mono.Cairo/SubpixelOrder.cs
new file mode 100644 (file)
index 0000000..95f3cbe
--- /dev/null
@@ -0,0 +1,42 @@
+//
+// Mono.Cairo.Cairo.cs
+//
+// Authors:
+//   John Luke (john.luke@gmail.com)
+//
+// Copyright (C) John Luke 2005
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo
+{
+       
+       public enum SubpixelOrder
+       {
+               Default,
+               Rgb,
+               Bgr,
+               Vrgb,
+               Vbgr,
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Surface.cs b/Crow/src/GraphicBackends/Mono.Cairo/Surface.cs
new file mode 100644 (file)
index 0000000..56c1553
--- /dev/null
@@ -0,0 +1,229 @@
+//
+// Mono.Cairo.Surface.cs
+//
+// Authors:
+//    Duncan Mak
+//    Miguel de Icaza.
+//    Alp Toker
+//
+// (C) Ximian Inc, 2003.
+// (C) Novell, Inc. 2003.
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+
+namespace Crow.Cairo {
+
+       public class Surface : IDisposable
+       {
+               IntPtr handle = IntPtr.Zero;
+
+               [Obsolete]
+               protected Surface()
+               {
+               }
+
+               [Obsolete]
+               protected Surface (IntPtr ptr) : this (ptr, true)
+               {
+               }
+
+               protected Surface (IntPtr handle, bool owner)
+               {
+                       this.handle = handle;
+                       if (!owner)
+                               NativeMethods.cairo_surface_reference (handle);
+                       if (CairoDebug.Enabled)
+                               CairoDebug.OnAllocated (handle);
+               }
+
+               public static Surface Lookup (IntPtr surface, bool owned)
+               {
+                       SurfaceType st = NativeMethods.cairo_surface_get_type (surface);
+                       switch (st) {
+                       case SurfaceType.Image:
+                               return new ImageSurface (surface, owned);
+                       case SurfaceType.Xlib:
+                               return new XlibSurface (surface, owned);
+                       case SurfaceType.Xcb:
+                               return new XcbSurface (surface, owned);
+                       case SurfaceType.Glitz:
+                               return new GlitzSurface (surface, owned);
+                       case SurfaceType.Win32:
+                               return new Win32Surface (surface, owned);
+                       case SurfaceType.Pdf:
+                               return new PdfSurface (surface, owned);
+                       case SurfaceType.PS:
+                               return new PSSurface (surface, owned);
+                       case SurfaceType.DirectFB:
+                               return new DirectFBSurface (surface, owned);
+                       case SurfaceType.Svg:
+                               return new SvgSurface (surface, owned);
+                       case SurfaceType.GL:
+                               return new GLSurface (surface, owned);
+                       default:
+                               return new Surface (surface, owned);
+                       }
+               }
+
+               [Obsolete ("Use an ImageSurface constructor instead.")]
+               public static Cairo.Surface CreateForImage (
+                       ref byte[] data, Cairo.Format format, int width, int height, int stride)
+               {
+                       IntPtr p = NativeMethods.cairo_image_surface_create_for_data (
+                               data, format, width, height, stride);
+
+                       return new Cairo.Surface (p, true);
+               }
+
+               [Obsolete ("Use an ImageSurface constructor instead.")]
+               public static Cairo.Surface CreateForImage (
+                       Cairo.Format format, int width, int height)
+               {
+                       IntPtr p = NativeMethods.cairo_image_surface_create (
+                               format, width, height);
+
+                       return new Cairo.Surface (p, true);
+               }
+
+
+               public Cairo.Surface CreateSimilar (
+                       Cairo.Content content, int width, int height)
+               {
+                       IntPtr p = NativeMethods.cairo_surface_create_similar (
+                               this.Handle, content, width, height);
+
+                       return Surface.Lookup(p, true);
+               }
+
+               ~Surface ()
+               {
+                       Dispose (false);
+               }
+
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || CairoDebug.Enabled)
+                               CairoDebug.OnDisposed<Surface> (handle, disposing);
+
+                       if (!disposing|| handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.cairo_surface_destroy (handle);
+                       handle = IntPtr.Zero;
+               }
+               public virtual void SetSize (int width, int height) {                   
+               }
+
+               public Status Finish ()
+               {
+                       NativeMethods.cairo_surface_finish (handle);
+                       return Status;
+               }
+
+               public void Flush ()
+               {
+                       NativeMethods.cairo_surface_flush (handle);
+               }
+
+               public void MarkDirty ()
+               {
+                       NativeMethods.cairo_surface_mark_dirty (Handle);
+               }
+
+               public void MarkDirty (Crow.Rectangle rectangle)
+               {
+                       NativeMethods.cairo_surface_mark_dirty_rectangle (Handle, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
+               }
+               public virtual int Width => -1;
+               public virtual int Height => -1;
+
+               public IntPtr Handle {
+                       get {
+                               return handle;
+                       }
+               }
+
+               public PointD DeviceOffset {
+                       get {
+                               double x, y;
+                               NativeMethods.cairo_surface_get_device_offset (handle, out x, out y);
+                               return new PointD (x, y);
+                       }
+
+                       set {
+                               NativeMethods.cairo_surface_set_device_offset (handle, value.X, value.Y);
+                       }
+               }
+
+               [Obsolete ("Use Dispose()")]
+               public void Destroy()
+               {
+                       Dispose ();
+               }
+
+               public void SetFallbackResolution (double x, double y)
+               {
+                       NativeMethods.cairo_surface_set_fallback_resolution (handle, x, y);
+               }
+
+               public void WriteToPng (string filename)
+               {
+                       NativeMethods.cairo_surface_write_to_png (handle, filename);
+               }
+
+               [Obsolete ("Use Handle instead.")]
+               public IntPtr Pointer {
+                       get {
+                               return handle;
+                       }
+               }
+
+               public Status Status {
+                       get { return NativeMethods.cairo_surface_status (handle); }
+               }
+
+               public Content Content {
+                       get { return NativeMethods.cairo_surface_get_content (handle); }
+               }
+
+               public SurfaceType SurfaceType {
+                       get { return NativeMethods.cairo_surface_get_type (handle); }
+               }
+
+               public uint ReferenceCount {
+                       get { return NativeMethods.cairo_surface_get_reference_count (handle); }
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/SurfacePattern.cs b/Crow/src/GraphicBackends/Mono.Cairo/SurfacePattern.cs
new file mode 100644 (file)
index 0000000..53a90d3
--- /dev/null
@@ -0,0 +1,57 @@
+//
+// Mono.Cairo.Pattern.cs
+//
+// Author: Jordi Mas (jordi@ximian.com)
+//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
+// (C) Ximian Inc, 2004.
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       public class SurfacePattern : Pattern
+       {
+               internal SurfacePattern (IntPtr handle, bool owned) : base (handle, owned)
+               {
+               }
+
+               public SurfacePattern (Surface surface)
+                       : base (NativeMethods.cairo_pattern_create_for_surface (surface.Handle), true)
+               {
+               }
+
+               //no idea why this is here, the base one is identical, but we can't remove it now
+               public new Extend Extend {
+                       set { NativeMethods.cairo_pattern_set_extend (Handle, value); }
+                       get { return NativeMethods.cairo_pattern_get_extend (Handle); }
+               }
+
+               public Filter Filter {
+                       set { NativeMethods.cairo_pattern_set_filter (Handle, value); }
+                       get { return NativeMethods.cairo_pattern_get_filter (Handle); }
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/SurfaceType.cs b/Crow/src/GraphicBackends/Mono.Cairo/SurfaceType.cs
new file mode 100644 (file)
index 0000000..bd992db
--- /dev/null
@@ -0,0 +1,61 @@
+//
+// Mono.Cairo.SurfaceType.cs
+//
+// Authors:
+//    John Luke
+//
+// (C) John Luke, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       
+       public enum SurfaceType
+       {
+               Image,
+               Pdf,
+               PS,
+               Xlib,
+               Xcb,
+               Glitz,
+               Quartz,
+               Win32,
+               BeOS,
+               DirectFB,
+               Svg,
+               OS2,
+               Win32Printing,
+               QuartzImage,
+               Script,
+               Qt,
+               Recording,
+               VG,
+               GL,
+               Drm,
+               Tee,
+               Xml,
+               Skia,
+               SubSurface
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/SvgSurface.cs b/Crow/src/GraphicBackends/Mono.Cairo/SvgSurface.cs
new file mode 100644 (file)
index 0000000..c7d7298
--- /dev/null
@@ -0,0 +1,50 @@
+//
+// Mono.Cairo.SvgSurface.cs
+//
+// Authors:
+//    John Luke
+//
+// (C) John Luke, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       public class SvgSurface : Surface
+       {
+               internal SvgSurface (IntPtr handle, bool owns) : base (handle, owns)
+               {
+               }
+
+               public SvgSurface (string filename, double width, double height)
+                       : base (NativeMethods.cairo_svg_surface_create (filename, width, height), true)
+               {
+               }
+
+               public void RestrictToVersion (SvgVersion version)
+               {
+                       NativeMethods.cairo_svg_surface_restrict_to_version (Handle, version);
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/SvgVersion.cs b/Crow/src/GraphicBackends/Mono.Cairo/SvgVersion.cs
new file mode 100644 (file)
index 0000000..916fb86
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// Mono.Cairo.SvgVersion.cs
+//
+// Authors:
+//    John Luke
+//
+// (C) John Luke, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       
+       public enum SvgVersion
+       {
+               // FIXME: yuck
+               OnePointOne = 0,
+               OnePointTwo,
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/TextExtents.cs b/Crow/src/GraphicBackends/Mono.Cairo/TextExtents.cs
new file mode 100644 (file)
index 0000000..965ca04
--- /dev/null
@@ -0,0 +1,98 @@
+//
+// Mono.Cairo.TextExtents.cs
+//
+// Authors:
+//   Duncan Mak (duncan@ximian.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Crow.Cairo
+{
+       [StructLayout (LayoutKind.Sequential)]
+       public struct TextExtents
+       {
+               double xbearing;
+               double ybearing;
+               double width;
+               double height;
+               double xadvance;
+               double yadvance;
+               
+               public double XBearing {
+                       get { return xbearing; }
+                       set { xbearing = value; }
+               }
+               
+               public double YBearing {
+                       get { return ybearing; }
+                       set { ybearing = value; }
+               }
+               
+               public double Width {
+                       get { return width; }
+                       set { width = value; }
+               }
+               
+               public double Height {
+                       get { return height; }
+                       set { height = value; }
+               }
+               
+               public double XAdvance {
+                       get { return xadvance; }
+                       set { xadvance = value; }
+               }
+               
+               public double YAdvance {
+                       get { return yadvance; }
+                       set { yadvance = value; }
+               }
+
+               public override bool Equals (object obj)
+               {
+                       if (obj is TextExtents)
+                               return this == (TextExtents)obj;
+                       return false;
+               }
+
+               public override int GetHashCode ()
+               {
+                       return (int)XBearing ^ (int)YBearing ^ (int)Width ^ (int)Height ^ (int)XAdvance ^ (int)YAdvance;
+               }
+
+               public static bool operator == (TextExtents extents, TextExtents other)
+               {
+                       return extents.XBearing == other.XBearing && extents.YBearing == other.YBearing && extents.Width == other.Width && extents.Height == other.Height && extents.XAdvance == other.XAdvance && extents.YAdvance == other.YAdvance;
+               }
+
+               public static bool operator != (TextExtents extents, TextExtents other)
+               {
+                       return !(extents == other);
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/WGLDevice.cs b/Crow/src/GraphicBackends/Mono.Cairo/WGLDevice.cs
new file mode 100644 (file)
index 0000000..308cfad
--- /dev/null
@@ -0,0 +1,45 @@
+//
+// Mono.Cairo.Device.cs
+//
+// Authors:
+//                     JP Bruyère (jp_bruyere@hotmail.com)
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2016 JP Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+
+namespace Crow.Cairo
+{
+       public class WGLDevice : Device
+       {
+               public WGLDevice (IntPtr hglrc) : base (NativeMethods.cairo_wgl_device_create (hglrc), true)
+               {
+               }
+
+               public IntPtr Context {
+                       get { return NativeMethods.cairo_wgl_device_get_context (Handle); }
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/Win32Surface.cs b/Crow/src/GraphicBackends/Mono.Cairo/Win32Surface.cs
new file mode 100644 (file)
index 0000000..4776a19
--- /dev/null
@@ -0,0 +1,44 @@
+//
+// Mono.Cairo.Win32Surface.cs
+//
+// Authors:
+//    John Luke
+//
+// (C) John Luke, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+       
+       public class Win32Surface : Surface
+       {
+               internal Win32Surface (IntPtr handle, bool owns) : base (handle, owns)
+               {
+               }
+               
+               public Win32Surface (IntPtr hdc)
+                       : base (NativeMethods.cairo_win32_surface_create (hdc), true)
+               {
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/XcbSurface.cs b/Crow/src/GraphicBackends/Mono.Cairo/XcbSurface.cs
new file mode 100644 (file)
index 0000000..32a6784
--- /dev/null
@@ -0,0 +1,53 @@
+//
+// Mono.Cairo.XcbSurface.cs
+//
+// Authors:
+//    Alp Toker
+//
+// (C) Alp Toker, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+       public class XcbSurface : Surface
+       {
+               internal XcbSurface (IntPtr handle, bool owns) : base (handle, owns)
+               {
+               }
+
+               public XcbSurface (IntPtr connection, uint drawable, IntPtr visual, int width, int height)
+                       : base (NativeMethods.cairo_xcb_surface_create (connection, drawable, visual, width, height), true)
+               {
+               }
+
+               public static XcbSurface FromBitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height)
+               {
+                       IntPtr ptr = NativeMethods.cairo_xcb_surface_create_for_bitmap (connection, bitmap, screen, width, height);
+                       return new XcbSurface (ptr, true);
+               }
+               public override void SetSize (int width, int height)
+               {                       
+                       NativeMethods.cairo_xcb_surface_set_size (Handle, width, height);
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/Mono.Cairo/XlibSurface.cs b/Crow/src/GraphicBackends/Mono.Cairo/XlibSurface.cs
new file mode 100644 (file)
index 0000000..18e810b
--- /dev/null
@@ -0,0 +1,77 @@
+//
+// Mono.Cairo.XlibSurface.cs
+//
+// Authors:
+//    Duncan Mak
+//    Miguel de Icaza.
+//       JP Bruyère
+//
+// (C) Ximian Inc, 2003.
+// (C) Novell, Inc. 2003.
+// (C) JP Bruyère 2021
+//
+// This is an OO wrapper API for the Cairo API
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Crow.Cairo {
+
+       public class XlibSurface : Surface
+       {
+               public XlibSurface (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height)
+                       : base (NativeMethods.cairo_xlib_surface_create (display, drawable, visual, width, height), true)
+               {
+               }
+
+               public XlibSurface (IntPtr ptr, bool own) : base (ptr, own)
+               {
+               }
+
+               public static XlibSurface FromBitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height)
+               {
+                       IntPtr ptr = NativeMethods.cairo_xlib_surface_create_for_bitmap (display, bitmap, screen, width, height);
+                       return new XlibSurface(ptr, true);
+               }
+
+               public void SetDrawable (IntPtr drawable, int width, int height)
+               {
+                       NativeMethods.cairo_xlib_surface_set_drawable (Handle, drawable, width, height);
+               }
+
+               public override void SetSize (int width, int height)
+               {
+                       NativeMethods.cairo_xlib_surface_set_size (Handle, width, height);
+               }
+
+               public int Depth => NativeMethods.cairo_xlib_surface_get_depth (Handle);
+               public IntPtr Display => NativeMethods.cairo_xlib_surface_get_display (Handle);
+               public IntPtr Drawable => NativeMethods.cairo_xlib_surface_get_drawable (Handle);
+               public override int Width => NativeMethods.cairo_xlib_surface_get_width (Handle);               
+               public override int Height => NativeMethods.cairo_xlib_surface_get_height (Handle);             
+
+               public IntPtr Screen => NativeMethods.cairo_xlib_surface_get_screen (Handle);
+               public IntPtr Visual=> NativeMethods.cairo_xlib_surface_get_visual (Handle);
+       }
+}
diff --git a/Crow/src/GraphicBackends/vkvg/Context.cs b/Crow/src/GraphicBackends/vkvg/Context.cs
new file mode 100644 (file)
index 0000000..482dfe1
--- /dev/null
@@ -0,0 +1,347 @@
+// Copyright (c) 2018-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+using System.Text;
+using Crow;
+
+namespace vkvg
+{
+       public class Context : IDisposable
+       {
+
+               IntPtr handle = IntPtr.Zero;
+
+               public Context(Surface surf)
+               {
+                       handle = NativeMethods.vkvg_create(surf.Handle);
+               }
+               ~Context()
+               {
+                       Dispose(false);
+               }
+
+               public IntPtr Handle => handle;
+
+               public void AddReference()
+               {
+                       NativeMethods.vkvg_reference(handle);
+               }
+               public uint References() => NativeMethods.vkvg_get_reference_count(handle);
+
+               public double LineWidth
+               {
+                       get => NativeMethods.vkvg_get_line_width(handle);
+                       set { NativeMethods.vkvg_set_line_width(handle, (float)value); }
+               }
+               public LineJoin LineJoin
+               {
+                       get => NativeMethods.vkvg_get_line_join(handle);
+                       set { NativeMethods.vkvg_set_line_join(handle, value); }
+               }
+               public LineCap LineCap
+               {
+                       get => NativeMethods.vkvg_get_line_cap(handle);
+                       set { NativeMethods.vkvg_set_line_cap(handle, value); }
+               }
+               public uint FontSize
+               {
+                       set { NativeMethods.vkvg_set_font_size(handle, value); }
+               }
+               public string FontFace
+               {
+                       set { NativeMethods.vkvg_select_font_face(handle, value); }
+               }
+               public Operator Operator
+               {
+                       set { NativeMethods.vkvg_set_operator(handle, value); }
+                       get { return NativeMethods.vkvg_get_operator(handle); }
+               }
+               public FillRule FillRule
+               {
+                       set { NativeMethods.vkvg_set_fill_rule(handle, value); }
+                       get { return NativeMethods.vkvg_get_fill_rule(handle); }
+               }
+               public FontExtents FontExtents
+               {
+                       get
+                       {
+                               FontExtents f_extents;
+                               NativeMethods.vkvg_font_extents(handle, out f_extents);
+                               return f_extents;
+                       }
+               }
+               public TextExtents TextExtents(string s)
+               {
+                       TextExtents extents = default(TextExtents);
+                       if (!string.IsNullOrEmpty(s))
+                               NativeMethods.vkvg_text_extents(handle, TerminateUtf8(s), out extents);
+                       return extents;
+               }
+               public Matrix Matrix
+               {
+                       get
+                       {
+                               Matrix m;
+                               NativeMethods.vkvg_get_matrix(handle, out m);
+                               return m;
+                       }
+                       set
+                       {
+                               NativeMethods.vkvg_set_matrix(handle, ref value);
+                       }
+               }
+               public void ShowText(string txt)
+               {
+                       NativeMethods.vkvg_show_text(handle, TerminateUtf8(txt));
+               }
+               public void ShowText(TextRun textRun)
+               {
+                       NativeMethods.vkvg_show_text_run(handle, textRun.Handle);
+               }
+               public void Save()
+               {
+                       NativeMethods.vkvg_save(handle);
+               }
+               public void Restore()
+               {
+                       NativeMethods.vkvg_restore(handle);
+               }
+               public void Flush()
+               {
+                       NativeMethods.vkvg_flush(handle);
+               }
+               public void Clear()
+               {
+                       NativeMethods.vkvg_clear(handle);
+               }
+               public void Paint()
+               {
+                       NativeMethods.vkvg_paint(handle);
+               }
+               public void Arc(float xc, float yc, float radius, float a1, float a2)
+               {
+                       NativeMethods.vkvg_arc(handle, xc, yc, radius, a1, a2);
+               }
+               public void Arc(double xc, double yc, double radius, double a1, double a2)
+               {
+                       NativeMethods.vkvg_arc(handle, (float)xc, (float)yc, (float)radius, (float)a1, (float)a2);
+               }
+               public void ArcNegative(float xc, float yc, float radius, float a1, float a2)
+               {
+                       NativeMethods.vkvg_arc_negative(handle, xc, yc, radius, a1, a2);
+               }
+               public void Rectangle(float x, float y, float width, float height)
+               {
+                       NativeMethods.vkvg_rectangle(handle, x, y, width, height);
+               }
+               public void Scale(float sx, float sy)
+               {
+                       NativeMethods.vkvg_scale(handle, sx, sy);
+               }
+               public void Translate(float dx, float dy)
+               {
+                       NativeMethods.vkvg_translate(handle, dx, dy);
+               }
+               public void Rotate(float alpha)
+               {
+                       NativeMethods.vkvg_rotate(handle, alpha);
+               }
+               public void ArcNegative(double xc, double yc, double radius, double a1, double a2)
+               {
+                       NativeMethods.vkvg_arc_negative(handle, (float)xc, (float)yc, (float)radius, (float)a1, (float)a2);
+               }
+               public void Rectangle(double x, double y, double width, double height)
+               {
+                       NativeMethods.vkvg_rectangle(handle, (float)x, (float)y, (float)width, (float)height);
+               }
+               public void Scale(double sx, double sy)
+               {
+                       NativeMethods.vkvg_scale(handle, (float)sx, (float)sy);
+               }
+               public void Translate(double dx, double dy)
+               {
+                       NativeMethods.vkvg_translate(handle, (float)dx, (float)dy);
+               }
+               public void Translate(PointD p)
+               {
+                       NativeMethods.vkvg_translate(handle, (float)p.X, (float)p.Y);
+               }
+               public void Rotate(double alpha)
+               {
+                       NativeMethods.vkvg_rotate(handle, (float)alpha);
+               }
+
+               public void Fill()
+               {
+                       NativeMethods.vkvg_fill(handle);
+               }
+               public void FillPreserve()
+               {
+                       NativeMethods.vkvg_fill_preserve(handle);
+               }
+               public void Stroke()
+               {
+                       NativeMethods.vkvg_stroke(handle);
+               }
+               public void StrokePreserve()
+               {
+                       NativeMethods.vkvg_stroke_preserve(handle);
+               }
+               public void Clip()
+               {
+                       NativeMethods.vkvg_clip(handle);
+               }
+               public void ClipPreserve()
+               {
+                       NativeMethods.vkvg_clip_preserve(handle);
+               }
+               public void ResetClip()
+               {
+                       NativeMethods.vkvg_reset_clip(handle);
+               }
+               public void NewPath()
+               {
+                       NativeMethods.vkvg_new_path(handle);
+               }
+               public void NewSubPath()
+               {
+                       NativeMethods.vkvg_new_sub_path(handle);
+               }
+               public void ClosePath()
+               {
+                       NativeMethods.vkvg_close_path(handle);
+               }
+               public void MoveTo(PointD p)
+               {
+                       NativeMethods.vkvg_move_to(handle, (float)p.X, (float)p.Y);
+               }
+               public void MoveTo(Point p)
+               {
+                       NativeMethods.vkvg_move_to(handle, p.X, p.Y);
+               }
+               public void MoveTo(float x, float y)
+               {
+                       NativeMethods.vkvg_move_to(handle, x, y);
+               }
+               public void RelMoveTo(float x, float y)
+               {
+                       NativeMethods.vkvg_rel_move_to(handle, x, y);
+               }
+               public void LineTo(float x, float y)
+               {
+                       NativeMethods.vkvg_line_to(handle, x, y);
+               }
+               public void LineTo(Point p)
+               {
+                       NativeMethods.vkvg_line_to(handle, p.X, p.Y);
+               }
+               public void LineTo(PointD p)
+               {
+                       NativeMethods.vkvg_line_to(handle, (float)p.X, (float)p.Y);
+               }
+               public void RelLineTo(float x, float y)
+               {
+                       NativeMethods.vkvg_rel_line_to(handle, x, y);
+               }
+               public void CurveTo(float x1, float y1, float x2, float y2, float x3, float y3)
+               {
+                       NativeMethods.vkvg_curve_to(handle, x1, y1, x2, y2, x3, y3);
+               }
+               public void RelCurveTo(float x1, float y1, float x2, float y2, float x3, float y3)
+               {
+                       NativeMethods.vkvg_rel_curve_to(handle, x1, y1, x2, y2, x3, y3);
+               }
+
+               public void MoveTo(double x, double y)
+               {
+                       NativeMethods.vkvg_move_to(handle, (float)x, (float)y);
+               }
+               public void RelMoveTo(double x, double y)
+               {
+                       NativeMethods.vkvg_rel_move_to(handle, (float)x, (float)y);
+               }
+               public void LineTo(double x, double y)
+               {
+                       NativeMethods.vkvg_line_to(handle, (float)x, (float)y);
+               }
+               public void RelLineTo(double x, double y)
+               {
+                       NativeMethods.vkvg_rel_line_to(handle, (float)x, (float)y);
+               }
+               public void CurveTo(double x1, double y1, double x2, double y2, double x3, double y3)
+               {
+                       NativeMethods.vkvg_curve_to(handle, (float)x1, (float)y1, (float)x2, (float)y2, (float)x3, (float)y3);
+               }
+               public void RelCurveTo(double x1, double y1, double x2, double y2, double x3, double y3)
+               {
+                       NativeMethods.vkvg_rel_curve_to(handle, (float)x1, (float)y1, (float)x2, (float)y2, (float)x3, (float)y3);
+               }
+
+               public void SetSource(Pattern pat)
+               {
+                       NativeMethods.vkvg_set_source(handle, pat.Handle);
+               }
+               public void SetSource (Color color)
+               {
+                       NativeMethods.vkvg_set_source_rgba (handle, (float)(color.R / 255.0), (float)(color.G / 255.0), (float)(color.B / 255.0), (float)(color.A / 255.0));
+               }
+               public void SetSource(float r, float g, float b, float a = 1f)
+               {
+                       NativeMethods.vkvg_set_source_rgba(handle, r, g, b, a);
+               }
+               public void SetSource(double r, double g, double b, double a = 1.0)
+               {
+                       NativeMethods.vkvg_set_source_rgba(handle, (float)r, (float)g, (float)b, (float)a);
+               }
+               public void SetSource(Surface surf, float x = 0f, float y = 0f)
+               {
+                       NativeMethods.vkvg_set_source_surface(handle, surf.Handle, x, y);
+               }
+               public void SetSourceSurface(Surface surf, float x = 0f, float y = 0f)
+               {
+                       NativeMethods.vkvg_set_source_surface(handle, surf.Handle, x, y);
+               }
+               public void RenderSvg(IntPtr nsvgImage, string subId = null)
+               {
+                       NativeMethods.vkvg_render_svg(handle, nsvgImage, subId);
+               }
+               internal static byte[] TerminateUtf8(string s)
+               {
+                       // compute the byte count including the trailing \0
+                       var byteCount = Encoding.UTF8.GetMaxByteCount(s.Length + 1);
+                       var bytes = new byte[byteCount];
+                       Encoding.UTF8.GetBytes(s, 0, s.Length, bytes, 0);
+                       return bytes;
+               }
+
+               public float[] Dashes
+               {
+                       set
+                       {
+                               if (value == null)
+                                       NativeMethods.vkvg_set_dash(handle, null, 0, 0);
+                               else
+                                       NativeMethods.vkvg_set_dash(handle, value, (uint)value.Length, 0);
+                       }
+               }
+               #region IDisposable implementation
+               public void Dispose()
+               {
+                       Dispose(true);
+                       GC.SuppressFinalize(this);
+               }
+
+               protected virtual void Dispose(bool disposing)
+               {
+                       if (!disposing || handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.vkvg_destroy(handle);
+                       handle = IntPtr.Zero;
+               }
+               #endregion
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/vkvg/Device.cs b/Crow/src/GraphicBackends/vkvg/Device.cs
new file mode 100644 (file)
index 0000000..84eea51
--- /dev/null
@@ -0,0 +1,56 @@
+// Copyright (c) 2018-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+
+namespace vkvg
+{
+       public class Device: IDisposable
+       {
+
+               IntPtr handle = IntPtr.Zero;
+
+               #region CTORS & DTOR
+               public Device (IntPtr instance, IntPtr phy, IntPtr dev, uint qFamIdx, SampleCount samples = SampleCount.Sample_1, uint qIndex = 0)
+               {
+                       handle = NativeMethods.vkvg_device_create_multisample (instance, phy, dev, qFamIdx, qIndex, samples, false);
+               }
+               ~Device ()
+               {
+                       Dispose (false);
+               }
+               #endregion
+
+               public void GetDpy (out int hdpy, out int vdpy) {
+                       NativeMethods.vkvg_device_get_dpy (handle, out hdpy, out vdpy);
+               }
+               public void SetDpy (int hdpy, int vdpy) {
+                       NativeMethods.vkvg_device_set_dpy (handle, hdpy, vdpy);
+               }
+               public void AddReference () {
+                       NativeMethods.vkvg_device_reference (handle);
+               }
+               public uint References () => NativeMethods.vkvg_device_get_reference_count (handle);
+
+               public IntPtr Handle { get { return handle; }}
+
+               #region IDisposable implementation
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.vkvg_device_destroy (handle);
+                       handle = IntPtr.Zero;
+               }
+               #endregion
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/vkvg/Enums.cs b/Crow/src/GraphicBackends/vkvg/Enums.cs
new file mode 100644 (file)
index 0000000..41c5eb9
--- /dev/null
@@ -0,0 +1,143 @@
+// Copyright (c) 2018-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+
+namespace vkvg
+{
+    public enum Status
+    {
+        Success = 0,
+        NoMemory,
+        InvalidRestore,
+        InvalidPopGroup,
+        NoCurrentPoint,
+        InvalidMatrix,
+        InvalidStatus,
+        NullPointer,
+        InvalidString,
+        InvalidPathData,
+        ReadError,
+        WriteError,
+        SurfaceFinished,
+        SurfaceTypeMismatch,
+        PatternTypeMismatch,
+        InvalidContent,
+        InvalidFormat,
+        InvalidVisual,
+        FileNotFound,
+        InvalidDash
+    }
+
+    public enum Direction
+    {
+        Horizontal = 0,
+        Vertical = 1
+    }
+
+    public enum Format
+    {
+        ARGB32,
+        RGB24,
+        A8,
+        A1
+    }
+
+    public enum Extend
+    {
+        None,
+        Repeat,
+        Reflect,
+        Pad
+    }
+
+    public enum Filter
+    {
+        Fast,
+        Good,
+        Best,
+        Nearest,
+        Bilinear,
+        Gaussian,
+    }
+
+    public enum PatternType
+    {
+        Solid,
+        Surface,
+        Linear,
+        Radial,
+        Mesh,
+        RasterSource,
+    }
+
+    public enum Operator
+    {
+        Clear,
+        Source,
+        Over,
+        In,
+        Out,
+        Atop,
+
+        Dest,
+        DestOver,
+        DestIn,
+        DestOut,
+        DestAtop,
+
+        Xor,
+        Add,
+        Saturate,
+    }
+
+    public enum FontSlant
+    {
+        Normal,
+        Italic,
+        Oblique
+    }
+    public enum FontWeight
+    {
+        Normal,
+        Bold,
+    }
+
+    public enum SampleCount
+    {
+        Sample_1 = 0x00000001,
+        Sample_2 = 0x00000002,
+        Sample_4 = 0x00000004,
+        Sample_8 = 0x00000008,
+        Sample_16 = 0x00000010,
+        Sample_32 = 0x00000020,
+        Sample_64 = 0x00000040
+    }
+
+    public enum LineCap
+    {
+        Butt,
+        Round,
+        Square
+    }
+
+    public enum LineJoin
+    {
+        Miter,
+        Round,
+        Bevel
+    }
+    public enum FillRule
+    {
+        EvenOdd,
+        NonZero,
+    }
+       public enum Antialias
+       {
+               Default,
+               None,
+               Grey,
+               Subpixel,
+       }
+}
\ No newline at end of file
diff --git a/Crow/src/GraphicBackends/vkvg/FontExtents.cs b/Crow/src/GraphicBackends/vkvg/FontExtents.cs
new file mode 100644 (file)
index 0000000..41b025d
--- /dev/null
@@ -0,0 +1,106 @@
+//
+// from Mono.Cairo.FontExtents.cs
+//
+// Authors: Duncan Mak (duncan@ximian.com)
+//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//
+// (C) Ximian, Inc. 2003
+//
+// This is a simplistic binding of the Cairo API to C#. All functions
+// in cairo.h are transcribed into their C# equivelants
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2018-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+using System;
+using System.Runtime.InteropServices;
+
+namespace vkvg
+{
+       [StructLayout (LayoutKind.Sequential)]
+       public struct FontExtents
+       {
+               float ascent;
+               float descent;
+               float height;
+               float maxXAdvance;
+               float maxYAdvance;
+               
+               public float Ascent {
+                       get { return ascent; }
+                       set { ascent = value; }
+               }
+               
+               public float Descent {
+                       get { return descent; }
+                       set { descent = value; }
+               }
+               
+               public float Height {
+                       get { return height; }
+                       set { height = value; }
+               }
+               
+               public float MaxXAdvance {
+                       get { return maxXAdvance; }
+                       set { maxXAdvance = value; }
+               }
+               
+               public float MaxYAdvance {
+                       get { return maxYAdvance; }
+                       set { maxYAdvance = value; }
+               }
+
+               public FontExtents (float ascent, float descent, float height, float maxXAdvance, float maxYAdvance)
+               {
+                       this.ascent = ascent;
+                       this.descent = descent;
+                       this.height = height;
+                       this.maxXAdvance = maxXAdvance;
+                       this.maxYAdvance = maxYAdvance;
+               }
+
+               public override bool Equals (object obj)
+               {
+                       if (obj is FontExtents)
+                               return this == (FontExtents) obj;
+                       return false;
+               }
+
+               public override int GetHashCode ()
+               {
+                       return (int) Ascent ^ (int) Descent ^ (int) Height ^ (int) MaxXAdvance ^ (int) MaxYAdvance;
+               }
+
+               public static bool operator == (FontExtents extents, FontExtents other)
+               {
+                       return extents.Ascent == other.Ascent && extents.Descent == other.Descent && extents.Height == other.Height && extents.MaxXAdvance == other.MaxXAdvance && extents.MaxYAdvance == other.MaxYAdvance;
+               }
+
+               public static bool operator != (FontExtents extents, FontExtents other)
+               {
+                       return !(extents == other);
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/vkvg/Matrix.cs b/Crow/src/GraphicBackends/vkvg/Matrix.cs
new file mode 100644 (file)
index 0000000..12e9e38
--- /dev/null
@@ -0,0 +1,92 @@
+// Copyright (c) 2018-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+namespace vkvg {
+       public struct Matrix {
+               float xx; float yx;
+               float xy; float yy;
+               float x0; float y0;
+
+               public float XX { get { return xx; } set { xx = value; } }
+               public float YX { get { return yx; } set { yx = value; } }
+               public float XY { get { return xy; } set { xy = value; } }
+               public float YY { get { return yy; } set { yy = value; } }
+               public float X0 { get { return x0; } set { x0 = value; } }
+               public float Y0 { get { return y0; } set { y0 = value; } }
+
+               public static Matrix Create (float xx, float yx, float xy, float yy, float x0, float y0) {
+                       Matrix tmp;
+                       NativeMethods.vkvg_matrix_init (out tmp, xx, yx, xy, yy, x0, y0);
+                       return tmp;
+               }
+               public static Matrix CreateTranslation (float tx, float ty) {
+                       Matrix tmp;
+                       NativeMethods.vkvg_matrix_init_translate (out tmp, tx, ty);
+                       return tmp;
+               }
+               public static Matrix CreateRotation (float radian) {
+                       Matrix tmp;
+                       NativeMethods.vkvg_matrix_init_rotate (out tmp, radian);
+                       return tmp;
+               }
+               public static Matrix CreateScale (float sx, float sy) {
+                       Matrix tmp;
+                       NativeMethods.vkvg_matrix_init_scale (out tmp, sx, sy);
+                       return tmp;
+               }
+               public static Matrix Identity {
+                       get {
+                               Matrix tmp;
+                               NativeMethods.vkvg_matrix_init_identity (out tmp);
+                               return tmp;
+                       }
+               }
+
+               public void Translate (float tx, float ty) {
+                       Matrix tmp = this;
+                       NativeMethods.vkvg_matrix_translate (ref tmp, tx, ty);
+                       xx = tmp.xx; yx = tmp.yx;
+                       xy = tmp.xy; yy = tmp.yy;
+                       x0 = tmp.x0; y0 = tmp.y0;
+               }
+               public void Rotate (float radian) {
+                       Matrix tmp = this;
+                       NativeMethods.vkvg_matrix_rotate (ref tmp, radian);
+                       xx = tmp.xx; yx = tmp.yx;
+                       xy = tmp.xy; yy = tmp.yy;
+                       x0 = tmp.x0; y0 = tmp.y0;
+               }
+               public void Scale (float sx, float sy) {
+                       Matrix tmp = this;
+                       NativeMethods.vkvg_matrix_scale (ref tmp, sx, sy);
+                       xx = tmp.xx; yx = tmp.yx;
+                       xy = tmp.xy; yy = tmp.yy;
+                       x0 = tmp.x0; y0 = tmp.y0;
+               }
+               public void Invert () {
+                       Matrix tmp = this;
+                       NativeMethods.vkvg_matrix_invert (ref tmp);
+                       xx = tmp.xx; yx = tmp.yx;
+                       xy = tmp.xy; yy = tmp.yy;
+                       x0 = tmp.x0; y0 = tmp.y0;
+               }
+               public void TransformDistance (ref float dx, ref float dy) {
+                       NativeMethods.vkvg_matrix_transform_distance (ref this, ref dx, ref dy);
+               }
+               public void TransformPoint (ref float px, ref float py) {
+                       NativeMethods.vkvg_matrix_transform_distance (ref this, ref px, ref py);
+               }
+
+               public static Matrix operator *(Matrix a, Matrix b) {
+                       Matrix tmp;
+                       NativeMethods.vkvg_matrix_multiply (out tmp, ref a, ref b);
+                       return tmp;
+               }
+
+               public override string ToString () {
+                       return string.Format ($"({xx};{yx};{xy};{yy};{x0};{y0})");
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/vkvg/NativeMethods.cs b/Crow/src/GraphicBackends/vkvg/NativeMethods.cs
new file mode 100644 (file)
index 0000000..48f2eb6
--- /dev/null
@@ -0,0 +1,272 @@
+// Copyright (c) 2018-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace vkvg
+{
+    internal static class NativeMethods
+    {
+        const string libvkvg = "vkvg";
+
+        #region Device
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_device_create(IntPtr instance, IntPtr phy, IntPtr dev, uint qFamIdx, uint qIndex);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_device_destroy(IntPtr device);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_device_create_multisample(IntPtr inst, IntPtr phy, IntPtr vkdev, uint qFamIdx, uint qIndex, SampleCount samples, bool deferredResolve);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_device_reference(IntPtr dev);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern uint vkvg_device_get_reference_count(IntPtr dev);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_device_set_dpy(IntPtr dev, int hdpy, int vdpy);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_device_get_dpy(IntPtr dev, out int hdpy, out int vdpy);
+        #endregion
+
+        #region Context
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_create(IntPtr surface);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_destroy(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_flush(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_new_path(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_new_sub_path(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_close_path(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_line_to(IntPtr ctx, float x, float y);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_rel_line_to(IntPtr ctx, float x, float y);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_move_to(IntPtr ctx, float x, float y);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_rel_move_to(IntPtr ctx, float x, float y);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_arc(IntPtr ctx, float xc, float yc, float radius, float a1, float a2);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_arc_negative(IntPtr ctx, float xc, float yc, float radius, float a1, float a2);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_curve_to(IntPtr ctx, float x1, float y1, float x2, float y2, float x3, float y3);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_rel_curve_to(IntPtr ctx, float x1, float y1, float x2, float y2, float x3, float y3);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_rectangle(IntPtr ctx, float x, float y, float width, float height);
+
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_scale(IntPtr ctx, float sx, float sy);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_translate(IntPtr ctx, float dx, float dy);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_rotate(IntPtr ctx, float alpha);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_transform(IntPtr ctx, ref Matrix matrix);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_set_matrix(IntPtr ctx, ref Matrix matrix);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_get_matrix(IntPtr ctx, out Matrix matrix);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_identity_matrix(IntPtr ctx);
+
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_stroke(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_stroke_preserve(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_clip(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_clip_preserve(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_reset_clip(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_fill(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_fill_preserve(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_paint(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_set_source_rgba(IntPtr ctx, float r, float g, float b, float a);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_set_line_width(IntPtr ctx, float width);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_set_line_cap(IntPtr ctx, LineCap cap);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_set_line_join(IntPtr ctx, LineJoin join);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_set_operator(IntPtr ctx, Operator op);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern FillRule vkvg_get_fill_rule(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_set_fill_rule(IntPtr ctx, FillRule fr);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern Operator vkvg_get_operator(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_set_source_surface(IntPtr ctx, IntPtr surf, float x, float y);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_set_source(IntPtr ctx, IntPtr pattern);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_font_extents(IntPtr ctx, out FontExtents extents);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_text_extents(IntPtr ctx, byte[] utf8, out TextExtents extents);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_select_font_face(IntPtr ctx, string name);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_set_font_size(IntPtr ctx, uint size);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_show_text(IntPtr ctx, byte [] utf8);
+
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_save(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_restore(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_clear(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern float vkvg_get_line_width(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern LineCap vkvg_get_line_cap(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern LineJoin vkvg_get_line_join(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_get_source(IntPtr ctx);
+
+               [DllImport (libvkvg, CallingConvention = CallingConvention.Cdecl)]
+               internal static extern void vkvg_set_dash (IntPtr ctx, float[] dashes, uint dashCount, float offset);
+
+               //void vkvg_set_dash (VkvgContext ctx, const float* dashes, uint32_t num_dashes, float offset);
+               //void vkvg_get_dash (VkvgContext ctx, const float* dashes, uint32_t* num_dashes, float* offset
+
+          [DllImport (libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_reference(IntPtr ctx);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern uint vkvg_get_reference_count(IntPtr ctx);
+        #endregion
+
+        #region TextRun
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_text_run_create(IntPtr ctx, byte[] utf8);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_text_run_destroy(IntPtr textRun);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_show_text_run(IntPtr ctx, IntPtr textRun);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_text_run_get_extents(IntPtr textRun, out TextExtents extents);
+        #endregion
+
+        #region Pattern
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_pattern_create();
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_pattern_reference(IntPtr pat);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern uint vkvg_pattern_get_reference_count(IntPtr pat);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_pattern_create_rgba(float r, float g, float b, float a);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_pattern_create_rgb(float r, float g, float b);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_pattern_create_for_surface(IntPtr surf);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_pattern_create_linear(float x0, float y0, float x1, float y1);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_pattern_create_radial(float cx0, float cy0, float radius0,
+                                             float cx1, float cy1, float radius1);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_pattern_destroy(IntPtr pat);
+
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_pattern_add_color_stop(IntPtr pat, float offset, float r, float g, float b, float a);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_pattern_set_extend(IntPtr pat, Extend extend);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_pattern_set_filter(IntPtr pat, Filter filter);
+
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern Extend vkvg_pattern_get_extend(IntPtr pat);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern Filter vkvg_pattern_get_filter(IntPtr pat);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern PatternType vkvg_pattern_get_type(IntPtr pat);
+        #endregion
+
+        #region Matrices
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_init_identity(out Matrix matrix);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_init(out Matrix matrix,
+           float xx, float yx,
+           float xy, float yy,
+           float x0, float y0);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_init_translate(out Matrix matrix, float tx, float ty);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_init_scale(out Matrix matrix, float sx, float sy);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_init_rotate(out Matrix matrix, float radians);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_translate(ref Matrix matrix, float tx, float ty);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_scale(ref Matrix matrix, float sx, float sy);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_rotate(ref Matrix matrix, float radians);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_multiply(out Matrix result, ref Matrix a, ref Matrix b);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_transform_distance(ref Matrix matrix, ref float dx, ref float dy);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_transform_point(ref Matrix matrix, ref float x, ref float y);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_matrix_invert(ref Matrix matrix);
+        #endregion
+
+        #region Surface
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_surface_create(IntPtr device, uint width, uint height);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_surface_create_from_image(IntPtr dev, string filePath);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_surface_create_from_svg(IntPtr dev, string filePath);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_surface_create_from_svg_fragment(IntPtr dev, byte[] filePath);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_surface_create_from_bitmap(IntPtr dev, ref byte[] data, uint width, uint height);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_surface_destroy(IntPtr surf);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_surface_get_vk_image(IntPtr surf);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int vkvg_surface_get_width(IntPtr surf);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int vkvg_surface_get_height(IntPtr surf);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_surface_clear(IntPtr surf);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr vkvg_surface_reference(IntPtr surf);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern uint vkvg_surface_get_reference_count(IntPtr surf);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_surface_write_to_png(IntPtr surf, [MarshalAs(UnmanagedType.LPStr)]string path);
+        #endregion
+
+        #region NSVG
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr nsvg_load_file(IntPtr dev, string filePath);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern IntPtr nsvg_load(IntPtr dev, byte[] fragment);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void nsvg_destroy(IntPtr nsvgImage);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void nsvg_get_size(IntPtr nsvgImage, out int width, out int height);
+        [DllImport(libvkvg, CallingConvention = CallingConvention.Cdecl)]
+        internal static extern void vkvg_render_svg(IntPtr ctx, IntPtr nsvgImage, string subId);
+        #endregion
+    }
+}
+
diff --git a/Crow/src/GraphicBackends/vkvg/Pattern.cs b/Crow/src/GraphicBackends/vkvg/Pattern.cs
new file mode 100644 (file)
index 0000000..a66ffdc
--- /dev/null
@@ -0,0 +1,92 @@
+// Copyright (c) 2018-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+namespace vkvg
+{
+    public class Pattern : IDisposable
+    {
+
+        IntPtr handle = IntPtr.Zero;
+
+        #region CTORS & DTOR
+        protected Pattern(IntPtr handle)
+        {
+            this.handle = handle;
+        }
+        public Pattern()
+        {
+            handle = NativeMethods.vkvg_pattern_create();
+        }
+        public Pattern(float r, float g, float b)
+        {
+            handle = NativeMethods.vkvg_pattern_create_rgb(r, g, b);
+        }
+        public Pattern(float r, float g, float b, float a)
+        {
+            handle = NativeMethods.vkvg_pattern_create_rgba(r, g, b, a);
+        }
+        public Pattern(Surface surf)
+        {
+            handle = NativeMethods.vkvg_pattern_create_for_surface(surf.Handle);
+        }
+
+        ~Pattern()
+        {
+            Dispose(false);
+        }
+        #endregion
+
+        public static Pattern CreateLinearGradient(float x0, float y0, float x1, float y1)
+        {
+            return new Pattern(NativeMethods.vkvg_pattern_create_linear(x0, y0, x1, y1));
+        }
+        public static Pattern CreateRadialGradient(float cx0, float cy0, float radius0,
+                                                     float cx1, float cy1, float radius1)
+        {
+            return new Pattern(NativeMethods.vkvg_pattern_create_radial(cx0, cy0, radius0, cx1, cy1, radius1));
+        }
+
+        public void AddReference()
+        {
+            NativeMethods.vkvg_pattern_reference(handle);
+        }
+        public uint References() => NativeMethods.vkvg_pattern_get_reference_count(handle);
+
+        public IntPtr Handle { get { return handle; } }
+
+        public Extend Extend
+        {
+            set { NativeMethods.vkvg_pattern_set_extend(handle, value); }
+            get { return NativeMethods.vkvg_pattern_get_extend(handle); }
+        }
+        public Filter Filter
+        {
+            set { NativeMethods.vkvg_pattern_set_filter(handle, value); }
+            get { return NativeMethods.vkvg_pattern_get_filter(handle); }
+        }
+
+        public void AddColorStop(float offset, float r, float g, float b, float a = 1f)
+        {
+            NativeMethods.vkvg_pattern_add_color_stop(handle, offset, r, g, b, a);
+        }
+
+        #region IDisposable implementation
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        protected virtual void Dispose(bool disposing)
+        {
+            if (!disposing || handle == IntPtr.Zero)
+                return;
+
+            NativeMethods.vkvg_pattern_destroy(handle);
+            handle = IntPtr.Zero;
+        }
+        #endregion
+    }
+}
\ No newline at end of file
diff --git a/Crow/src/GraphicBackends/vkvg/Surface.cs b/Crow/src/GraphicBackends/vkvg/Surface.cs
new file mode 100644 (file)
index 0000000..79f92dc
--- /dev/null
@@ -0,0 +1,85 @@
+// Copyright (c) 2018-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+
+namespace vkvg
+{
+       public class Surface: IDisposable
+       {               
+               IntPtr handle = IntPtr.Zero;
+               Device vkvgDev;
+
+               public Surface (Device device, int width, int heigth)
+               {
+                       vkvgDev = device;
+                       handle = NativeMethods.vkvg_surface_create (device.Handle, (uint)width, (uint)heigth);
+               }
+               public Surface (Device device, ref byte[] data, int width, int heigth)
+               {
+                       vkvgDev = device;
+                       handle = NativeMethods.vkvg_surface_create (device.Handle, (uint)width, (uint)heigth);
+               }
+               public Surface (Device device, string imgPath) {
+                       vkvgDev = device;
+                       handle = NativeMethods.vkvg_surface_create_from_image (device.Handle, imgPath);
+               }
+
+
+               Surface (IntPtr devHandle, int width, int heigth)
+               {
+                       handle = NativeMethods.vkvg_surface_create (devHandle, (uint)width, (uint)heigth);
+               }
+               ~Surface ()
+               {
+                       Dispose (false);
+               }
+
+               public IntPtr Handle { get { return handle; }}
+               public IntPtr VkImage { get { return NativeMethods.vkvg_surface_get_vk_image (handle); }}
+               public int Width { get { return NativeMethods.vkvg_surface_get_width (handle); }}
+               public int Height { get { return NativeMethods.vkvg_surface_get_height (handle); }}
+
+               public void AddReference () {
+                       NativeMethods.vkvg_surface_reference (handle);
+               }
+               public uint References () => NativeMethods.vkvg_surface_get_reference_count (handle);
+
+//             public Surface CreateSimilar (uint width, uint height) {
+//                     return new Surface (handle, width, height);
+//             }
+//             public Surface CreateSimilar (int width, int height) {
+//                     return new Surface (handle, (uint)width, (uint)height);
+//             }
+
+               public void Flush () {
+                       throw new NotImplementedException ();
+               }
+
+               public void WriteToPng (string path) {
+                       NativeMethods.vkvg_surface_write_to_png (handle, path);
+               }
+               public void Clear () {
+                       NativeMethods.vkvg_surface_clear (handle);
+               }
+
+               #region IDisposable implementation
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {
+                       if (!disposing || handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.vkvg_surface_destroy (handle);
+                       handle = IntPtr.Zero;
+               }
+               #endregion
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/vkvg/TextExtents.cs b/Crow/src/GraphicBackends/vkvg/TextExtents.cs
new file mode 100644 (file)
index 0000000..becca77
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright (c) 2018-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace vkvg
+{
+       [StructLayout (LayoutKind.Sequential)]
+       public struct TextExtents
+       {
+               float xbearing;
+               float ybearing;
+               float width;
+               float height;
+               float xadvance;
+               float yadvance;
+               
+               public float XBearing {
+                       get { return xbearing; }
+                       set { xbearing = value; }
+               }
+               
+               public float YBearing {
+                       get { return ybearing; }
+                       set { ybearing = value; }
+               }
+               
+               public float Width {
+                       get { return width; }
+                       set { width = value; }
+               }
+               
+               public float Height {
+                       get { return height; }
+                       set { height = value; }
+               }
+               
+               public float XAdvance {
+                       get { return xadvance; }
+                       set { xadvance = value; }
+               }
+               
+               public float YAdvance {
+                       get { return yadvance; }
+                       set { yadvance = value; }
+               }
+
+               public override bool Equals (object obj)
+               {
+                       if (obj is TextExtents)
+                               return this == (TextExtents)obj;
+                       return false;
+               }
+
+               public override int GetHashCode ()
+               {
+                       return (int)XBearing ^ (int)YBearing ^ (int)Width ^ (int)Height ^ (int)XAdvance ^ (int)YAdvance;
+               }
+
+               public static bool operator == (TextExtents extents, TextExtents other)
+               {
+                       return extents.XBearing == other.XBearing && extents.YBearing == other.YBearing && extents.Width == other.Width && extents.Height == other.Height && extents.XAdvance == other.XAdvance && extents.YAdvance == other.YAdvance;
+               }
+
+               public static bool operator != (TextExtents extents, TextExtents other)
+               {
+                       return !(extents == other);
+               }
+       }
+}
diff --git a/Crow/src/GraphicBackends/vkvg/TextRun.cs b/Crow/src/GraphicBackends/vkvg/TextRun.cs
new file mode 100644 (file)
index 0000000..95cdf7f
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (c) 2018-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+namespace vkvg {
+       public class TextRun : IDisposable {
+
+               IntPtr handle = IntPtr.Zero;
+
+               #region CTORS & DTOR
+               protected TextRun(IntPtr handle) {
+                       this.handle = handle;
+               }
+               public TextRun(string text) {
+                       handle = NativeMethods.vkvg_text_run_create (handle, Context.TerminateUtf8(text));
+               }
+
+               ~TextRun() {
+                       Dispose (false);
+               }
+               #endregion
+
+               //public void AddReference () {
+               //      NativeMethods.vkvg_pattern_reference (handle);
+               //}
+               //public uint References () => NativeMethods.vkvg_pattern_get_reference_count (handle);
+
+               public IntPtr Handle { get { return handle; } }
+
+               public TextExtents Extents {
+                       get {
+                               TextExtents extents;
+                               NativeMethods.vkvg_text_run_get_extents (handle, out extents);
+                               return extents;
+                       }
+               }
+
+               #region IDisposable implementation
+               public void Dispose () {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               protected virtual void Dispose (bool disposing) {
+                       if (!disposing || handle == IntPtr.Zero)
+                               return;
+
+                       NativeMethods.vkvg_text_run_destroy (handle);
+                       handle = IntPtr.Zero;
+               }
+               #endregion
+       }
+}
\ No newline at end of file
diff --git a/Crow/src/GraphicBackends/vkvg/tmp/FontOptions.cs b/Crow/src/GraphicBackends/vkvg/tmp/FontOptions.cs
new file mode 100644 (file)
index 0000000..690f214
--- /dev/null
@@ -0,0 +1,74 @@
+//from Mono.Cairo
+//fake FontOptions
+
+using System;
+
+namespace vkvg
+{
+       public enum SubpixelOrder
+       {
+               Default,
+               Rgb,
+               Bgr,
+               Vrgb,
+               Vbgr,
+       }
+       public enum HintMetrics
+       {
+               Default,
+               Off,
+               On,
+       }
+       public enum HintStyle
+       {
+               Default,
+               None,
+               Slight,
+               Medium,
+               Full,
+       }               
+       public class FontOptions : IDisposable
+       {
+               public FontOptions () { }
+
+
+               public FontOptions Copy () => default;
+
+
+               public IntPtr Handle {
+                       get ;
+               }
+
+       
+               public void Merge (FontOptions other)
+               {
+               }
+
+               public void Dispose() {}
+
+               public Antialias Antialias {
+                       get ;
+                       set ;
+               }
+
+               public HintMetrics HintMetrics {
+                       get ;
+                       set ;
+               }
+
+               public HintStyle HintStyle {
+                       get ;
+                       set ;
+               }
+
+               public Status Status {
+                       get ;
+               }
+
+               public SubpixelOrder SubpixelOrder {
+                       get ;
+                       set ;
+               }
+       }
+}
+
diff --git a/Crow/src/GraphicBackends/vkvg/tmp/Rectangles.cs b/Crow/src/GraphicBackends/vkvg/tmp/Rectangles.cs
new file mode 100644 (file)
index 0000000..c50236c
--- /dev/null
@@ -0,0 +1,116 @@
+// Copyright (c) 2021  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System.Collections.Generic;
+using vkvg;
+
+namespace Crow {
+       public enum RegionOverlap {
+               In,
+               Out,
+               Part,
+       }       
+       public class Region
+    {
+        public List<Rectangle> list = new List<Rectangle>();
+        public int count
+        {
+            get { return list.Count; }
+        }
+               public bool IsEmpty => list.Count == 0;
+
+        public void AddRectangle(Rectangle r)
+        {
+                       if (doesNotContain (r)) {
+                               list.Add (r);
+                               boundsUpToDate = false;
+                       }
+        }
+        public void Reset()
+        {
+            list = new List<Rectangle>();
+                       _bounds = default;
+                       boundsUpToDate = true;
+        }
+        bool doesNotContain(Rectangle r)
+        {
+            foreach (Rectangle rInList in list)
+                if (rInList.ContainsOrIsEqual(r))
+                    return false;
+            return true;
+        }
+
+        public bool intersect(Rectangle r)
+        {
+            foreach (Rectangle rInList in list)
+                if (rInList.Intersect(r))
+                    return true;
+            return false;
+        }
+               public void stroke(Context ctx, Color c)
+               {
+                       foreach (Rectangle r in list)
+                               ctx.Rectangle(r);
+
+                       ctx.SetSource(c);
+
+                       ctx.LineWidth = 2;
+                       ctx.Stroke ();
+               }
+        public void clearAndClip(Context ctx)
+        {
+                       if (list.Count == 0)
+                               return;
+            foreach (Rectangle r in list)
+                ctx.Rectangle(r);
+
+                       ctx.ClipPreserve();
+                       ctx.Operator = Operator.Clear;
+            ctx.Fill();
+            ctx.Operator = Operator.Over;
+        }
+
+        public void clip(Context ctx)
+        {
+            foreach (Rectangle r in list)
+               ctx.Rectangle(r);
+
+            ctx.Clip();
+        }
+
+               Rectangle _bounds;
+               bool boundsUpToDate = true;
+               public Rectangle Bounds {
+                       get {
+                               if (!boundsUpToDate) {
+                                       if (list.Count > 0) {
+                                               _bounds = list [0];
+                                               for (int i = 1; i < list.Count; i++) {
+                                                       _bounds += list [i];
+                                               }
+                                       } else
+                                               _bounds = default;
+                                       boundsUpToDate = true;
+                               }
+                               return _bounds;
+                       }
+               }
+               public void clear(Context ctx)
+        {
+            foreach (Rectangle r in list)
+                ctx.Rectangle(r);
+            ctx.Operator = Operator.Clear;
+            ctx.Fill();
+            ctx.Operator = Operator.Over;
+        }
+               public override string ToString ()
+               {
+                       string tmp = "";
+                       foreach (Rectangle r in list) {
+                               tmp += r.ToString ();
+                       }
+                       return tmp;
+               }
+    }
+}
index 60f0e22149e51645a5930dd1c80e3da3357fdc96..ff2caff46d1fbc9ae7e5c2b1d1521c9b45b05f7c 100644 (file)
@@ -13,7 +13,11 @@ using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Threading;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Crow.IML;
 using Glfw;
 using Path = System.IO.Path;
diff --git a/Crow/src/Mono.Cairo/Antialias.cs b/Crow/src/Mono.Cairo/Antialias.cs
deleted file mode 100644 (file)
index 64da644..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// Mono.Cairo.Antialias.cs
-//
-// Authors:
-//   Duncan Mak (duncan@ximian.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum Antialias
-       {
-               Default,
-               None,
-               Grey,
-               Subpixel,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Cairo.cs b/Crow/src/Mono.Cairo/Cairo.cs
deleted file mode 100644 (file)
index c32c00d..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Cairo.cs - a simplistic binding of the Cairo API to C#.
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//          John Luke (john.luke@gmail.com)
-//          Alp Toker (alp@atoker.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2005 John Luke
-// Copyright (C) 2006 Alp Toker
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Crow.Cairo
-{
-       public static class CairoAPI {
-               static public int Version {
-                       get {
-                               return Cairo.NativeMethods.cairo_version ();
-                       }
-               }
-
-               static public string VersionString {
-                       get {
-                               IntPtr x = Cairo.NativeMethods.cairo_version_string ();
-                               return Marshal.PtrToStringAnsi (x);
-                       }
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/CairoDebug.cs b/Crow/src/Mono.Cairo/CairoDebug.cs
deleted file mode 100644 (file)
index a669d84..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// CairoDebug.cs
-//
-// Author:
-//   Michael Hutchinson (mhutch@xamarin.com)
-//
-// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       static class CairoDebug
-       {
-               static System.Collections.Generic.Dictionary<IntPtr,string> traces;
-
-               public static readonly bool Enabled;
-
-               static CairoDebug ()
-               {
-                       var dbg = Environment.GetEnvironmentVariable ("MONO_CAIRO_DEBUG_DISPOSE");
-                       if (dbg == null)
-                               return;
-                       Enabled = true;
-                       traces = new System.Collections.Generic.Dictionary<IntPtr,string> ();
-               }
-
-               public static void OnAllocated (IntPtr obj)
-               {
-                       if (!Enabled)
-                               throw new InvalidOperationException ();
-
-                       traces[obj] = Environment.StackTrace;
-               }
-
-               public static void OnDisposed<T> (IntPtr obj, bool disposing)
-               {
-                       if (disposing && !Enabled)
-                               throw new InvalidOperationException ();
-
-                       if (Environment.HasShutdownStarted)
-                               return;
-
-                       if (!disposing) {
-                               System.Diagnostics.Debug.WriteLine ("{0} is leaking, programmer is missing a call to Dispose", typeof(T).FullName);
-                               if (Enabled) {
-                                       string val;
-                                       if (traces.TryGetValue (obj, out val)) {
-                                               System.Diagnostics.Debug.WriteLine ("Allocated from:");
-                                               System.Diagnostics.Debug.WriteLine (val);
-                                       }
-                               } else {
-                                       System.Diagnostics.Debug.WriteLine ("Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces");
-                               }
-                       }
-
-                       if (Enabled)
-                               traces.Remove (obj);
-               }
-       }
-
-}
diff --git a/Crow/src/Mono.Cairo/Content.cs b/Crow/src/Mono.Cairo/Content.cs
deleted file mode 100644 (file)
index f14305a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// Mono.Cairo.Content.cs
-//
-// Authors:
-//   Duncan Mak (duncan@ximian.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       //[Flags]
-       
-       public enum Content
-       {
-               Color = 0x1000,
-               Alpha = 0x2000,
-               ColorAlpha = 0x3000,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Context.cs b/Crow/src/Mono.Cairo/Context.cs
deleted file mode 100644 (file)
index 5cd60dc..0000000
+++ /dev/null
@@ -1,924 +0,0 @@
-//
-// Mono.Cairo.Context.cs
-//
-// Author:
-//   Duncan Mak (duncan@ximian.com)
-//   Miguel de Icaza (miguel@novell.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//   Alp Toker (alp@atoker.com)
-//
-// (C) Ximian Inc, 2003.
-// (C) Novell Inc, 2003.
-//
-// This is an OO wrapper API for the Cairo API.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace Crow.Cairo { 
-
-       [Obsolete ("Renamed Cairo.Context per suggestion from cairo binding guidelines.")]
-       public class Graphics : Context {
-               public Graphics (IntPtr state) : base (state) {}
-               public Graphics (Surface surface) : base (surface) {}
-       }
-
-       public class Context : IDisposable
-       {
-               IntPtr handle = IntPtr.Zero;
-
-               static int native_glyph_size, c_compiler_long_size;
-
-               static Context ()
-               {
-                       //
-                       // This is used to determine what kind of structure
-                       // we should use to marshal Glyphs, as the public
-                       // definition in Cairo uses `long', which can be
-                       // 32 bits or 64 bits depending on the platform.
-                       //
-                       // We assume that sizeof(long) == sizeof(void*)
-                       // except in the case of Win64 where sizeof(long)
-                       // is 32 bits
-                       //
-                       int ptr_size = Marshal.SizeOf (typeof (IntPtr));
-
-                       PlatformID platform = Environment.OSVersion.Platform;
-                       if (platform == PlatformID.Win32NT ||
-                           platform == PlatformID.Win32S ||
-                           platform == PlatformID.Win32Windows ||
-                           platform == PlatformID.WinCE ||
-                           ptr_size == 4){
-                               c_compiler_long_size = 4;
-                               native_glyph_size = Marshal.SizeOf (typeof (NativeGlyph_4byte_longs));
-                       } else {
-                               c_compiler_long_size = 8;
-                               native_glyph_size = Marshal.SizeOf (typeof (Glyph));
-                       }
-               }
-
-               public Context (Surface surface) : this (NativeMethods.cairo_create (surface.Handle), true)
-               {
-               }
-
-
-               public Context (IntPtr handle, bool owner)
-               {
-                       this.handle = handle;
-                       if (!owner)
-                               NativeMethods.cairo_reference (handle);
-                       if (CairoDebug.Enabled)
-                               CairoDebug.OnAllocated (handle);
-               }
-
-               [Obsolete]
-               public Context (IntPtr state) : this (state, true)
-               {
-               }
-
-               ~Context ()
-               {
-                       Dispose (false);
-               }
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (!disposing || CairoDebug.Enabled)
-                               CairoDebug.OnDisposed<Context> (handle, disposing);
-
-                       if (!disposing|| handle == IntPtr.Zero)
-                               return;
-
-                       NativeMethods.cairo_destroy (handle);
-                       handle = IntPtr.Zero;
-
-               }
-
-               public void Save ()
-               {
-                       NativeMethods.cairo_save (handle);
-               }
-
-               public void Restore ()
-               {
-                       NativeMethods.cairo_restore (handle);
-               }
-
-               public Antialias Antialias {
-                       get { return NativeMethods.cairo_get_antialias (handle); }
-                       set { NativeMethods.cairo_set_antialias (handle, value); }
-               }
-
-               public Cairo.Status Status {
-                       get {
-                               return NativeMethods.cairo_status (handle);
-                       }
-               }
-
-               public IntPtr Handle {
-                       get {
-                               return handle;
-                       }
-               }
-
-               public Operator Operator {
-                       set {
-                               NativeMethods.cairo_set_operator (handle, value);
-                       }
-
-                       get {
-                               return NativeMethods.cairo_get_operator (handle);
-                       }
-               }
-
-               public double Tolerance {
-                       get {
-                               return NativeMethods.cairo_get_tolerance (handle);
-                       }
-
-                       set {
-                               NativeMethods.cairo_set_tolerance (handle, value);
-                       }
-               }
-
-               public Cairo.FillRule FillRule {
-                       set {
-                               NativeMethods.cairo_set_fill_rule (handle, value);
-                       }
-
-                       get {
-                               return NativeMethods.cairo_get_fill_rule (handle);
-                       }
-               }
-
-               public double LineWidth {
-                       set {
-                               NativeMethods.cairo_set_line_width (handle, value);
-                       }
-
-                       get {
-                               return NativeMethods.cairo_get_line_width (handle);
-                       }
-               }
-
-               public Cairo.LineCap LineCap {
-                       set {
-                               NativeMethods.cairo_set_line_cap (handle, value);
-                       }
-
-                       get {
-                               return NativeMethods.cairo_get_line_cap (handle);
-                       }
-               }
-
-               public Cairo.LineJoin LineJoin {
-                       set {
-                               NativeMethods.cairo_set_line_join (handle, value);
-                       }
-
-                       get {
-                               return NativeMethods.cairo_get_line_join (handle);
-                       }
-               }
-
-               public void SetDash (double [] dashes, double offset)
-               {
-                       NativeMethods.cairo_set_dash (handle, dashes, dashes.Length, offset);
-               }
-
-               [Obsolete("Use GetSource/SetSource")]
-               public Pattern Pattern {
-                       set {
-                               SetSource (value);
-                       }
-                       get {
-                               return GetSource ();
-                       }
-               }
-
-               //This is obsolete because it wasn't obvious it needed to be disposed
-               [Obsolete("Use GetSource/SetSource")]
-               public Pattern Source {
-                       set {
-                               SetSource (value);
-                       }
-                       get {
-                               return GetSource ();
-                       }
-               }
-
-               public void SetSource (Pattern source)
-               {
-                       NativeMethods.cairo_set_source (handle, source.Handle);
-               }
-
-               public Pattern GetSource ()
-               {
-                       var ptr = NativeMethods.cairo_get_source (handle);
-                       return Cairo.Pattern.Lookup (ptr, false);
-               }
-
-               public double MiterLimit {
-                       set {
-                               NativeMethods.cairo_set_miter_limit (handle, value);
-                       }
-
-                       get {
-                               return NativeMethods.cairo_get_miter_limit (handle);
-                       }
-               }
-
-               public PointD CurrentPoint {
-                       get {
-                               double x, y;
-                               NativeMethods.cairo_get_current_point (handle, out x, out y);
-                               return new PointD (x, y);
-                       }
-               }
-
-               public bool HasCurrentPoint {
-                       get {
-                               return NativeMethods.cairo_has_current_point (handle);
-                       }
-               }
-
-               [Obsolete ("Use GetTarget/SetTarget")]
-               public Cairo.Surface Target {
-                       set {
-                               if (handle != IntPtr.Zero)
-                                       NativeMethods.cairo_destroy (handle);
-
-                               handle = NativeMethods.cairo_create (value.Handle);
-                       }
-
-                       get {
-                               return GetTarget ();
-                       }
-               }
-
-               public Surface GetTarget ()
-               {
-                       return Surface.Lookup (NativeMethods.cairo_get_target (handle), false);
-               }
-
-               public void SetTarget (Surface target)
-               {
-                       if (handle != IntPtr.Zero)
-                               NativeMethods.cairo_destroy (handle);
-                       handle = NativeMethods.cairo_create (target.Handle);
-               }
-
-               [Obsolete("Use GetScaledFont/SetScaledFont")]
-               public ScaledFont ScaledFont {
-                       set {
-                               SetScaledFont (value);
-                       }
-
-                       get {
-                               return GetScaledFont ();
-                       }
-               }
-
-               public ScaledFont GetScaledFont ()
-               {
-                       return new ScaledFont (NativeMethods.cairo_get_scaled_font (handle), false);
-               }
-
-               public void SetScaledFont (ScaledFont font)
-               {
-                       NativeMethods.cairo_set_scaled_font (handle, font.Handle);
-               }
-
-               public uint ReferenceCount {
-                       get { return NativeMethods.cairo_get_reference_count (handle); }
-               }
-
-               public void SetSource (Color color)
-               {
-                       NativeMethods.cairo_set_source_rgba (handle, color.R / 255.0, color.G / 255.0, color.B / 255.0, color.A / 255.0);
-               }
-
-               public void SetSource (double r, double g, double b)
-               {
-                       NativeMethods.cairo_set_source_rgb (handle, r, g, b);
-               }
-
-               public void SetSource (double r, double g, double b, double a)
-               {
-                       NativeMethods.cairo_set_source_rgba (handle, r, g, b, a);
-               }
-
-               //[Obsolete ("Use SetSource method (with double parameters)")]
-               public void SetSource (Surface source, int x = 0, int y = 0)
-               {
-                       NativeMethods.cairo_set_source_surface (handle, source.Handle, x, y);
-               }
-
-               public void SetSource (Surface source, double x, double y)
-               {
-                       NativeMethods.cairo_set_source_surface (handle, source.Handle, x, y);
-               }
-
-               public void SetSource (Surface source)
-               {
-                       NativeMethods.cairo_set_source_surface (handle, source.Handle, 0, 0);
-               }
-
-#region Path methods
-
-               public void NewPath ()
-               {
-                       NativeMethods.cairo_new_path (handle);
-               }
-
-               public void NewSubPath ()
-               {
-                       NativeMethods.cairo_new_sub_path (handle);
-               }
-
-               public void MoveTo (PointD p)
-               {
-                       MoveTo (p.X, p.Y);
-               }
-
-               public void MoveTo (double x, double y)
-               {
-                       NativeMethods.cairo_move_to (handle, x, y);
-               }
-
-               public void LineTo (PointD p)
-               {
-                       LineTo (p.X, p.Y);
-               }
-
-               public void LineTo (double x, double y)
-               {
-                       NativeMethods.cairo_line_to (handle, x, y);
-               }
-
-               public void CurveTo (PointD p1, PointD p2, PointD p3)
-               {
-                       CurveTo (p1.X, p1.Y, p2.X, p2.Y, p3.X, p3.Y);
-               }
-
-               public void CurveTo (double x1, double y1, double x2, double y2, double x3, double y3)
-               {
-                       NativeMethods.cairo_curve_to (handle, x1, y1, x2, y2, x3, y3);
-               }
-
-               public void RelMoveTo (Distance d)
-               {
-                       RelMoveTo (d.Dx, d.Dy);
-               }
-
-               public void RelMoveTo (double dx, double dy)
-               {
-                       NativeMethods.cairo_rel_move_to (handle, dx, dy);
-               }
-
-               public void RelLineTo (Distance d)
-               {
-                       RelLineTo (d.Dx, d.Dy);
-               }
-
-               public void RelLineTo (double dx, double dy)
-               {
-                       NativeMethods.cairo_rel_line_to (handle, dx, dy);
-               }
-
-               public void RelCurveTo (Distance d1, Distance d2, Distance d3)
-               {
-                       RelCurveTo (d1.Dx, d1.Dy, d2.Dx, d2.Dy, d3.Dx, d3.Dy);
-               }
-
-               public void RelCurveTo (double dx1, double dy1, double dx2, double dy2, double dx3, double dy3)
-               {
-                       NativeMethods.cairo_rel_curve_to (handle, dx1, dy1, dx2, dy2, dx3, dy3);
-               }
-
-               public void Arc (double xc, double yc, double radius, double angle1, double angle2)
-               {
-                       NativeMethods.cairo_arc (handle, xc, yc, radius, angle1, angle2);
-               }
-               public void Arc (PointD center, double radius, double angle1, double angle2)
-               {
-                       NativeMethods.cairo_arc (handle, center.X, center.Y, radius, angle1, angle2);
-               }
-
-               public void ArcNegative (double xc, double yc, double radius, double angle1, double angle2)
-               {
-                       NativeMethods.cairo_arc_negative (handle, xc, yc, radius, angle1, angle2);
-               }
-
-               public void Rectangle (Crow.Rectangle rectangle)
-               {
-                       Rectangle (rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
-               }
-               public void Rectangle (Crow.RectangleD rectangle)
-               {
-                       Rectangle (rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
-               }
-
-               public void Rectangle (PointD p, double width, double height)
-               {
-                       Rectangle (p.X, p.Y, width, height);
-               }
-
-               public void Rectangle (double x, double y, double width, double height)
-               {
-                       NativeMethods.cairo_rectangle (handle, x, y, width, height);
-               }
-
-               public void ClosePath ()
-               {
-                       NativeMethods.cairo_close_path (handle);
-               }
-
-               public Path CopyPath ()
-               {
-                       return new Path (NativeMethods.cairo_copy_path (handle));
-               }
-
-               public Path CopyPathFlat ()
-               {
-                       return new Path (NativeMethods.cairo_copy_path_flat (handle));
-               }
-
-               public void AppendPath (Path path)
-               {
-                       NativeMethods.cairo_append_path (handle, path.Handle);
-               }
-
-#endregion
-
-#region Painting Methods
-               public void Paint ()
-               {
-                       NativeMethods.cairo_paint (handle);
-               }
-
-               public void PaintWithAlpha (double alpha)
-               {
-                       NativeMethods.cairo_paint_with_alpha (handle, alpha);
-               }
-
-               public void Mask (Pattern pattern)
-               {
-                       NativeMethods.cairo_mask (handle, pattern.Handle);
-               }
-
-               public void MaskSurface (Surface surface, double surface_x, double surface_y)
-               {
-                       NativeMethods.cairo_mask_surface (handle, surface.Handle, surface_x, surface_y);
-               }
-
-               public void Stroke ()
-               {
-                       NativeMethods.cairo_stroke (handle);
-               }
-
-               public void StrokePreserve ()
-               {
-                       NativeMethods.cairo_stroke_preserve (handle);
-               }
-
-               public Crow.Rectangle StrokeExtents ()
-               {
-                       double x1, y1, x2, y2;
-                       NativeMethods.cairo_stroke_extents (handle, out x1, out y1, out x2, out y2);
-                       return new Crow.Rectangle ((int)x1, (int)y1, (int)(x2 - x1), (int)(y2 - y1));
-               }
-
-               public void Fill ()
-               {
-                       NativeMethods.cairo_fill (handle);
-               }
-
-               public Crow.Rectangle FillExtents ()
-               {
-                       double x1, y1, x2, y2;
-                       NativeMethods.cairo_fill_extents (handle, out x1, out y1, out x2, out y2);
-                       return new Crow.Rectangle ((int)x1, (int)y1, (int)(x2 - x1), (int)(y2 - y1));
-               }
-
-               public void FillPreserve ()
-               {
-                       NativeMethods.cairo_fill_preserve (handle);
-               }
-
-#endregion
-
-               public void Clip ()
-               {
-                       NativeMethods.cairo_clip (handle);
-               }
-
-               public void ClipPreserve ()
-               {
-                       NativeMethods.cairo_clip_preserve (handle);
-               }
-
-               public void ResetClip ()
-               {
-                       NativeMethods.cairo_reset_clip (handle);
-               }
-
-               public bool InClip (double x, double y)
-               {
-                       return NativeMethods.cairo_in_clip (handle, x, y);
-               }
-               public RectangleList GetClipRectangles (){
-                       return (RectangleList)Marshal.PtrToStructure (NativeMethods.cairo_copy_clip_rectangle_list (handle), typeof(RectangleList));
-               }
-               public void ClipExtendRectangle (){
-                       double x1, y1, x2, y2;
-                       NativeMethods.cairo_clip_extents (handle, out x1, out y1, out x2, out y2);
-                       NativeMethods.cairo_rectangle (handle, x1, y1, x2 - x1, y2 - y1); 
-               }
-               public bool InStroke (double x, double y)
-               {
-                       return NativeMethods.cairo_in_stroke (handle, x, y);
-               }
-
-               public bool InFill (double x, double y)
-               {
-                       return NativeMethods.cairo_in_fill (handle, x, y);
-               }
-
-               public Pattern PopGroup ()
-               {
-                       return Pattern.Lookup (NativeMethods.cairo_pop_group (handle), true);
-               }
-
-               public void PopGroupToSource ()
-               {
-                       NativeMethods.cairo_pop_group_to_source (handle);
-               }
-
-               public void PushGroup ()
-               {
-                       NativeMethods.cairo_push_group (handle);
-               }
-
-               public void PushGroup (Content content)
-               {
-                       NativeMethods.cairo_push_group_with_content (handle, content);
-               }
-
-               [Obsolete ("Use GetGroupTarget()")]
-               public Surface GroupTarget {
-                       get {
-                               return GetGroupTarget ();
-                       }
-               }
-
-               public Surface GetGroupTarget ()
-               {
-                       IntPtr surface = NativeMethods.cairo_get_group_target (handle);
-                       return Surface.Lookup (surface, false);
-               }
-
-               public void Rotate (double angle)
-               {
-                       NativeMethods.cairo_rotate (handle, angle);
-               }
-
-               public void Scale (double sx, double sy)
-               {
-                       NativeMethods.cairo_scale (handle, sx, sy);
-               }
-
-               public void Translate (double tx, double ty)
-               {
-                       NativeMethods.cairo_translate (handle, tx, ty);
-               }
-
-               public void Transform (Matrix m)
-               {
-                       NativeMethods.cairo_transform (handle, m);
-               }
-
-               [Obsolete("Use UserToDevice instead")]
-               public void TransformPoint (ref double x, ref double y)
-               {
-                       NativeMethods.cairo_user_to_device (handle, ref x, ref y);
-               }
-
-               [Obsolete("Use UserToDeviceDistance instead")]
-               public void TransformDistance (ref double dx, ref double dy)
-               {
-                       NativeMethods.cairo_user_to_device_distance (handle, ref dx, ref dy);
-               }
-
-               [Obsolete("Use InverseTransformPoint instead")]
-               public void InverseTransformPoint (ref double x, ref double y)
-               {
-                       NativeMethods.cairo_device_to_user (handle, ref x, ref y);
-               }
-
-               [Obsolete("Use DeviceToUserDistance instead")]
-               public void InverseTransformDistance (ref double dx, ref double dy)
-               {
-                       NativeMethods.cairo_device_to_user_distance (handle, ref dx, ref dy);
-               }
-
-               public void UserToDevice (ref double x, ref double y)
-               {
-                       NativeMethods.cairo_user_to_device (handle, ref x, ref y);
-               }
-
-               public void UserToDeviceDistance (ref double dx, ref double dy)
-               {
-                       NativeMethods.cairo_user_to_device_distance (handle, ref dx, ref dy);
-               }
-
-               public void DeviceToUser (ref double x, ref double y)
-               {
-                       NativeMethods.cairo_device_to_user (handle, ref x, ref y);
-               }
-
-               public void DeviceToUserDistance (ref double dx, ref double dy)
-               {
-                       NativeMethods.cairo_device_to_user_distance (handle, ref dx, ref dy);
-               }
-
-               public Matrix Matrix {
-                       set {
-                               NativeMethods.cairo_set_matrix (handle, value);
-                       }
-
-                       get {
-                               Matrix m = new Matrix();
-                               NativeMethods.cairo_get_matrix (handle, m);
-                               return m;
-                       }
-               }
-
-               public void SetFontSize (double scale)
-               {
-                       NativeMethods.cairo_set_font_size (handle, scale);
-               }
-
-               public void IdentityMatrix ()
-               {
-                       NativeMethods.cairo_identity_matrix (handle);
-               }
-
-               [Obsolete ("Use SetFontSize() instead.")]
-               public void FontSetSize (double scale)
-               {
-                       SetFontSize (scale);
-               }
-
-               [Obsolete ("Use SetFontSize() instead.")]
-               public double FontSize {
-                       set { SetFontSize (value); }
-               }
-
-               public Matrix FontMatrix {
-                       get {
-                               Matrix m;
-                               NativeMethods.cairo_get_font_matrix (handle, out m);
-                               return m;
-                       }
-                       set { NativeMethods.cairo_set_font_matrix (handle, value); }
-               }
-
-               public FontOptions FontOptions {
-                       get {
-                               FontOptions options = new FontOptions ();
-                               NativeMethods.cairo_get_font_options (handle, options.Handle);
-                               return options;
-                       }
-                       set { NativeMethods.cairo_set_font_options (handle, value.Handle); }
-               }
-
-               [StructLayout(LayoutKind.Sequential)]
-               internal struct NativeGlyph_4byte_longs {
-                       public int index;
-                       public double x;
-                       public double y;
-
-                       public NativeGlyph_4byte_longs (Glyph source)
-                       {
-                               index = (int) source.index;
-                               x = source.x;
-                               y = source.y;
-                       }
-               }
-
-               static internal IntPtr FromGlyphToUnManagedMemory(Glyph [] glyphs)
-               {
-                       IntPtr dest = Marshal.AllocHGlobal (native_glyph_size * glyphs.Length);
-                       long pos = dest.ToInt64();
-
-                       if (c_compiler_long_size == 8){
-                               foreach (Glyph g in glyphs){
-                                       Marshal.StructureToPtr (g, (IntPtr)pos, false);
-                                       pos += native_glyph_size;
-                               }
-                       } else {
-                               foreach (Glyph g in glyphs){
-                                       NativeGlyph_4byte_longs n = new NativeGlyph_4byte_longs (g);
-
-                                       Marshal.StructureToPtr (n, (IntPtr)pos, false);
-                                       pos += native_glyph_size;
-                               }
-                       }
-
-                       return dest;
-               }
-
-               public void ShowGlyphs (Glyph[] glyphs)
-               {
-                       IntPtr ptr;
-
-                       ptr = FromGlyphToUnManagedMemory (glyphs);
-
-                       NativeMethods.cairo_show_glyphs (handle, ptr, glyphs.Length);
-
-                       Marshal.FreeHGlobal (ptr);
-               }
-
-               [Obsolete("The matrix argument was never used, use ShowGlyphs(Glyphs []) instead")]
-               public void ShowGlyphs (Matrix matrix, Glyph[] glyphs)
-               {
-                       ShowGlyphs (glyphs);
-               }
-
-               [Obsolete("The matrix argument was never used, use GlyphPath(Glyphs []) instead")]
-               public void GlyphPath (Matrix matrix, Glyph[] glyphs)
-               {
-                       GlyphPath (glyphs);
-               }
-
-               public void GlyphPath (Glyph[] glyphs)
-               {
-                       IntPtr ptr;
-
-                       ptr = FromGlyphToUnManagedMemory (glyphs);
-
-                       NativeMethods.cairo_glyph_path (handle, ptr, glyphs.Length);
-
-                       Marshal.FreeHGlobal (ptr);
-
-               }
-
-               public FontExtents FontExtents {
-                       get {
-                               FontExtents f_extents;
-                               NativeMethods.cairo_font_extents (handle, out f_extents);
-                               return f_extents;
-                       }
-               }
-
-               public void CopyPage ()
-               {
-                       NativeMethods.cairo_copy_page (handle);
-               }
-
-               [Obsolete ("Use SelectFontFace() instead.")]
-               public void FontFace (string family, FontSlant slant, FontWeight weight)
-               {
-                       SelectFontFace (family, slant, weight);
-               }
-
-               [Obsolete("Use GetFontFace/SetFontFace")]
-               public FontFace ContextFontFace {
-                       get {
-                               return GetContextFontFace ();
-                       }
-                       set {
-                               SetContextFontFace (value);
-                       }
-               }
-
-               public FontFace GetContextFontFace ()
-               {
-                       return Cairo.FontFace.Lookup (NativeMethods.cairo_get_font_face (handle), false);
-               }
-
-               public void SetContextFontFace (FontFace value)
-               {
-                       NativeMethods.cairo_set_font_face (handle, value == null ? IntPtr.Zero : value.Handle);
-               }
-
-               public void SelectFontFace (string family, FontSlant slant, FontWeight weight)
-               {
-                       NativeMethods.cairo_select_font_face (handle, family, slant, weight);
-               }
-
-               public void ShowPage ()
-               {
-                       NativeMethods.cairo_show_page (handle);
-               }
-
-               private static byte[] TerminateUtf8(byte[] utf8)
-               {
-                       if (utf8.Length > 0 && utf8[utf8.Length - 1] == 0)
-                               return utf8;
-                       var termedArray = new byte[utf8.Length + 1];
-                       Array.Copy(utf8, termedArray, utf8.Length);
-                       termedArray[utf8.Length] = 0;
-                       return termedArray;
-               }
-
-               private static byte[] TerminateUtf8(string s)
-               {
-                       // compute the byte count including the trailing \0
-                       var byteCount = Encoding.UTF8.GetMaxByteCount(s.Length + 1);
-                       var bytes = new byte[byteCount];
-                       Encoding.UTF8.GetBytes(s, 0, s.Length, bytes, 0);
-                       return bytes;
-               }
-
-               public void ShowText(string str)
-               {
-                       NativeMethods.cairo_show_text (handle, TerminateUtf8 (str));
-               }
-
-
-               public void TextPath(string str)
-               {
-                       NativeMethods.cairo_text_path (handle, TerminateUtf8(str));
-               }
-
-               public void TextPath(byte[] utf8)
-               {
-                       NativeMethods.cairo_text_path (handle, TerminateUtf8(utf8));
-               }
-
-               public TextExtents TextExtents(string s)
-               {
-                       TextExtents extents;
-                       NativeMethods.cairo_text_extents (handle, TerminateUtf8(s), out extents);
-                       return extents;
-               }
-               public void ShowText (ReadOnlySpan<char> s, int tabSize) {
-                       int size = s.Length * 4 + 1;
-                       Span<byte> bytes = size > 512 ? new byte[size] : stackalloc byte[size];
-                       int encodedBytes = Crow.Text.Encoding.ToUtf8 (s, bytes, tabSize);
-                       bytes[encodedBytes] = 0;
-                       ShowText (bytes.Slice (0, encodedBytes + 1));
-               }
-               public TextExtents TextExtents (ReadOnlySpan<char> s, int tabSize) {
-                       TextExtents (s, tabSize, out TextExtents extents);                      
-                       return extents;
-               }
-               public void TextExtents (ReadOnlySpan<char> s, int tabSize, out TextExtents extents) {
-                       int size = s.Length * 4 + 1;
-                       Span<byte> bytes = size > 512 ? new byte[size] : stackalloc byte[size];
-                       int encodedBytes = Crow.Text.Encoding.ToUtf8 (s, bytes, tabSize);
-                       bytes[encodedBytes] = 0;
-                       TextExtents (bytes.Slice (0, encodedBytes + 1), out extents);
-               }
-               public void ShowText (Span<byte> bytes) {
-                       NativeMethods.cairo_show_text (handle, ref bytes.GetPinnableReference());
-               }
-               public void TextExtents (Span<byte> bytes, out TextExtents extents) {
-                       NativeMethods.cairo_text_extents (handle, ref bytes.GetPinnableReference (), out extents);
-               }
-
-               public TextExtents GlyphExtents (Glyph[] glyphs)
-               {
-                       IntPtr ptr = FromGlyphToUnManagedMemory (glyphs);
-
-                       TextExtents extents;
-
-                       NativeMethods.cairo_glyph_extents (handle, ptr, glyphs.Length, out extents);
-
-                       Marshal.FreeHGlobal (ptr);
-
-                       return extents;
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/DRMDevice.cs b/Crow/src/Mono.Cairo/DRMDevice.cs
deleted file mode 100644 (file)
index 05e142c..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Mono.Cairo.Device.cs
-//
-// Authors:
-//                     JP Bruyère (jp_bruyere@hotmail.com)
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2016 JP Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace Crow.Cairo
-{
-       public class DRMDevice : Device
-       {
-               public DRMDevice () : base (NativeMethods.cairo_drm_device_default (), true)
-               {
-               }
-               public DRMDevice (int fd) : base (NativeMethods.cairo_drm_device_get_for_fd (fd), true)
-               {
-               }
-               public DRMDevice (IntPtr udev_device) : base (NativeMethods.cairo_drm_device_get (udev_device), true)
-               {
-               }
-
-               public int FileDescriptor {
-                       get { return NativeMethods.cairo_drm_device_get_fd (Handle); }
-               }
-
-               public void DeviceThrottle () { NativeMethods.cairo_drm_device_throttle (Handle);}
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/DRMSurface.cs b/Crow/src/Mono.Cairo/DRMSurface.cs
deleted file mode 100644 (file)
index f624967..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Mono.Cairo.GLSurface.cs
-//
-// Authors:
-//                     JP Bruyère (jp_bruyere@hotmail.com)
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2016 JP Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       public class DRMSurface : Surface
-       {
-               
-               public DRMSurface (IntPtr ptr, bool own) : base (ptr, own)
-               {}
-
-               public DRMSurface (DRMDevice device, Format format, int width, int height)
-                       : base (NativeMethods.cairo_drm_surface_create (device.Handle, format, width, height), true)
-               {}
-
-               public DRMSurface (DRMDevice device, uint name, Format format, int width, int height, int stride)
-                       : base (NativeMethods.cairo_drm_surface_create_for_name (device.Handle, name, format, width, height, stride), true)
-               {}
-
-               public DRMSurface (DRMDevice device, IntPtr imageSurface)
-                       : base (NativeMethods.cairo_drm_surface_create_from_cacheable_image (device.Handle, imageSurface), true)
-               {}
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Device.cs b/Crow/src/Mono.Cairo/Device.cs
deleted file mode 100644 (file)
index 484264f..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// Mono.Cairo.Device.cs
-//
-// Authors:
-//                     JP Bruyère (jp_bruyere@hotmail.com)
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2016 JP Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace Crow.Cairo
-{
-       public class Device : IDisposable
-       {
-               IntPtr handle = IntPtr.Zero;
-
-               protected Device()
-               {
-               }
-
-               protected Device (IntPtr ptr) : this (ptr, true)
-               {
-               }
-
-               protected Device (IntPtr handle, bool owner)
-               {
-                       this.handle = handle;
-                       if (!owner)
-                               NativeMethods.cairo_device_reference (handle);
-                       if (CairoDebug.Enabled)
-                               CairoDebug.OnAllocated (handle);
-               }
-
-               ~Device ()
-               {
-                       Dispose (false);
-               }
-
-               public IntPtr Handle {
-                       get {
-                               return handle;
-                       }
-               }
-               public string Status {
-                       get {
-                return System.Runtime.InteropServices.Marshal.PtrToStringAuto(NativeMethods.cairo_status_to_string (NativeMethods.cairo_device_status (handle)));
-                       }
-               }
-               public void SetThreadAware (bool value){
-                       NativeMethods.cairo_gl_device_set_thread_aware (handle, value ? 1 : 0);
-               }
-               public Status Acquire()
-               {
-                       return NativeMethods.cairo_device_acquire (handle);
-               }
-               public void Release()
-               {
-                       NativeMethods.cairo_device_release (handle);
-               }
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (!disposing || CairoDebug.Enabled)
-                               CairoDebug.OnDisposed<Device> (handle, disposing);
-
-                       if (!disposing || handle == IntPtr.Zero)
-                               return;
-
-                       NativeMethods.cairo_device_destroy (handle);
-                       handle = IntPtr.Zero;
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/DirectFBSurface.cs b/Crow/src/Mono.Cairo/DirectFBSurface.cs
deleted file mode 100644 (file)
index 6443157..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// Mono.Cairo.DirectFBSurface.cs
-//
-// Authors:
-//    Alp Toker
-//
-// (C) Alp Toker, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-       public class DirectFBSurface : Surface
-       {
-               internal DirectFBSurface (IntPtr handle, bool owns) : base (handle, owns)
-               {
-               }
-
-               public DirectFBSurface (IntPtr dfb, IntPtr dfb_surface)
-                       : base (NativeMethods.cairo_directfb_surface_create (dfb, dfb_surface), true)
-               {
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Distance.cs b/Crow/src/Mono.Cairo/Distance.cs
deleted file mode 100644 (file)
index d716ab1..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// Mono.Cairo.Context.cs
-//
-// Author:
-//   Duncan Mak (duncan@ximian.com)
-//   Miguel de Icaza (miguel@novell.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//   Alp Toker (alp@atoker.com)
-//
-// (C) Ximian Inc, 2003.
-// (C) Novell Inc, 2003.
-//
-// This is an OO wrapper API for the Cairo API.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Crow.Cairo {
-
-       public struct Distance
-       {
-               public Distance (double dx, double dy)
-               {
-                       this.dx = dx;
-                       this.dy = dy;
-               }
-
-               double dx, dy;
-               public double Dx {
-                       get { return dx; }
-                       set { dx = value; }
-               }
-
-               public double Dy {
-                       get { return dy; }
-                       set { dy = value; }
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/EGLDevice.cs b/Crow/src/Mono.Cairo/EGLDevice.cs
deleted file mode 100644 (file)
index 44590c7..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Mono.Cairo.Device.cs
-//
-// Authors:
-//                     JP Bruyère (jp_bruyere@hotmail.com)
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2016 JP Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace Crow.Cairo
-{
-       public class EGLDevice : Device
-       {
-               public EGLDevice (IntPtr dpy, IntPtr gl_ctx) : base (NativeMethods.cairo_egl_device_create (dpy, gl_ctx), true)
-               {
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/Extend.cs b/Crow/src/Mono.Cairo/Extend.cs
deleted file mode 100644 (file)
index 4af536d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// Mono.Cairo.Extend.cs
-//
-// Authors:
-//   Duncan Mak (duncan@ximian.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//   John Luke (john.luke@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2005 John Luke
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum Extend
-       {
-               None,
-               Repeat,
-               Reflect,
-               Pad,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/FillRule.cs b/Crow/src/Mono.Cairo/FillRule.cs
deleted file mode 100644 (file)
index 80f61ed..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Mono.Cairo.FillRule.cs
-//
-// Authors:
-//   Duncan Mak (duncan@ximian.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum FillRule
-       {
-               Winding,
-               EvenOdd
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Filter.cs b/Crow/src/Mono.Cairo/Filter.cs
deleted file mode 100644 (file)
index a73ea58..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// Mono.Cairo.Filter.cs
-//
-// Authors:
-//   Duncan Mak (duncan@ximian.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum Filter
-       {
-               Fast,
-               Good,
-               Best,
-               Nearest,
-               Bilinear,
-               Gaussian,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/FontExtents.cs b/Crow/src/Mono.Cairo/FontExtents.cs
deleted file mode 100644 (file)
index ea26d9b..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// Mono.Cairo.FontExtents.cs
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-//
-// This is a simplistic binding of the Cairo API to C#. All functions
-// in cairo.h are transcribed into their C# equivelants
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Crow.Cairo
-{
-       [StructLayout (LayoutKind.Sequential)]
-       public struct FontExtents
-       {
-               double ascent;
-               double descent;
-               double height;
-               double maxXAdvance;
-               double maxYAdvance;
-               
-               public double Ascent {
-                       get { return ascent; }
-                       set { ascent = value; }
-               }
-               
-               public double Descent {
-                       get { return descent; }
-                       set { descent = value; }
-               }
-               
-               public double Height {
-                       get { return height; }
-                       set { height = value; }
-               }
-               
-               public double MaxXAdvance {
-                       get { return maxXAdvance; }
-                       set { maxXAdvance = value; }
-               }
-               
-               public double MaxYAdvance {
-                       get { return maxYAdvance; }
-                       set { maxYAdvance = value; }
-               }
-
-               public FontExtents (double ascent, double descent, double height, double maxXAdvance, double maxYAdvance)
-               {
-                       this.ascent = ascent;
-                       this.descent = descent;
-                       this.height = height;
-                       this.maxXAdvance = maxXAdvance;
-                       this.maxYAdvance = maxYAdvance;
-               }
-
-               public override bool Equals (object obj)
-               {
-                       if (obj is FontExtents)
-                               return this == (FontExtents) obj;
-                       return false;
-               }
-
-               public override int GetHashCode ()
-               {
-                       return (int) Ascent ^ (int) Descent ^ (int) Height ^ (int) MaxXAdvance ^ (int) MaxYAdvance;
-               }
-
-               public static bool operator == (FontExtents extents, FontExtents other)
-               {
-                       return extents.Ascent == other.Ascent && extents.Descent == other.Descent && extents.Height == other.Height && extents.MaxXAdvance == other.MaxXAdvance && extents.MaxYAdvance == other.MaxYAdvance;
-               }
-
-               public static bool operator != (FontExtents extents, FontExtents other)
-               {
-                       return !(extents == other);
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/FontFace.cs b/Crow/src/Mono.Cairo/FontFace.cs
deleted file mode 100644 (file)
index 64c428e..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// Mono.Cairo.FontFace.cs
-//
-// Author:
-//   Alp Toker (alp@atoker.com)
-//   Miguel de Icaza (miguel@novell.com)
-//
-// (C) Ximian Inc, 2003.
-//
-// This is an OO wrapper API for the Cairo API.
-//
-// Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace Crow.Cairo
-{
-       public class FontFace : IDisposable
-       {
-               IntPtr handle;
-
-               internal static FontFace Lookup (IntPtr handle, bool owner)
-               {
-                       if (handle == IntPtr.Zero)
-                               return null;
-                       return new FontFace (handle, owner);
-               }
-
-               ~FontFace ()
-               {
-                       Dispose (false);
-               }
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (!disposing || CairoDebug.Enabled)
-                               CairoDebug.OnDisposed<FontFace> (handle, disposing);
-
-                       if (!disposing|| handle == IntPtr.Zero)
-                               return;
-
-                       NativeMethods.cairo_font_face_destroy (handle);
-                       handle = IntPtr.Zero;
-               }
-
-               [Obsolete]
-               public FontFace (IntPtr handle) : this (handle, true)
-               {
-               }
-
-               public FontFace (IntPtr handle, bool owned)
-               {
-                       this.handle = handle;
-                       if (!owned)
-                               NativeMethods.cairo_font_face_reference (handle);
-                       if (CairoDebug.Enabled)
-                               CairoDebug.OnAllocated (handle);
-               }
-
-               public IntPtr Handle {
-                       get {
-                               return handle;
-                       }
-               }
-
-               public Status Status {
-                       get {
-                               return NativeMethods.cairo_font_face_status (handle);
-                       }
-               }
-               
-               public FontType FontType {
-                       get {
-                               return NativeMethods.cairo_font_face_get_type (handle);
-                       }
-               }
-
-               public uint ReferenceCount {
-                       get { return NativeMethods.cairo_font_face_get_reference_count (handle); }
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/FontOptions.cs b/Crow/src/Mono.Cairo/FontOptions.cs
deleted file mode 100644 (file)
index f90a3a4..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// Mono.Cairo.FontOptions.cs
-//
-// Author:
-//   John Luke (john.luke@gmail.com)
-//
-// (C) John Luke 2005.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       public class FontOptions : IDisposable
-       {
-               IntPtr handle;
-
-               public FontOptions () : this (NativeMethods.cairo_font_options_create ())
-               {
-               }
-
-               ~FontOptions ()
-               {
-                       Dispose (false);
-               }
-
-               internal FontOptions (IntPtr handle)
-               {
-                       this.handle = handle;
-                       if (CairoDebug.Enabled)
-                               CairoDebug.OnAllocated (handle);
-               }
-
-               public FontOptions Copy ()
-               {
-                       return new FontOptions (NativeMethods.cairo_font_options_copy (handle));
-               }
-
-               [Obsolete ("Use Dispose()")]
-               public void Destroy ()
-               {
-                       Dispose ();
-               }
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (!disposing || CairoDebug.Enabled)
-                               CairoDebug.OnDisposed<FontOptions> (handle, disposing);
-
-                       if (!disposing|| handle == IntPtr.Zero)
-                               return;
-
-                       NativeMethods.cairo_font_options_destroy (handle);
-                       handle = IntPtr.Zero;
-               }
-
-               public static bool operator == (FontOptions options, FontOptions other)
-               {
-                       return Equals (options, other);
-               }
-
-               public static bool operator != (FontOptions options, FontOptions other)
-               {
-                       return !(options == other);
-               }
-
-               public override bool Equals (object other)
-               {
-                       return Equals (other as FontOptions);
-               }
-
-               bool Equals (FontOptions options)
-               {
-                       return options != null && NativeMethods.cairo_font_options_equal (Handle, options.Handle);
-               }
-
-               public IntPtr Handle {
-                       get { return handle; }
-               }
-
-               public override int GetHashCode ()
-               {
-                       return (int) NativeMethods.cairo_font_options_hash (handle);
-               }
-               
-               public void Merge (FontOptions other)
-               {
-                       if (other == null)
-                               throw new ArgumentNullException ("other");
-                       NativeMethods.cairo_font_options_merge (handle, other.Handle);
-               }
-
-               public Antialias Antialias {
-                       get { return NativeMethods.cairo_font_options_get_antialias (handle); }
-                       set { NativeMethods.cairo_font_options_set_antialias (handle, value); }
-               }
-
-               public HintMetrics HintMetrics {
-                       get { return NativeMethods.cairo_font_options_get_hint_metrics (handle);}
-                       set { NativeMethods.cairo_font_options_set_hint_metrics (handle, value); }
-               }
-
-               public HintStyle HintStyle {
-                       get { return NativeMethods.cairo_font_options_get_hint_style (handle);}
-                       set { NativeMethods.cairo_font_options_set_hint_style (handle, value); }
-               }
-
-               public Status Status {
-                       get { return NativeMethods.cairo_font_options_status (handle); }
-               }
-
-               public SubpixelOrder SubpixelOrder {
-                       get { return NativeMethods.cairo_font_options_get_subpixel_order (handle);}
-                       set { NativeMethods.cairo_font_options_set_subpixel_order (handle, value); }
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/FontSlant.cs b/Crow/src/Mono.Cairo/FontSlant.cs
deleted file mode 100644 (file)
index b3d8a1a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// Mono.Cairo.FontSlant.cs
-//
-// Authors:
-//   Duncan Mak (duncan@ximian.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum FontSlant
-       {
-               Normal,
-               Italic,
-               Oblique
-       }
-}
diff --git a/Crow/src/Mono.Cairo/FontType.cs b/Crow/src/Mono.Cairo/FontType.cs
deleted file mode 100644 (file)
index 5db44d4..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Mono.Cairo.FontType.cs
-//
-// Authors:
-//    John Luke
-//
-// (C) John Luke, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       
-       public enum FontType
-       {
-               Toy,
-               FreeType,
-               Win32,
-               Atsui,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/FontWeight.cs b/Crow/src/Mono.Cairo/FontWeight.cs
deleted file mode 100644 (file)
index 0b8fc6a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Mono.Cairo.FontWeight.cs
-//
-// Authors:
-//   Duncan Mak (duncan@ximian.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum FontWeight
-       {
-               Normal,
-               Bold,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Format.cs b/Crow/src/Mono.Cairo/Format.cs
deleted file mode 100644 (file)
index 54c8be1..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Mono.Cairo.Format.cs
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum Format
-       {
-               Argb32  = 0,
-               Rgb24   = 1,
-               A8      = 2,
-               A1      = 3,
-               Rgb16565 = 4,
-
-               //[Obsolete ("Use Argb32")]
-               ARGB32 = Argb32,
-               //[Obsolete ("Use Rgb24")]
-               RGB24   = Rgb24,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/GLSurface.cs b/Crow/src/Mono.Cairo/GLSurface.cs
deleted file mode 100644 (file)
index 60384b0..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// Mono.Cairo.GLSurface.cs
-//
-// Authors:
-//                     JP Bruyère (jp_bruyere@hotmail.com)
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2016 JP Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       public class GLSurface : Surface
-       {
-               
-               public GLSurface (IntPtr ptr, bool own) : base (ptr, own)
-               {}
-
-               public GLSurface (Device device, Cairo.Content content, uint tex, int width, int height)
-                       : base (NativeMethods.cairo_gl_surface_create_for_texture (device.Handle, (uint)content, tex, width, height), true)
-               {}
-
-               public GLSurface (EGLDevice device, IntPtr eglSurf, int width, int height)
-                       : base (NativeMethods.cairo_gl_surface_create_for_egl (device.Handle, eglSurf, width, height), true)
-               {}
-
-               public GLSurface (GLXDevice device, IntPtr window, int width, int height)
-                       : base (NativeMethods.cairo_gl_surface_create_for_window (device.Handle, window, width, height),true)
-               {}
-
-               public GLSurface (WGLDevice device, IntPtr hdc, int width, int height)
-                       : base (NativeMethods.cairo_gl_surface_create_for_dc (device.Handle, hdc, width, height), true)
-               {}
-
-               public void SwapBuffers(){
-                       NativeMethods.cairo_gl_surface_swapbuffers (this.Handle);
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/GLXDevice.cs b/Crow/src/Mono.Cairo/GLXDevice.cs
deleted file mode 100644 (file)
index 00cbce1..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// Mono.Cairo.Device.cs
-//
-// Authors:
-//                     JP Bruyère (jp_bruyere@hotmail.com)
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2016 JP Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace Crow.Cairo
-{
-       public class GLXDevice : Device
-       {
-               public GLXDevice (IntPtr dpy, IntPtr gl_ctx) : base (NativeMethods.cairo_glx_device_create (dpy, gl_ctx), true)
-               {
-               }
-
-               public IntPtr Display {
-                       get { return NativeMethods.cairo_glx_device_get_display (Handle); }
-               }
-
-               public IntPtr Context {
-                       get { return NativeMethods.cairo_glx_device_get_context (Handle); }
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/GlitzSurface.cs b/Crow/src/Mono.Cairo/GlitzSurface.cs
deleted file mode 100644 (file)
index 4aa2498..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// Mono.Cairo.GlitzSurface.cs
-//
-// Authors:
-//    Alp Toker
-//
-// (C) Alp Toker, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-       public class GlitzSurface : Surface
-       {
-               internal GlitzSurface (IntPtr handle, bool owns) : base (handle, owns)
-               {
-               }
-
-               public GlitzSurface (IntPtr glitz_surface)
-                       : base (NativeMethods.cairo_glitz_surface_create (glitz_surface), true)
-               {
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Glyph.cs b/Crow/src/Mono.Cairo/Glyph.cs
deleted file mode 100644 (file)
index ad51156..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// Mono.Cairo.Glyph.cs
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Crow.Cairo
-{
-       [StructLayout(LayoutKind.Sequential)]
-       public struct Glyph
-       {
-               internal long index;
-               internal double x;
-               internal double y;
-               
-               public Glyph (long index, double x, double y)
-               {
-                       this.index = index;
-                       this.x = x;
-                       this.y = y;
-               }
-               
-               public long Index {
-                       get { return index; }
-                       set { index = value; }
-               }
-               
-               public double X {
-                       get { return x; }
-                       set { x = value; }
-               }
-               
-               public double Y {
-                       get { return y; }
-                       set { y = value; }
-               }
-
-               public override bool Equals (object obj)
-               {
-                       if (obj is Glyph)
-                               return this == (Glyph)obj;
-                       return false;
-               }
-
-               public override int GetHashCode ()
-               {
-                       return (int) Index ^ (int) X ^ (int) Y;
-               }
-
-               internal static IntPtr GlyphsToIntPtr (Glyph[] glyphs)
-               {
-                       int size = Marshal.SizeOf (glyphs[0]);
-                       IntPtr dest = Marshal.AllocHGlobal (size * glyphs.Length);
-                       long pos = dest.ToInt64 ();
-                       for (int i = 0; i < glyphs.Length; i++, pos += size)
-                               Marshal.StructureToPtr (glyphs[i], (IntPtr) pos, false);
-                       return dest;
-               }
-
-               public static bool operator == (Glyph glyph, Glyph other)
-               {
-                       return glyph.Index == other.Index && glyph.X == other.X && glyph.Y == other.Y;
-               }
-
-               public static bool operator != (Glyph glyph, Glyph other)
-               {
-                       return !(glyph == other);
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Gradient.cs b/Crow/src/Mono.Cairo/Gradient.cs
deleted file mode 100644 (file)
index a1799e3..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// Mono.Cairo.Gradient.cs
-//
-// Author: Jordi Mas (jordi@ximian.com)
-//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
-// (C) Ximian Inc, 2004.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Color = Crow.Color;
-namespace Crow.Cairo {
-
-       public class Gradient : Pattern
-       {
-               protected Gradient (IntPtr handle, bool owned) : base (handle, owned)
-               {
-               }
-
-               [Obsolete]
-               protected Gradient ()
-               {
-               }
-
-               public int ColorStopCount {
-                       get {
-                               int cnt;
-                               NativeMethods.cairo_pattern_get_color_stop_count (Handle, out cnt);
-                               return cnt;
-                       }
-               }
-
-               public Status AddColorStop (double offset, Color c)
-               {
-                       NativeMethods.cairo_pattern_add_color_stop_rgba (Handle, offset, c.R / 255.0, c.G / 255.0, c.B / 255.0, c.A / 255.0);
-                       return Status;
-               }
-
-               public Status AddColorStopRgb (double offset, Color c)
-               {
-                       NativeMethods.cairo_pattern_add_color_stop_rgb (Handle, offset, c.R / 255.0, c.G / 255.0 / 255.0, c.B / 255.0);
-                       return Status;
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/HintMetrics.cs b/Crow/src/Mono.Cairo/HintMetrics.cs
deleted file mode 100644 (file)
index d830f3e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Mono.Cairo.HintMetrics.cs
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum HintMetrics
-       {
-               Default,
-               Off,
-               On,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/HintStyle.cs b/Crow/src/Mono.Cairo/HintStyle.cs
deleted file mode 100644 (file)
index 343daf3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// Mono.Cairo.HintStyle.cs
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum HintStyle
-       {
-               Default,
-               None,
-               Slight,
-               Medium,
-               Full,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/ImageSurface.cs b/Crow/src/Mono.Cairo/ImageSurface.cs
deleted file mode 100644 (file)
index 7c70569..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// Mono.Cairo.ImageSurface.cs
-//
-// Authors:
-//    Duncan Mak
-//    Miguel de Icaza.
-//
-// (C) Ximian Inc, 2003.
-// (C) Novell, Inc. 2003.
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Crow.Cairo {
-
-       public class ImageSurface : Surface
-       {
-               internal ImageSurface (IntPtr handle, bool owns) : base (handle, owns)
-               {
-               }
-
-               public ImageSurface (Format format, int width, int height)
-                       : base (NativeMethods.cairo_image_surface_create (format, width, height), true)
-               {
-               }
-
-               [Obsolete ("Use ImageSurface (byte[] data, Cairo.Format format, int width, int height, int stride)")]
-               public ImageSurface (ref byte[] data, Cairo.Format format, int width, int height, int stride)
-                       : this (data, format, width, height, stride)
-               {
-               }
-
-               public ImageSurface (byte[] data, Format format, int width, int height, int stride)
-                       : base (NativeMethods.cairo_image_surface_create_for_data (data, format, width, height, stride), true)
-               {
-               }
-
-               public ImageSurface (IntPtr data, Format format, int width, int height, int stride)
-                       : base (NativeMethods.cairo_image_surface_create_for_data (data, format, width, height, stride), true)
-               {
-               }
-
-               public ImageSurface (string filename)
-                       : base (NativeMethods.cairo_image_surface_create_from_png (filename), true)
-               {
-               }
-
-               public override int Width => NativeMethods.cairo_image_surface_get_width (Handle);
-               public override int Height => NativeMethods.cairo_image_surface_get_height (Handle);            
-
-               public byte[] Data {
-                       get {
-                               IntPtr ptr = NativeMethods.cairo_image_surface_get_data (Handle);
-                               int length = Height * Stride;
-                               byte[] data = new byte[length];
-                               Marshal.Copy (ptr, data, 0, length);
-                               return data;
-                       }
-               }
-
-               public IntPtr DataPtr {
-                       get {
-                               return NativeMethods.cairo_image_surface_get_data (Handle);
-                       }
-               }
-
-               public Format Format {
-                       get { return NativeMethods.cairo_image_surface_get_format (Handle); }
-               }
-
-               public int Stride {
-                       get { return NativeMethods.cairo_image_surface_get_stride (Handle); }
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/LineCap.cs b/Crow/src/Mono.Cairo/LineCap.cs
deleted file mode 100644 (file)
index 1560cda..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Mono.Cairo.LineCap.cs
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum LineCap
-       {
-               Butt,
-               Round,
-               Square,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/LineJoin.cs b/Crow/src/Mono.Cairo/LineJoin.cs
deleted file mode 100644 (file)
index 1d5389b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// Mono.Cairo.LineJoin.cs
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum LineJoin
-       {
-               Miter,
-               Round,
-               Bevel
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/LinearGradient.cs b/Crow/src/Mono.Cairo/LinearGradient.cs
deleted file mode 100644 (file)
index 100d1e6..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// Mono.Cairo.LinearGradient.cs
-//
-// Author: Jordi Mas (jordi@ximian.com)
-//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
-// (C) Ximian Inc, 2004.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       public class LinearGradient : Gradient
-       {
-               internal LinearGradient (IntPtr handle, bool owned) : base (handle, owned)
-               {
-               }
-
-               public LinearGradient (double x0, double y0, double x1, double y1)
-                       : base (NativeMethods.cairo_pattern_create_linear (x0, y0, x1, y1), true)
-               {
-               }
-
-               public PointD[] LinearPoints {
-                       get {
-                               double x0, y0, x1, y1;
-                               PointD[] points = new PointD [2];
-
-                               NativeMethods.cairo_pattern_get_linear_points (Handle, out x0, out y0, out x1, out y1);
-
-                               points[0] = new PointD (x0, y0);
-                               points[1] = new PointD (x1, y1);
-                               return points;
-                       }
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/Matrix.cs b/Crow/src/Mono.Cairo/Matrix.cs
deleted file mode 100644 (file)
index 7d5a6ac..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-// Mono.Cairo.Matrix.cs
-//
-// Author: Duncan Mak
-//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//         Idan Gazit (idan@fastmail.fm)
-//
-// (C) Ximian Inc, 2003 - 2005.
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Crow.Cairo {
-
-       [StructLayout(LayoutKind.Sequential)]
-       public class Matrix //: ICloneable
-       {
-               public double Xx;
-               public double Yx;
-               public double Xy;
-               public double Yy;
-               public double X0;
-               public double Y0;
-
-               public Matrix (double xx, double yx, double xy, double yy,
-                               double x0, double y0)
-               {
-                       this.Xx = xx; this.Yx = yx; this.Xy = xy;
-                       this.Yy = yy; this.X0 = x0; this.Y0 = y0;
-               }
-
-               public Matrix ()
-               {
-                       this.InitIdentity ();
-               }
-
-               public bool IsIdentity ()
-               {
-                       return (this == new Matrix ());
-               }
-
-               public void InitIdentity ()
-               {
-                       // this.Init(1,0,0,1,0,0);
-                       NativeMethods.cairo_matrix_init_identity (this);
-               }
-
-               public void Init (double xx, double yx, double xy, double yy,
-                                 double x0, double y0)
-               {
-                       this.Xx = xx; this.Yx = yx; this.Xy = xy;
-                       this.Yy = yy; this.X0 = x0; this.Y0 = y0;
-               }
-
-               public void InitTranslate (double tx, double ty)
-               {
-                       //this.Init (1, 0, 0, 1, tx, ty);
-                       NativeMethods.cairo_matrix_init_translate (this, tx, ty);
-               }
-
-               public void Translate (double tx, double ty)
-               {
-                       NativeMethods.cairo_matrix_translate (this, tx, ty);
-               }
-
-               public void InitScale (double sx, double sy)
-               {
-                       //this.Init (sx, 0, 0, sy, 0, 0);
-                       NativeMethods.cairo_matrix_init_scale (this, sx, sy);
-               }
-
-               public void Scale (double sx, double sy)
-               {
-                       NativeMethods.cairo_matrix_scale (this, sx, sy);
-               }
-
-               public void InitRotate (double radians)
-               {
-                       /*
-                       double s, c;
-                       s = Math.Sin (radians);
-                       c = Math.Cos (radians);
-                       this.Init (c, s, -s, c, 0, 0);
-                       */
-                       NativeMethods.cairo_matrix_init_rotate (this, radians);
-               }
-
-               public void Rotate (double radians)
-               {
-                       NativeMethods.cairo_matrix_rotate (this, radians);
-               }
-
-               public Cairo.Status Invert ()
-               {
-                       return NativeMethods.cairo_matrix_invert (this);
-               }
-
-               public void Multiply (Matrix b)
-               {
-                       Matrix a = (Matrix) this.Clone ();
-                       NativeMethods.cairo_matrix_multiply (this, a, b);
-               }
-
-               public static Matrix Multiply (Matrix a, Matrix b) {
-                       Matrix result = new Matrix ();
-                       NativeMethods.cairo_matrix_multiply (result, a, b);
-                       return result;
-               }
-
-
-               public void TransformDistance (ref double dx, ref double dy)
-               {
-                       NativeMethods.cairo_matrix_transform_distance (this, ref dx, ref dy);
-               }
-
-               public void TransformPoint (ref double x, ref double y)
-               {
-                       NativeMethods.cairo_matrix_transform_point (this, ref x, ref y);
-               }
-
-               public override String ToString ()
-               {
-                       String s = String.Format ("xx:{0:##0.0#} yx:{1:##0.0#} xy:{2:##0.0#} yy:{3:##0.0#} x0:{4:##0.0#} y0:{5:##0.0#}",
-                               this.Xx, this.Yx, this.Xy, this.Yy, this.X0, this.Y0);
-                       return s;
-               }
-
-               public static bool operator == (Matrix lhs, Matrix rhs)
-               {
-                       return (lhs.Xx == rhs.Xx &&
-                               lhs.Xy == rhs.Xy &&
-                               lhs.Yx == rhs.Yx &&
-                               lhs.Yy == rhs.Yy &&
-                               lhs.X0 == rhs.X0 &&
-                               lhs.Y0 == rhs.Y0 );
-               }
-
-               public static bool operator != (Matrix lhs, Matrix rhs)
-               {
-                       return !(lhs==rhs);
-               }
-
-
-
-               public override bool Equals(object o)
-               {
-                       if (! (o is Matrix))
-                               return false;
-                       else
-                               return (this == (Matrix) o);
-               }
-
-               public override int GetHashCode()
-               {
-                       return  (int)this.Xx ^ (int)this.Xx>>32 ^
-                               (int)this.Xy ^ (int)this.Xy>>32 ^
-                               (int)this.Yx ^ (int)this.Yx>>32 ^
-                               (int)this.Yy ^ (int)this.Yy>>32 ^
-                               (int)this.X0 ^ (int)this.X0>>32 ^
-                               (int)this.Y0 ^ (int)this.Y0>>32;
-               }
-
-               public object Clone()
-               {
-                       return this.MemberwiseClone ();
-               }
-
-       }
-}
diff --git a/Crow/src/Mono.Cairo/MeshPattern.cs b/Crow/src/Mono.Cairo/MeshPattern.cs
deleted file mode 100644 (file)
index 83da70b..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// Mono.Cairo.Pattern.cs
-//
-// Author: Jordi Mas (jordi@ximian.com)
-//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
-// (C) Ximian Inc, 2004.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       public class MeshPattern : Pattern
-       {
-               internal MeshPattern (IntPtr handle, bool owned) : base (handle, owned)
-               {
-               }
-
-               public MeshPattern ()
-                       : base (NativeMethods.cairo_pattern_create_mesh(), true)
-               {
-               }
-
-               //no idea why this is here, the base one is identical, but we can't remove it now
-               public new Extend Extend {
-                       set { NativeMethods.cairo_pattern_set_extend (Handle, value); }
-                       get { return NativeMethods.cairo_pattern_get_extend (Handle); }
-               }
-
-               public Filter Filter {
-                       set { NativeMethods.cairo_pattern_set_filter (Handle, value); }
-                       get { return NativeMethods.cairo_pattern_get_filter (Handle); }
-               }
-
-               public void BeginPatch(){
-                       NativeMethods.cairo_mesh_pattern_begin_patch (Handle);
-               }
-               public void EndPatch(){
-                       NativeMethods.cairo_mesh_pattern_end_patch (Handle);
-               }
-               public void MoveTo(double x, double y){
-                       NativeMethods.cairo_mesh_pattern_move_to (Handle, x, y);
-               }
-               public void MoveTo (PointD p) {
-                       NativeMethods.cairo_mesh_pattern_move_to (Handle, p.X, p.Y);
-               }
-               public void LineTo(double x, double y){
-                       NativeMethods.cairo_mesh_pattern_line_to (Handle, x, y);
-               }
-               public void LineTo (PointD p) {
-                       NativeMethods.cairo_mesh_pattern_line_to (Handle, p.X, p.Y);
-               }
-               public void CurveTo(double x1, double y1, double x2, double y2, double x3, double y3)
-               {
-                       NativeMethods.cairo_mesh_pattern_curve_to (Handle, x1, y1, x2, y2, x3, y3);
-               }
-               public void SetControlPoint(uint point_num, double x, double y){
-                       NativeMethods.cairo_mesh_pattern_set_control_point (Handle, point_num, x, y);
-               }
-               public void SetControlPoint (uint point_num, PointD p) {
-                       NativeMethods.cairo_mesh_pattern_set_control_point (Handle, point_num, p.X, p.Y);
-               }
-               public void SetCornerColorRGB(uint corner_num, double r, double g, double b){
-                       NativeMethods.cairo_mesh_pattern_set_corner_color_rgb (Handle, corner_num, r, g, b);
-               }
-               public void SetCornerColorRGBA(uint corner_num, double r, double g, double b, double a){
-                       NativeMethods.cairo_mesh_pattern_set_corner_color_rgba (Handle, corner_num, r, g, b, a);
-               }
-               public void SetCornerColor (uint corner_num, Color c) {
-                       NativeMethods.cairo_mesh_pattern_set_corner_color_rgba (Handle, corner_num, c.R, c.G, c.B, c.A);
-               }
-               public uint PatchCount {
-                       get {
-                               uint count = 0;
-                               NativeMethods.cairo_mesh_pattern_get_patch_count(Handle, out count);
-                               return count;
-                       }       
-               }
-               public Path GetPath(uint patch_num){
-                       return new Path(NativeMethods.cairo_mesh_pattern_get_path(Handle, patch_num));
-               }
-               public PointD GetControlPoint(uint point_num, uint patch_num = 0) {
-                       NativeMethods.cairo_mesh_pattern_get_control_point (Handle, patch_num, point_num, out double x, out double y);
-                       return new PointD (x, y);
-               }
-               public void GetCornerColorRGBA(){
-                       
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/NativeMethods-internal.cs b/Crow/src/Mono.Cairo/NativeMethods-internal.cs
deleted file mode 100644 (file)
index 6e6d507..0000000
+++ /dev/null
@@ -1,1026 +0,0 @@
-//
-// Cairo.cs - a simplistic binding of the Cairo API to C#.
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//          John Luke (john.luke@gmail.com)
-//          Alp Toker (alp@atoker.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2005 John Luke
-// Copyright (C) 2006 Alp Toker
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
-
-namespace Cairo
-{
-       // sort the functions like in the following page so it is easier to find what is missing
-       // http://cairographics.org/manual/index-all.html
-
-       public static class NativeMethods
-       {
-               #if MONOTOUCH
-               const string cairo = "__Internal";
-               #else
-               const string cairo = "libcairo-2.dll";
-               #endif
-
-               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               //public static extern void cairo_append_path (IntPtr cr, Path path);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_arc (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_arc_negative (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2);
-
-               //              [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               //              public static extern IntPtr cairo_atsui_font_face_create_for_atsu_font_id (IntPtr font_id);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_clip (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_clip_preserve (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_clip_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_close_path (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_copy_page (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_copy_path (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_copy_path_flat (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_append_path (IntPtr cr, IntPtr path);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_create (IntPtr target);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_curve_to (IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_debug_reset_static_data ();
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_destroy (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_device_to_user (IntPtr cr, ref double x, ref double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_device_to_user_distance (IntPtr cr, ref double dx, ref double dy);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_fill (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_fill_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_fill_preserve (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_font_extents (IntPtr cr, out FontExtents extents);
-
-               #region FontFace
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_font_face_destroy (IntPtr font_face);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern FontType cairo_font_face_get_type (IntPtr font_face);
-
-               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               //public static extern void cairo_font_face_get_user_data (IntPtr font_face);
-
-               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               //public static extern void cairo_font_face_set_user_data (IntPtr font_face);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_font_face_reference (IntPtr font_face);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_font_face_status (IntPtr font_face);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern uint cairo_font_face_get_reference_count (IntPtr surface);
-               #endregion
-
-               #region FontOptions
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_font_options_copy (IntPtr original);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_font_options_create ();
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_font_options_destroy (IntPtr options);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern bool cairo_font_options_equal (IntPtr options, IntPtr other);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Antialias cairo_font_options_get_antialias (IntPtr options);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern HintMetrics cairo_font_options_get_hint_metrics (IntPtr options);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern HintStyle cairo_font_options_get_hint_style (IntPtr options);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern SubpixelOrder cairo_font_options_get_subpixel_order (IntPtr options);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern long cairo_font_options_hash (IntPtr options);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_font_options_merge (IntPtr options, IntPtr other);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_font_options_set_antialias (IntPtr options, Antialias aa);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_font_options_set_hint_metrics (IntPtr options, HintMetrics metrics);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_font_options_set_hint_style (IntPtr options, HintStyle style);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_font_options_set_subpixel_order (IntPtr options, SubpixelOrder order);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_font_options_status (IntPtr options);
-               #endregion
-
-               #region Freetype / FontConfig
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_ft_font_face_create_for_ft_face (IntPtr face, int load_flags);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_ft_font_face_create_for_pattern (IntPtr fc_pattern);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_ft_font_options_substitute (FontOptions options, IntPtr pattern);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_ft_scaled_font_lock_face (IntPtr scaled_font);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_ft_scaled_font_unlock_face (IntPtr scaled_font);
-               #endregion
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Antialias cairo_get_antialias (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_get_current_point (IntPtr cr, out double x, out double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern FillRule cairo_get_fill_rule (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_get_font_face (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_get_font_matrix (IntPtr cr, out Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_get_font_options (IntPtr cr, IntPtr options);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_get_group_target (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern LineCap cairo_get_line_cap (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern LineJoin cairo_get_line_join (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern double cairo_get_line_width (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_get_matrix (IntPtr cr, Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern double cairo_get_miter_limit (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Operator cairo_get_operator (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern uint cairo_get_reference_count (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_get_source (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_get_target (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern double cairo_get_tolerance (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_glitz_surface_create (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_glyph_extents (IntPtr cr, IntPtr glyphs, int num_glyphs, out TextExtents extents);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_glyph_path (IntPtr cr, IntPtr glyphs, int num_glyphs);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               [return: MarshalAs (UnmanagedType.U1)]
-               public static extern bool cairo_has_current_point (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_identity_matrix (IntPtr cr);
-
-               #region Image Surface
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_image_surface_create (Cairo.Format format, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               public static extern IntPtr cairo_image_surface_create_for_data (byte[] data, Cairo.Format format, int width, int height, int stride);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_image_surface_create_for_data (IntPtr data, Cairo.Format format, int width, int height, int stride);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_image_surface_create_from_png  (string filename);
-
-               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               //public static extern IntPtr cairo_image_surface_create_from_png_stream  (string filename);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_image_surface_get_data (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Format cairo_image_surface_get_format (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_image_surface_get_height (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_image_surface_get_stride (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_image_surface_get_width  (IntPtr surface);
-               #endregion
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               [return: MarshalAs (UnmanagedType.U1)]
-               public static extern bool cairo_in_clip (IntPtr cr, double x, double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               [return: MarshalAs (UnmanagedType.U1)]
-               public static extern bool cairo_in_fill (IntPtr cr, double x, double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               [return: MarshalAs (UnmanagedType.U1)]
-               public static extern bool cairo_in_stroke (IntPtr cr, double x, double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_line_to (IntPtr cr, double x, double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_mask (IntPtr cr, IntPtr pattern);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_mask_surface (IntPtr cr, IntPtr surface, double x, double y);
-
-               #region Matrix
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_init (Matrix matrix, double xx, double yx, double xy, double yy, double x0, double y0);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_init_identity (Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_init_rotate (Matrix matrix, double radians);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_init_scale (Matrix matrix, double sx, double sy);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_init_translate (Matrix matrix, double tx, double ty);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_matrix_invert (Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_multiply (Matrix result, Matrix a, Matrix b);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_scale (Matrix matrix, double sx, double sy);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_rotate (Matrix matrix, double radians);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_transform_distance (Matrix matrix, ref double dx, ref double dy);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_transform_point (Matrix matrix, ref double x, ref double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_matrix_translate (Matrix matrix, double tx, double ty);
-               #endregion
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_move_to (IntPtr cr, double x, double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_new_path (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_new_sub_path (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_paint (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_paint_with_alpha (IntPtr cr, double alpha);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_path_destroy (IntPtr path);
-
-               #region Pattern
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_pattern_add_color_stop_rgb (IntPtr pattern, double offset, double red, double green, double blue);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_pattern_add_color_stop_rgba (IntPtr pattern, double offset, double red, double green, double blue, double alpha);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_pattern_get_color_stop_count (IntPtr pattern, out int count);
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_pattern_get_color_stop_rgba (IntPtr pattern, int index, out double offset, out double red, out double green, out double blue, out double alpha);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_pattern_get_surface (IntPtr pattern, out IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_pattern_create_linear (double x0, double y0, double x1, double y1);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_pattern_get_linear_points (IntPtr pattern, out double x0, out double y0, out double x1, out double y1);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_pattern_get_radial_circles (IntPtr pattern, out double x0, out double y0, out double r0, out double x1, out double y1, out double r1);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_pattern_create_rgb (double r, double g, double b);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_pattern_create_rgba (double r, double g, double b, double a);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_pattern_get_rgba (IntPtr pattern, out double red, out double green, out double blue, out double alpha);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_pattern_destroy (IntPtr pattern);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Extend cairo_pattern_get_extend (IntPtr pattern);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Filter cairo_pattern_get_filter (IntPtr pattern);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_pattern_get_matrix (IntPtr pattern, Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern PatternType cairo_pattern_get_type (IntPtr pattern);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_pattern_reference (IntPtr pattern);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_pattern_set_extend (IntPtr pattern, Extend extend);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_pattern_set_filter (IntPtr pattern, Filter filter);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_pattern_set_matrix (IntPtr pattern, Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_pattern_status (IntPtr pattern);
-               #endregion
-
-               #region PdfSurface
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_pdf_surface_create (string filename, double width, double height);
-
-               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               //public static extern IntPtr cairo_pdf_surface_create_for_stream (string filename, double width, double height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_pdf_surface_set_size (IntPtr surface, double x, double y);
-               #endregion
-
-               #region PostscriptSurface
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_ps_surface_create (string filename, double width, double height);
-
-               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               //public static extern IntPtr cairo_ps_surface_create_for_stream (string filename, double width, double height);
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_ps_surface_dsc_begin_page_setup (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_ps_surface_dsc_begin_setup (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_ps_surface_dsc_comment (IntPtr surface, string comment);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_ps_surface_set_size (IntPtr surface, double x, double y);
-               #endregion
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_pop_group (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_pop_group_to_source (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_push_group (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_push_group_with_content (IntPtr cr, Content content);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_quartz_surface_create (IntPtr context, bool flipped, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_reference (IntPtr cr);
-
-               #region Regions
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern bool cairo_region_contains_point (IntPtr region, int x, int y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern RegionOverlap cairo_region_contains_rectangle (IntPtr region, ref Crow.Rectangle rectangle);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_region_copy (IntPtr original);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_region_create ();
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_region_create_rectangle (ref Crow.Rectangle rect);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_region_create_rectangles (IntPtr rects, int count);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_region_destroy (IntPtr region);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern bool cairo_region_equal (IntPtr a, IntPtr b);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_region_get_extents (IntPtr region, out Crow.Rectangle extents);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_region_get_rectangle (IntPtr region, int nth, out Crow.Rectangle rectangle);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_region_intersect (IntPtr dst, IntPtr other);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_region_intersect_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern bool cairo_region_is_empty (IntPtr region);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_region_num_rectangles (IntPtr region);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_region_reference (IntPtr region);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_region_status (IntPtr region);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_region_subtract (IntPtr dst, IntPtr other);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_region_subtract_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_region_translate (IntPtr region, int dx, int dy);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_region_union (IntPtr dst, IntPtr other);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_region_union_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_region_xor (IntPtr dst, IntPtr other);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_region_xor_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
-               #endregion
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_rel_curve_to (IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_reset_clip (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_restore (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_rotate (IntPtr cr, double angle);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_save (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_scale (IntPtr cr, double sx, double sy);
-
-               #region ScaledFont
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_scaled_font_create (IntPtr fontFace, Matrix matrix, Matrix ctm, IntPtr options);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_scaled_font_destroy (IntPtr scaled_font);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_scaled_font_extents (IntPtr scaled_font, out FontExtents extents);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_scaled_font_get_ctm (IntPtr scaled_font, out Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_scaled_font_get_font_face (IntPtr scaled_font);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_scaled_font_get_font_matrix (IntPtr scaled_font, out Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_scaled_font_get_font_options (IntPtr scaled_font);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern FontType cairo_scaled_font_get_type (IntPtr scaled_font);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_scaled_font_glyph_extents (IntPtr scaled_font, IntPtr glyphs, int num_glyphs, out TextExtents extents);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_scaled_font_reference (IntPtr scaled_font);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_scaled_font_status (IntPtr scaled_font);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_scaled_font (IntPtr cr, IntPtr scaled_font);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_get_scaled_font (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               public static extern void cairo_scaled_font_text_extents (IntPtr scaled_font, byte[] utf8, out TextExtents extents);
-               #endregion
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_select_font_face (IntPtr cr, string family, FontSlant slant, FontWeight weight);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_antialias (IntPtr cr, Antialias antialias);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               public static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_get_dash (IntPtr cr, IntPtr dashes, out double offset);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_get_dash_count (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               public static extern void cairo_set_font_matrix (IntPtr cr, Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_font_options (IntPtr cr, IntPtr options);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_font_size (IntPtr cr, double size);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_line_cap (IntPtr cr, LineCap line_cap);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_line_join (IntPtr cr, LineJoin line_join);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_line_width (IntPtr cr, double width);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_matrix (IntPtr cr, Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_miter_limit (IntPtr cr, double limit);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_operator (IntPtr cr, Cairo.Operator op);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_source (IntPtr cr, IntPtr pattern);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_source_rgb (IntPtr cr, double red, double green, double blue);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_source_rgba (IntPtr cr, double red, double green, double blue, double alpha);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_source_surface (IntPtr cr, IntPtr surface, double x, double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_set_tolerance (IntPtr cr, double tolerance);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_show_glyphs (IntPtr ct, IntPtr glyphs, int num_glyphs);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_show_page (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_show_text (IntPtr cr, string str);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_status (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_status_to_string (Status status);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_stroke (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_stroke_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_stroke_preserve (IntPtr cr);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_rectangle_list_destroy (IntPtr rectangle_list);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_copy_clip_rectangle_list (IntPtr cr);
-
-               #region Surface
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_surface_create_similar (IntPtr surface, Cairo.Content content, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_surface_destroy (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_surface_finish (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_surface_flush (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Content cairo_surface_get_content (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_surface_get_device_offset (IntPtr surface, out double x, out double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_surface_get_font_options (IntPtr surface, IntPtr FontOptions);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern uint cairo_surface_get_reference_count (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern SurfaceType cairo_surface_get_type (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_surface_mark_dirty (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_surface_mark_dirty_rectangle (IntPtr surface, int x, int y, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_surface_reference (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_surface_set_device_offset (IntPtr surface, double x, double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_surface_set_fallback_resolution (IntPtr surface, double x, double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_surface_status (IntPtr surface);
-               #endregion
-
-               #region SVG surface
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_surface_write_to_png (IntPtr surface, string filename);
-
-               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               //public static extern void cairo_surface_write_to_png_stream (IntPtr surface, WriteFunc writeFunc);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_svg_surface_create (string fileName, double width, double height);
-
-               //[MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               //public static extern IntPtr cairo_svg_surface_create_for_stream (double width, double height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_svg_surface_restrict_to_version (IntPtr surface, SvgVersion version);
-               #endregion
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_text_extents (IntPtr cr, string txt, out TextExtents extents);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               public static extern void cairo_text_path (IntPtr ct, byte[] utf8);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_transform (IntPtr cr, Matrix matrix);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_translate (IntPtr cr, double tx, double ty);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_user_to_device_distance (IntPtr cr, ref double dx, ref double dy);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_version ();
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_version_string ();
-
-               #region DirectFBSurface
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_directfb_surface_create (IntPtr dfb, IntPtr surface);
-               #endregion
-
-               #region win32 fonts
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_win32_font_face_create_for_logfontw (IntPtr logfontw);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_win32_scaled_font_done_font (IntPtr scaled_font);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern double cairo_win32_scaled_font_get_metrics_factor (IntPtr scaled_font);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_win32_scaled_font_select_font (IntPtr scaled_font, IntPtr hdc);
-               #endregion
-
-               #region win32 surface
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_win32_surface_create (IntPtr hdc);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_win32_surface_create_with_ddb (IntPtr hdc, Format format, int width, int height);
-               #endregion
-
-               #region XcbSurface
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_xcb_surface_create (IntPtr connection, uint drawable, IntPtr visual, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_xcb_surface_create_for_bitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_xcb_surface_set_size (IntPtr surface, int width, int height);
-               #endregion
-
-               #region XlibSurface
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_xlib_surface_create (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_xlib_surface_create_for_bitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_xlib_surface_get_depth (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_xlib_surface_get_display (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_xlib_surface_get_drawable (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_xlib_surface_get_height (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_xlib_surface_get_screen (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_xlib_surface_get_visual (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_xlib_surface_get_width (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_xlib_surface_set_drawable (IntPtr surface, IntPtr drawable, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_xlib_surface_set_size (IntPtr surface, int width, int height);
-               #endregion
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_gl_device_set_thread_aware(IntPtr device, int value);
-
-               #region GLSurface
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_gl_surface_create (IntPtr device, uint content, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_gl_surface_create_for_texture (IntPtr device, uint content, uint tex, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_gl_surface_set_size (IntPtr surface, int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_gl_surface_get_width (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_gl_surface_get_height (IntPtr surface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_gl_surface_swapbuffers (IntPtr surf);
-               #endregion
-
-               #region GLX Functions
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_glx_device_create (IntPtr dpy, IntPtr gl_ctx);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_glx_device_get_display (IntPtr device);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_glx_device_get_context (IntPtr device);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_gl_surface_create_for_window (IntPtr device, IntPtr window, int width, int height);
-               #endregion
-
-               #region WGL Fucntions
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_wgl_device_create (IntPtr hglrc);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_wgl_device_get_context (IntPtr device);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_gl_surface_create_for_dc (IntPtr device, IntPtr hdc, int width, int height);
-               #endregion
-
-               #region EGL Functions
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_egl_device_create (IntPtr dpy, IntPtr gl_ctx);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_gl_surface_create_for_egl (IntPtr device, IntPtr eglSurface, int width, int height);
-               #endregion
-
-               #region DRM Functions
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_drm_device_get (IntPtr udev_device);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_drm_device_get_for_fd (int fd);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_drm_device_default ();
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_drm_device_get_fd (IntPtr cairo_device);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern  void cairo_drm_device_throttle (IntPtr cairo_device);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_drm_surface_create (IntPtr cairo_device, Format format,       int width, int height);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_drm_surface_create_for_name (IntPtr cairo_device, uint name, Format format,   int width, int height, int stride);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_drm_surface_create_from_cacheable_image (IntPtr cairo_device, IntPtr imageSurface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_drm_surface_enable_scan_out (IntPtr drmSurface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_drm_surface_get_handle (IntPtr drmSurface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_drm_surface_get_name (IntPtr drmSurface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Format cairo_drm_surface_get_format (IntPtr drmSurface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_drm_surface_get_width (IntPtr drmSurface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_drm_surface_get_height (IntPtr drmSurface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern int cairo_drm_surface_get_stride (IntPtr drmSurface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_drm_surface_map_to_image (IntPtr drmSurface);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void       cairo_drm_surface_unmap (IntPtr drmSurface,     IntPtr imageSurface);
-               #endregion
-
-               #region Device
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_device_acquire(IntPtr device);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_device_destroy (IntPtr device);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern IntPtr cairo_device_reference (IntPtr device);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void cairo_device_release(IntPtr device);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern Status cairo_device_status(IntPtr device);
-               #endregion
-
-
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
-               public static extern void crow_cairo_region_clear(IntPtr ctx, IntPtr reg);
-
-       }
-}
\ No newline at end of file
diff --git a/Crow/src/Mono.Cairo/NativeMethods.cs b/Crow/src/Mono.Cairo/NativeMethods.cs
deleted file mode 100644 (file)
index 4f93c41..0000000
+++ /dev/null
@@ -1,1071 +0,0 @@
-//
-// Cairo.cs - a simplistic binding of the Cairo API to C#.
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//          John Luke (john.luke@gmail.com)
-//          Alp Toker (alp@atoker.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2005 John Luke
-// Copyright (C) 2006 Alp Toker
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Crow.Cairo
-{
-       // sort the functions like in the following page so it is easier to find what is missing
-       // http://cairographics.org/manual/index-all.html
-
-       internal static class NativeMethods
-       {
-#if MONOTOUCH
-               const string cairo = "__Internal";
-#else
-       const string cairo = "cairo";
-#endif
-
-        //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-        //internal static extern void cairo_append_path (IntPtr cr, Path path);
-
-        [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_arc (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_arc_negative (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_atsui_font_face_create_for_atsu_font_id (IntPtr font_id);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_clip (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_clip_preserve (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_clip_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_close_path (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_copy_page (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_copy_path (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_copy_path_flat (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_append_path (IntPtr cr, IntPtr path);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_create (IntPtr target);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_curve_to (IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_debug_reset_static_data ();
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_destroy (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_device_to_user (IntPtr cr, ref double x, ref double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_device_to_user_distance (IntPtr cr, ref double dx, ref double dy);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_fill (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_fill_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_fill_preserve (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_font_extents (IntPtr cr, out FontExtents extents);
-
-               #region FontFace
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_font_face_destroy (IntPtr font_face);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern FontType cairo_font_face_get_type (IntPtr font_face);
-
-               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               //internal static extern void cairo_font_face_get_user_data (IntPtr font_face);
-
-               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               //internal static extern void cairo_font_face_set_user_data (IntPtr font_face);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_font_face_reference (IntPtr font_face);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_font_face_status (IntPtr font_face);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern uint cairo_font_face_get_reference_count (IntPtr surface);
-               #endregion
-
-               #region FontOptions
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_font_options_copy (IntPtr original);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_font_options_create ();
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_font_options_destroy (IntPtr options);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               [return: MarshalAs (UnmanagedType.U1)]
-               internal static extern bool cairo_font_options_equal (IntPtr options, IntPtr other);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Antialias cairo_font_options_get_antialias (IntPtr options);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern HintMetrics cairo_font_options_get_hint_metrics (IntPtr options);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern HintStyle cairo_font_options_get_hint_style (IntPtr options);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern SubpixelOrder cairo_font_options_get_subpixel_order (IntPtr options);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern long cairo_font_options_hash (IntPtr options);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_font_options_merge (IntPtr options, IntPtr other);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_font_options_set_antialias (IntPtr options, Antialias aa);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_font_options_set_hint_metrics (IntPtr options, HintMetrics metrics);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_font_options_set_hint_style (IntPtr options, HintStyle style);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_font_options_set_subpixel_order (IntPtr options, SubpixelOrder order);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_font_options_status (IntPtr options);
-               #endregion
-
-               #region Freetype / FontConfig
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_ft_font_face_create_for_ft_face (IntPtr face, int load_flags);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_ft_font_face_create_for_pattern (IntPtr fc_pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_ft_font_options_substitute (FontOptions options, IntPtr pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_ft_scaled_font_lock_face (IntPtr scaled_font);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_ft_scaled_font_unlock_face (IntPtr scaled_font);
-               #endregion
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Antialias cairo_get_antialias (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_get_current_point (IntPtr cr, out double x, out double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern FillRule cairo_get_fill_rule (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_get_font_face (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_get_font_matrix (IntPtr cr, out Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_get_font_options (IntPtr cr, IntPtr options);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_get_group_target (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern LineCap cairo_get_line_cap (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern LineJoin cairo_get_line_join (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern double cairo_get_line_width (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_get_matrix (IntPtr cr, Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern double cairo_get_miter_limit (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Operator cairo_get_operator (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern uint cairo_get_reference_count (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_get_source (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_get_target (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern double cairo_get_tolerance (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_glitz_surface_create (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_glyph_extents (IntPtr cr, IntPtr glyphs, int num_glyphs, out TextExtents extents);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_glyph_path (IntPtr cr, IntPtr glyphs, int num_glyphs);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               [return: MarshalAs (UnmanagedType.U1)]
-               internal static extern bool cairo_has_current_point (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_identity_matrix (IntPtr cr);
-
-               #region Image Surface
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_image_surface_create (Cairo.Format format, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_image_surface_create_for_data (byte[] data, Cairo.Format format, int width, int height, int stride);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_image_surface_create_for_data (IntPtr data, Cairo.Format format, int width, int height, int stride);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_image_surface_create_from_png  (string filename);
-
-               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               //internal static extern IntPtr cairo_image_surface_create_from_png_stream  (string filename);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_image_surface_get_data (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Format cairo_image_surface_get_format (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_image_surface_get_height (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_image_surface_get_stride (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_image_surface_get_width  (IntPtr surface);
-               #endregion
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               [return: MarshalAs (UnmanagedType.U1)]
-               internal static extern bool cairo_in_clip (IntPtr cr, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               [return: MarshalAs (UnmanagedType.U1)]
-               internal static extern bool cairo_in_fill (IntPtr cr, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               [return: MarshalAs (UnmanagedType.U1)]
-               internal static extern bool cairo_in_stroke (IntPtr cr, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_line_to (IntPtr cr, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_mask (IntPtr cr, IntPtr pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_mask_surface (IntPtr cr, IntPtr surface, double x, double y);
-
-               #region Matrix
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_init (Matrix matrix, double xx, double yx, double xy, double yy, double x0, double y0);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_init_identity (Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_init_rotate (Matrix matrix, double radians);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_init_scale (Matrix matrix, double sx, double sy);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_init_translate (Matrix matrix, double tx, double ty);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_matrix_invert (Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_multiply (Matrix result, Matrix a, Matrix b);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_scale (Matrix matrix, double sx, double sy);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_rotate (Matrix matrix, double radians);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_transform_distance (Matrix matrix, ref double dx, ref double dy);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_transform_point (Matrix matrix, ref double x, ref double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_matrix_translate (Matrix matrix, double tx, double ty);
-               #endregion
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_move_to (IntPtr cr, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_new_path (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_new_sub_path (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_paint (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_paint_with_alpha (IntPtr cr, double alpha);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_path_destroy (IntPtr path);
-
-               #region Pattern
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_pattern_add_color_stop_rgb (IntPtr pattern, double offset, double red, double green, double blue);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_pattern_add_color_stop_rgba (IntPtr pattern, double offset, double red, double green, double blue, double alpha);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_pattern_get_color_stop_count (IntPtr pattern, out int count);
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_pattern_get_color_stop_rgba (IntPtr pattern, int index, out double offset, out double red, out double green, out double blue, out double alpha);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_pattern_get_surface (IntPtr pattern, out IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_pattern_create_linear (double x0, double y0, double x1, double y1);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_pattern_get_linear_points (IntPtr pattern, out double x0, out double y0, out double x1, out double y1);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_pattern_get_radial_circles (IntPtr pattern, out double x0, out double y0, out double r0, out double x1, out double y1, out double r1);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_pattern_create_rgb (double r, double g, double b);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_pattern_create_rgba (double r, double g, double b, double a);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_pattern_get_rgba (IntPtr pattern, out double red, out double green, out double blue, out double alpha);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_pattern_destroy (IntPtr pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Extend cairo_pattern_get_extend (IntPtr pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Filter cairo_pattern_get_filter (IntPtr pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_pattern_get_matrix (IntPtr pattern, Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern PatternType cairo_pattern_get_type (IntPtr pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_pattern_reference (IntPtr pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_pattern_set_extend (IntPtr pattern, Extend extend);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_pattern_set_filter (IntPtr pattern, Filter filter);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_pattern_set_matrix (IntPtr pattern, Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_pattern_status (IntPtr pattern);
-
-               //mesh pattern
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_pattern_create_mesh ();
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_mesh_pattern_begin_patch (IntPtr pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_mesh_pattern_end_patch (IntPtr pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_mesh_pattern_move_to (IntPtr pattern, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_mesh_pattern_line_to (IntPtr pattern, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_mesh_pattern_curve_to (IntPtr pattern, double x1, double y1,
-                       double x2, double y2, double x3, double y3);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_mesh_pattern_set_control_point (IntPtr pattern, uint point_num, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_mesh_pattern_set_corner_color_rgb (IntPtr pattern, uint corner_num,
-                       double r, double g, double b);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_mesh_pattern_set_corner_color_rgba (IntPtr pattern, uint corner_num,
-                       double r, double g, double b, double a);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_mesh_pattern_get_patch_count (IntPtr pattern, out uint count);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_mesh_pattern_get_path (IntPtr pattern, uint patch_num);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_mesh_pattern_get_control_point (IntPtr pattern,
-                       uint patch_num, uint point_num, out double x, out double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_mesh_pattern_get_corner_color_rgba (IntPtr pattern,
-                       uint patch_num, uint point_num, out double r, out double g, out double b, out double a);
-               #endregion
-
-               #region PdfSurface
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_pdf_surface_create (string filename, double width, double height);
-
-               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               //internal static extern IntPtr cairo_pdf_surface_create_for_stream (string filename, double width, double height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_pdf_surface_set_size (IntPtr surface, double x, double y);
-               #endregion
-
-               #region PostscriptSurface
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_ps_surface_create (string filename, double width, double height);
-
-               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               //internal static extern IntPtr cairo_ps_surface_create_for_stream (string filename, double width, double height);
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_ps_surface_dsc_begin_page_setup (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_ps_surface_dsc_begin_setup (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_ps_surface_dsc_comment (IntPtr surface, string comment);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_ps_surface_set_size (IntPtr surface, double x, double y);
-               #endregion
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_pop_group (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_pop_group_to_source (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_push_group (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_push_group_with_content (IntPtr cr, Content content);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_quartz_surface_create (IntPtr context, bool flipped, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_reference (IntPtr cr);
-
-               #region Regions
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern bool cairo_region_contains_point (IntPtr region, int x, int y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern RegionOverlap cairo_region_contains_rectangle (IntPtr region, ref Crow.Rectangle rectangle);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_region_copy (IntPtr original);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_region_create ();
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_region_create_rectangle (ref Crow.Rectangle rect);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_region_create_rectangles (IntPtr rects, int count);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_region_destroy (IntPtr region);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern bool cairo_region_equal (IntPtr a, IntPtr b);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_region_get_extents (IntPtr region, out Crow.Rectangle extents);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_region_get_rectangle (IntPtr region, int nth, out Crow.Rectangle rectangle);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_region_intersect (IntPtr dst, IntPtr other);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_region_intersect_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern bool cairo_region_is_empty (IntPtr region);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_region_num_rectangles (IntPtr region);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_region_reference (IntPtr region);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_region_status (IntPtr region);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_region_subtract (IntPtr dst, IntPtr other);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_region_subtract_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_region_translate (IntPtr region, int dx, int dy);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_region_union (IntPtr dst, IntPtr other);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_region_union_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_region_xor (IntPtr dst, IntPtr other);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_region_xor_rectangle (IntPtr dst, ref Crow.Rectangle rectangle);
-               #endregion
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_rel_curve_to (IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_reset_clip (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_restore (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_rotate (IntPtr cr, double angle);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_save (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_scale (IntPtr cr, double sx, double sy);
-
-               #region ScaledFont
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_scaled_font_create (IntPtr fontFace, Matrix matrix, Matrix ctm, IntPtr options);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_scaled_font_destroy (IntPtr scaled_font);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_scaled_font_extents (IntPtr scaled_font, out FontExtents extents);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_scaled_font_get_ctm (IntPtr scaled_font, out Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_scaled_font_get_font_face (IntPtr scaled_font);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_scaled_font_get_font_matrix (IntPtr scaled_font, out Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_scaled_font_get_font_options (IntPtr scaled_font);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern FontType cairo_scaled_font_get_type (IntPtr scaled_font);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_scaled_font_glyph_extents (IntPtr scaled_font, IntPtr glyphs, int num_glyphs, out TextExtents extents);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_scaled_font_reference (IntPtr scaled_font);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_scaled_font_status (IntPtr scaled_font);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_scaled_font (IntPtr cr, IntPtr scaled_font);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_get_scaled_font (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_scaled_font_text_extents (IntPtr scaled_font, byte[] utf8, out TextExtents extents);
-               #endregion
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_select_font_face (IntPtr cr, string family, FontSlant slant, FontWeight weight);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_antialias (IntPtr cr, Antialias antialias);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_get_dash (IntPtr cr, IntPtr dashes, out double offset);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_get_dash_count (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_font_matrix (IntPtr cr, Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_font_options (IntPtr cr, IntPtr options);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_font_size (IntPtr cr, double size);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_line_cap (IntPtr cr, LineCap line_cap);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_line_join (IntPtr cr, LineJoin line_join);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_line_width (IntPtr cr, double width);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_matrix (IntPtr cr, Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_miter_limit (IntPtr cr, double limit);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_operator (IntPtr cr, Cairo.Operator op);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_source (IntPtr cr, IntPtr pattern);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_source_rgb (IntPtr cr, double red, double green, double blue);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_source_rgba (IntPtr cr, double red, double green, double blue, double alpha);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_source_surface (IntPtr cr, IntPtr surface, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_set_tolerance (IntPtr cr, double tolerance);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_show_glyphs (IntPtr ct, IntPtr glyphs, int num_glyphs);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_show_page (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_status (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_status_to_string (Status status);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_stroke (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_stroke_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_stroke_preserve (IntPtr cr);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_rectangle_list_destroy (IntPtr rectangle_list);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_copy_clip_rectangle_list (IntPtr cr);
-
-               #region Surface
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_surface_create_similar (IntPtr surface, Cairo.Content content, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_surface_destroy (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_surface_finish (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_surface_flush (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Content cairo_surface_get_content (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_surface_get_device_offset (IntPtr surface, out double x, out double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_surface_get_font_options (IntPtr surface, IntPtr FontOptions);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern uint cairo_surface_get_reference_count (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern SurfaceType cairo_surface_get_type (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_surface_mark_dirty (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_surface_mark_dirty_rectangle (IntPtr surface, int x, int y, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_surface_reference (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_surface_set_device_offset (IntPtr surface, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_surface_set_fallback_resolution (IntPtr surface, double x, double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_surface_status (IntPtr surface);
-               #endregion
-
-               #region SVG surface
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_surface_write_to_png (IntPtr surface, string filename);
-
-               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               //internal static extern void cairo_surface_write_to_png_stream (IntPtr surface, WriteFunc writeFunc);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_svg_surface_create (string fileName, double width, double height);
-
-               //[DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               //internal static extern IntPtr cairo_svg_surface_create_for_stream (double width, double height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_svg_surface_restrict_to_version (IntPtr surface, SvgVersion version);
-               #endregion
-
-               [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)]
-               internal static extern void cairo_show_text (IntPtr cr, byte[] text);
-
-               [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)]
-               internal static extern void cairo_text_extents (IntPtr cr, byte[] utf8, out TextExtents extents);
-
-               [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)]
-               internal static extern void cairo_show_text (IntPtr cr, ref byte utf8);
-
-               [DllImport (cairo, CallingConvention = CallingConvention.Cdecl)]
-               internal static extern void cairo_text_extents (IntPtr cr, ref byte utf8, out TextExtents extents);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_text_path (IntPtr ct, byte[] utf8);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_transform (IntPtr cr, Matrix matrix);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_translate (IntPtr cr, double tx, double ty);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_user_to_device_distance (IntPtr cr, ref double dx, ref double dy);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_version ();
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_version_string ();
-
-               #region DirectFBSurface
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_directfb_surface_create (IntPtr dfb, IntPtr surface);
-               #endregion
-
-               #region win32 fonts
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_win32_font_face_create_for_logfontw (IntPtr logfontw);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_win32_scaled_font_done_font (IntPtr scaled_font);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern double cairo_win32_scaled_font_get_metrics_factor (IntPtr scaled_font);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_win32_scaled_font_select_font (IntPtr scaled_font, IntPtr hdc);
-               #endregion
-
-               #region win32 surface
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_win32_surface_create (IntPtr hdc);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_win32_surface_create_with_ddb (IntPtr hdc, Format format, int width, int height);
-               #endregion
-
-               #region XcbSurface
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_xcb_surface_create (IntPtr connection, uint drawable, IntPtr visual, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_xcb_surface_create_for_bitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_xcb_surface_set_size (IntPtr surface, int width, int height);
-               #endregion
-
-               #region XlibSurface
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_xlib_surface_create (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_xlib_surface_create_for_bitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_xlib_surface_get_depth (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_xlib_surface_get_display (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_xlib_surface_get_drawable (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_xlib_surface_get_height (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_xlib_surface_get_screen (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_xlib_surface_get_visual (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_xlib_surface_get_width (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_xlib_surface_set_drawable (IntPtr surface, IntPtr drawable, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_xlib_surface_set_size (IntPtr surface, int width, int height);
-               #endregion
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_gl_device_set_thread_aware(IntPtr device, int value);
-
-               #region GLSurface
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_gl_surface_create (IntPtr device, uint content, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_gl_surface_create_for_texture (IntPtr device, uint content, uint tex, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_gl_surface_set_size (IntPtr surface, int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_gl_surface_get_width (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_gl_surface_get_height (IntPtr surface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_gl_surface_swapbuffers (IntPtr surf);
-               #endregion
-
-               #region GLX Functions
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_glx_device_create (IntPtr dpy, IntPtr gl_ctx);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_glx_device_get_display (IntPtr device);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_glx_device_get_context (IntPtr device);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_gl_surface_create_for_window (IntPtr device, IntPtr window, int width, int height);
-               #endregion
-
-               #region WGL Fucntions
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_wgl_device_create (IntPtr hglrc);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_wgl_device_get_context (IntPtr device);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_gl_surface_create_for_dc (IntPtr device, IntPtr hdc, int width, int height);
-               #endregion
-
-               #region EGL Functions
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_egl_device_create (IntPtr dpy, IntPtr gl_ctx);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_gl_surface_create_for_egl (IntPtr device, IntPtr eglSurface, int width, int height);
-               #endregion
-
-               #region DRM Functions
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_drm_device_get (IntPtr udev_device);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_drm_device_get_for_fd (int fd);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_drm_device_default ();
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_drm_device_get_fd (IntPtr cairo_device);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern  void cairo_drm_device_throttle (IntPtr cairo_device);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_drm_surface_create (IntPtr cairo_device, Format format,     int width, int height);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_drm_surface_create_for_name (IntPtr cairo_device, uint name, Format format, int width, int height, int stride);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_drm_surface_create_from_cacheable_image (IntPtr cairo_device, IntPtr imageSurface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_drm_surface_enable_scan_out (IntPtr drmSurface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_drm_surface_get_handle (IntPtr drmSurface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_drm_surface_get_name (IntPtr drmSurface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Format cairo_drm_surface_get_format (IntPtr drmSurface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_drm_surface_get_width (IntPtr drmSurface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_drm_surface_get_height (IntPtr drmSurface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern int cairo_drm_surface_get_stride (IntPtr drmSurface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_drm_surface_map_to_image (IntPtr drmSurface);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void     cairo_drm_surface_unmap (IntPtr drmSurface,     IntPtr imageSurface);
-               #endregion
-
-               #region Device
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_device_acquire(IntPtr device);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_device_destroy (IntPtr device);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern IntPtr cairo_device_reference (IntPtr device);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern void cairo_device_release(IntPtr device);
-
-               [DllImport (cairo, CallingConvention=CallingConvention.Cdecl)]
-               internal static extern Status cairo_device_status(IntPtr device);
-               #endregion
-       }
-}
\ No newline at end of file
diff --git a/Crow/src/Mono.Cairo/Operator.cs b/Crow/src/Mono.Cairo/Operator.cs
deleted file mode 100644 (file)
index 1c11ccc..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// Mono.Cairo.Operator.cs
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//          John Luke (john.luke@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2005 John Luke
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum Operator
-       {
-               Clear,
-               Source,
-               Over,
-               In,
-               Out,
-               Atop,
-
-               Dest,
-               DestOver,
-               DestIn,
-               DestOut,
-               DestAtop,
-               
-               Xor,
-               Add,
-               Saturate,
-               Multiply,
-               Screen,
-               Overlay,
-               Darken,
-               Lighten,
-
-       }
-}
diff --git a/Crow/src/Mono.Cairo/PSSurface.cs b/Crow/src/Mono.Cairo/PSSurface.cs
deleted file mode 100644 (file)
index cf90794..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// Mono.Cairo.PostscriptSurface.cs
-//
-// Authors:
-//    John Luke
-//
-// (C) John Luke, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       public class PSSurface : Surface
-       {
-               internal PSSurface (IntPtr handle, bool owns) : base (handle, owns)
-               {
-               }
-
-               public PSSurface (string filename, double width, double height)
-                       : base (NativeMethods.cairo_ps_surface_create (filename, width, height), true)
-               {
-               }
-
-               public void BeginPageSetup ()
-               {
-                       NativeMethods.cairo_ps_surface_dsc_begin_page_setup (Handle);
-               }
-
-               public void BeginSetup ()
-               {
-                       NativeMethods.cairo_ps_surface_dsc_begin_setup (Handle);
-               }
-
-               public void DscComment (string comment)
-               {
-                       NativeMethods.cairo_ps_surface_dsc_comment (Handle, comment);
-               }
-
-               public void SetSize (double width, double height)
-               {
-                       NativeMethods.cairo_ps_surface_set_size (Handle, width, height);
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Path.cs b/Crow/src/Mono.Cairo/Path.cs
deleted file mode 100644 (file)
index a55f03b..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// Mono.Cairo.Context.cs
-//
-// Author:
-//   Miguel de Icaza (miguel@novell.com)
-//
-// This is an OO wrapper API for the Cairo API.
-//
-// Copyright 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using Crow.Cairo;
-
-namespace Crow.Cairo {
-
-       public class Path : IDisposable
-       {
-               IntPtr handle = IntPtr.Zero;
-
-               internal Path (IntPtr handle)
-               {
-                       this.handle = handle;
-                       if (CairoDebug.Enabled)
-                               CairoDebug.OnAllocated (handle);
-               }
-
-               ~Path ()
-               {
-                       Dispose (false);
-               }
-
-               public IntPtr Handle { get { return handle; } }
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (!disposing || CairoDebug.Enabled)
-                               CairoDebug.OnDisposed<Path> (handle, disposing);
-
-                       if (!disposing|| handle == IntPtr.Zero)
-                               return;
-
-                       NativeMethods.cairo_path_destroy (handle);
-                       handle = IntPtr.Zero;
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Pattern.cs b/Crow/src/Mono.Cairo/Pattern.cs
deleted file mode 100644 (file)
index 3e933a1..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// Mono.Cairo.Pattern.cs
-//
-// Author: Jordi Mas (jordi@ximian.com)
-//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
-// (C) Ximian Inc, 2004.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-
-namespace Crow.Cairo {
-   
-       public class Pattern : IDisposable
-       {
-               [Obsolete]
-               protected IntPtr pattern = IntPtr.Zero;
-
-               public static Pattern Lookup (IntPtr pattern, bool owner)
-               {
-                       if (pattern == IntPtr.Zero)
-                               return null;
-                       
-                       PatternType pt = NativeMethods.cairo_pattern_get_type (pattern);
-                       switch (pt) {
-                       case PatternType.Solid:
-                               return new SolidPattern (pattern, owner);
-                       case PatternType.Surface:
-                               return new SurfacePattern (pattern, owner);
-                       case PatternType.Linear:
-                               return new LinearGradient (pattern, owner);
-                       case PatternType.Radial:
-                               return new RadialGradient (pattern, owner);
-                       default:
-                               return new Pattern (pattern, owner);
-                       }
-               }
-
-               [Obsolete]
-               protected Pattern ()
-               {
-               }
-               
-               internal Pattern (IntPtr handle, bool owned)
-               {
-                       Handle = handle;
-                       if (!owned)
-                               NativeMethods.cairo_pattern_reference (handle);
-                       if (CairoDebug.Enabled)
-                               CairoDebug.OnAllocated (handle);
-               }
-
-               ~Pattern ()
-               {
-                       Dispose (false);
-               }
-               
-               [Obsolete ("Use the SurfacePattern constructor")]
-               public Pattern (Surface surface)
-                       : this ( NativeMethods.cairo_pattern_create_for_surface (surface.Handle), true)
-               {
-               }
-               
-               [Obsolete]
-               protected void Reference ()
-               {
-                       NativeMethods.cairo_pattern_reference (pattern);
-               }
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (!disposing || CairoDebug.Enabled)
-                               CairoDebug.OnDisposed<Pattern> (Handle, disposing);
-
-                       if (!disposing|| Handle == IntPtr.Zero)
-                               return;
-
-                       NativeMethods.cairo_pattern_destroy (Handle);
-                       Handle = IntPtr.Zero;
-               }
-
-               [Obsolete ("Use Dispose()")]
-               public void Destroy ()
-               {
-                       Dispose ();
-               }
-
-               public Status Status
-               {
-                       get { return NativeMethods.cairo_pattern_status (Handle); }
-               }
-
-               public Extend Extend
-               {
-                       get { return NativeMethods.cairo_pattern_get_extend (Handle); }
-                       set { NativeMethods.cairo_pattern_set_extend (Handle, value); }
-               }
-
-               public Matrix Matrix {
-                       set {
-                               NativeMethods.cairo_pattern_set_matrix (Handle, value);
-                       }
-
-                       get {
-                               Matrix m = new Matrix ();
-                               NativeMethods.cairo_pattern_get_matrix (Handle, m);
-                               return m;
-                       }
-               }
-
-#pragma warning disable 612
-               public IntPtr Handle {
-                       get { return pattern; }
-                       private set { pattern = value; }
-               }
-#pragma warning restore 612
-
-               [Obsolete]
-               public IntPtr Pointer {
-                       get { return pattern; }
-               }
-
-               public PatternType PatternType {
-                       get { return NativeMethods.cairo_pattern_get_type (Handle); }
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/PatternType.cs b/Crow/src/Mono.Cairo/PatternType.cs
deleted file mode 100644 (file)
index deac3ab..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// Mono.Cairo.PatternType.cs
-//
-// Authors:
-//    John Luke
-//
-// (C) John Luke, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       
-       public enum PatternType
-       {
-               Solid,
-               Surface,
-               Linear,
-               Radial,
-               Mesh,
-               RasterSource
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/PdfSurface.cs b/Crow/src/Mono.Cairo/PdfSurface.cs
deleted file mode 100644 (file)
index 09a2d12..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// Mono.Cairo.PdfSurface.cs
-//
-// Authors:
-//    John Luke
-//
-// (C) John Luke, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       public class PdfSurface : Surface
-       {
-               internal PdfSurface (IntPtr handle, bool owns) : base (handle, owns)
-               {
-               }
-
-               public PdfSurface (string filename, double width, double height)
-                       : base (NativeMethods.cairo_pdf_surface_create (filename, width, height), true)
-               {
-               }
-
-               public void SetSize (double width, double height)
-               {
-                       NativeMethods.cairo_pdf_surface_set_size (Handle, width, height);
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/RadialGradient.cs b/Crow/src/Mono.Cairo/RadialGradient.cs
deleted file mode 100644 (file)
index 6abe267..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// Mono.Cairo.Pattern.cs
-//
-// Author: Jordi Mas (jordi@ximian.com)
-//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
-// (C) Ximian Inc, 2004.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       public class RadialGradient : Gradient
-       {
-               internal RadialGradient (IntPtr handle, bool owned) : base (handle, owned)
-               {
-               }
-
-               public RadialGradient (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1)
-                       : base (NativeMethods.cairo_pattern_create_radial (cx0, cy0, radius0, cx1, cy1, radius1), true)
-               {
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/Region.cs b/Crow/src/Mono.Cairo/Region.cs
deleted file mode 100644 (file)
index f2c111d..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright (C) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Crow.Cairo
-{
-       [StructLayout(LayoutKind.Sequential)]
-       public struct RectangleList {
-               public Status Status;
-               public IntPtr Rectangles;
-               public int NumRectangles;
-       }
-
-       public enum RegionOverlap {
-               In,
-               Out,
-               Part,
-       }
-
-       public class Region : IDisposable {
-
-               IntPtr handle;
-               public IntPtr Handle {
-                       get { return handle; }
-               }
-
-               [Obsolete]
-               public Region (IntPtr handle) : this (handle, false) {}
-
-               public Region (IntPtr handle, bool owned)
-               {
-                       this.handle = handle;
-                       if (!owned)
-                               NativeMethods.cairo_region_reference (handle);
-                       if (CairoDebug.Enabled)
-                               CairoDebug.OnAllocated (handle);
-               }
-
-               public Region () : this (NativeMethods.cairo_region_create () , true)
-               {
-               }
-
-               public Region (Crow.Rectangle rect)
-               {
-                       handle = NativeMethods.cairo_region_create_rectangle (ref rect);
-               }
-
-               public Region (RectangleList rects)
-               {
-                       handle = NativeMethods.cairo_region_create_rectangles (rects.Rectangles, rects.NumRectangles);
-               }
-
-               public Region Copy ()
-               {
-                       return new Region (NativeMethods.cairo_region_copy (Handle), true);
-               }
-
-               #region IDisposable
-               ~Region ()
-               {
-                       Dispose (false);
-               }
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (!disposing || CairoDebug.Enabled)
-                               CairoDebug.OnDisposed<Region> (handle, disposing);
-
-                       if (!disposing|| handle == IntPtr.Zero)
-                               return;
-
-                       NativeMethods.cairo_region_destroy (Handle);
-                       handle = IntPtr.Zero;
-               }
-               #endregion
-
-               public override bool Equals (object obj)
-               {
-                       return (obj is Region) && NativeMethods.cairo_region_equal (Handle, (obj as Region).Handle);
-               }
-
-               public override int GetHashCode ()
-               {
-                       return Handle.GetHashCode ();
-               }
-
-               public Status Status {
-                       get { return NativeMethods.cairo_region_status (Handle); }
-               }
-
-               public Crow.Rectangle Extents {
-                       get {
-                               Crow.Rectangle result;
-                               NativeMethods.cairo_region_get_extents (Handle, out result);
-                               return result;
-                       }
-               }
-
-               public int NumRectangles {
-                       get { return NativeMethods.cairo_region_num_rectangles (Handle); }
-               }
-
-               public Crow.Rectangle GetRectangle (int nth)
-               {
-                       Crow.Rectangle val;
-                       NativeMethods.cairo_region_get_rectangle (Handle, nth, out val);
-                       return val;
-               }
-
-               public bool IsEmpty {
-                       get { return NativeMethods.cairo_region_is_empty (Handle); }
-               }
-
-               public RegionOverlap Contains (Crow.Rectangle rectangle)
-               {
-                       return NativeMethods.cairo_region_contains_rectangle (Handle, ref rectangle);
-               }
-
-               public bool Contains (int x, int y)
-               {
-                       return NativeMethods.cairo_region_contains_point (Handle, x, y);
-               }
-
-               public void Translate (int dx, int dy)
-               {
-                       NativeMethods.cairo_region_translate (Handle, dx, dy);
-               }
-
-               public Status Subtract (Region other)
-               {
-                       return NativeMethods.cairo_region_subtract (Handle, other.Handle);
-               }
-
-               public Status SubtractRectangle (Crow.Rectangle rectangle)
-               {
-                       return NativeMethods.cairo_region_subtract_rectangle (Handle, ref rectangle);
-               }
-
-               public Status Intersect (Region other)
-               {
-                       return NativeMethods.cairo_region_intersect (Handle, other.Handle);
-               }
-
-               public Status IntersectRectangle (Crow.Rectangle rectangle)
-               {
-                       return NativeMethods.cairo_region_intersect_rectangle (Handle, ref rectangle);
-               }
-
-               public Status Union (Region other)
-               {
-                       return NativeMethods.cairo_region_union (Handle, other.Handle);
-               }
-
-               public Status UnionRectangle (Crow.Rectangle rectangle)
-               {
-                       return NativeMethods.cairo_region_union_rectangle (Handle, ref rectangle);
-               }
-
-               public Status Xor (Region other)
-               {
-                       return NativeMethods.cairo_region_xor (Handle, other.Handle);
-               }
-
-               public Status XorRectangle (Crow.Rectangle rectangle)
-               {
-                       return NativeMethods.cairo_region_xor_rectangle (Handle, ref rectangle);
-               }
-               public void Reset () {
-                       if (IsEmpty)
-                               return;
-                       NativeMethods.cairo_region_destroy (Handle);
-                       handle = NativeMethods.cairo_region_create ();                  
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/ScaledFont.cs b/Crow/src/Mono.Cairo/ScaledFont.cs
deleted file mode 100644 (file)
index 594d1be..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// Mono.Cairo.ScaledFont.cs
-//
-// (c) 2008 Jordi Mas i Hernandez (jordimash@gmail.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Crow.Cairo {
-   
-       public class ScaledFont : IDisposable
-       {
-               protected IntPtr handle = IntPtr.Zero;
-
-               internal ScaledFont (IntPtr handle, bool owner)
-               {
-                       this.handle = handle;
-                       if (!owner)
-                               NativeMethods.cairo_scaled_font_reference (handle);
-                       if (CairoDebug.Enabled)
-                               CairoDebug.OnAllocated (handle);
-               }
-
-               public ScaledFont (FontFace fontFace, Matrix matrix, Matrix ctm, FontOptions options)
-                       : this (NativeMethods.cairo_scaled_font_create (fontFace.Handle, matrix, ctm, options.Handle), true)
-               {
-               }
-
-               ~ScaledFont ()
-               {
-                       Dispose (false);
-               }
-
-               public IntPtr Handle {
-                       get {
-                               return handle;
-                       }
-               }
-
-               public FontExtents FontExtents {
-                       get {
-                               FontExtents extents;
-                               NativeMethods.cairo_scaled_font_extents (handle, out extents);
-                               return extents;
-                       }
-               }
-
-               public Matrix FontMatrix {
-                       get {
-                               Matrix m;
-                               NativeMethods.cairo_scaled_font_get_font_matrix (handle, out m);
-                               return m;
-                       }
-               }
-
-               public FontType FontType {
-                       get {
-                               return NativeMethods.cairo_scaled_font_get_type (handle);
-                       }
-               }
-
-               public TextExtents GlyphExtents (Glyph[] glyphs)
-               {
-                       IntPtr ptr = Context.FromGlyphToUnManagedMemory (glyphs);
-                       TextExtents extents;
-
-                       NativeMethods.cairo_scaled_font_glyph_extents (handle, ptr, glyphs.Length, out extents);
-
-                       Marshal.FreeHGlobal (ptr);
-                       return extents;
-               }
-       
-               public Status Status
-               {
-                       get { return NativeMethods.cairo_scaled_font_status (handle); }
-               }
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (!disposing || CairoDebug.Enabled)
-                               CairoDebug.OnDisposed<ScaledFont> (handle, disposing);
-
-                       if (!disposing|| handle == IntPtr.Zero)
-                               return;
-
-                       NativeMethods.cairo_scaled_font_destroy (handle);
-                       handle = IntPtr.Zero;
-               }
-
-               [Obsolete]
-               protected void Reference ()
-               {
-                       NativeMethods.cairo_scaled_font_reference (handle);
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/SolidPattern.cs b/Crow/src/Mono.Cairo/SolidPattern.cs
deleted file mode 100644 (file)
index 6cd89f8..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// Mono.Cairo.Pattern.cs
-//
-// Author: Jordi Mas (jordi@ximian.com)
-//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
-// (C) Ximian Inc, 2004.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Color = Crow.Color;
-namespace Crow.Cairo {
-
-       public class SolidPattern : Pattern
-       {
-               internal SolidPattern (IntPtr handle, bool owned) : base (handle, owned)
-               {
-               }
-
-               public SolidPattern (Color color)
-                       : base (NativeMethods.cairo_pattern_create_rgba (color.R, color.G, color.B, color.A), true)
-               {
-               }
-
-               public SolidPattern (double r, double g, double b)
-                       : base (NativeMethods.cairo_pattern_create_rgb (r, g, b), true)
-               {
-               }
-
-               public SolidPattern (double r, double g, double b, double a)
-                       : base (NativeMethods.cairo_pattern_create_rgba (r, g, b, a), true)
-               {
-               }
-
-               public SolidPattern (Color color, bool solid)
-                       : base (solid
-                                       ? NativeMethods.cairo_pattern_create_rgb (color.R, color.G, color.B)
-                                       : NativeMethods.cairo_pattern_create_rgba (color.R, color.G, color.B, color.A),
-                               true)
-               {
-               }
-
-               public Color Color {
-                       get {
-                               double red, green, blue, alpha;
-                               NativeMethods.cairo_pattern_get_rgba  (Handle, out red, out green, out blue, out alpha);
-                               return new Color (red, green, blue, alpha);
-                       }
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/Status.cs b/Crow/src/Mono.Cairo/Status.cs
deleted file mode 100644 (file)
index 2df1558..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// Mono.Cairo.Status.cs
-//
-// Authors:
-//   Duncan Mak (duncan@ximian.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//   John Luke (john.luke@gmail.com)
-//   Alp Toker (alp@atoker.com)
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2005 John Luke
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum Status
-       {
-               Success = 0,
-               NoMemory,
-               InvalidRestore,
-               InvalidPopGroup,
-               NoCurrentPoint,
-               InvalidMatrix,
-               InvalidStatus,
-               NullPointer,
-               InvalidString,
-               InvalidPathData,
-               ReadError,
-               WriteError,
-               SurfaceFinished,
-               SurfaceTypeMismatch,
-               PatternTypeMismatch,
-               InvalidContent,
-               InvalidFormat,
-               InvalidVisual,
-               FileNotFound,
-               InvalidDash,
-               InvalidDscComment,
-               InvalidIndex,
-               ClipNotRepresentable,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/SubpixelOrder.cs b/Crow/src/Mono.Cairo/SubpixelOrder.cs
deleted file mode 100644 (file)
index 95f3cbe..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// Mono.Cairo.Cairo.cs
-//
-// Authors:
-//   John Luke (john.luke@gmail.com)
-//
-// Copyright (C) John Luke 2005
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo
-{
-       
-       public enum SubpixelOrder
-       {
-               Default,
-               Rgb,
-               Bgr,
-               Vrgb,
-               Vbgr,
-       }
-}
diff --git a/Crow/src/Mono.Cairo/Surface.cs b/Crow/src/Mono.Cairo/Surface.cs
deleted file mode 100644 (file)
index 56c1553..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-//
-// Mono.Cairo.Surface.cs
-//
-// Authors:
-//    Duncan Mak
-//    Miguel de Icaza.
-//    Alp Toker
-//
-// (C) Ximian Inc, 2003.
-// (C) Novell, Inc. 2003.
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-
-namespace Crow.Cairo {
-
-       public class Surface : IDisposable
-       {
-               IntPtr handle = IntPtr.Zero;
-
-               [Obsolete]
-               protected Surface()
-               {
-               }
-
-               [Obsolete]
-               protected Surface (IntPtr ptr) : this (ptr, true)
-               {
-               }
-
-               protected Surface (IntPtr handle, bool owner)
-               {
-                       this.handle = handle;
-                       if (!owner)
-                               NativeMethods.cairo_surface_reference (handle);
-                       if (CairoDebug.Enabled)
-                               CairoDebug.OnAllocated (handle);
-               }
-
-               public static Surface Lookup (IntPtr surface, bool owned)
-               {
-                       SurfaceType st = NativeMethods.cairo_surface_get_type (surface);
-                       switch (st) {
-                       case SurfaceType.Image:
-                               return new ImageSurface (surface, owned);
-                       case SurfaceType.Xlib:
-                               return new XlibSurface (surface, owned);
-                       case SurfaceType.Xcb:
-                               return new XcbSurface (surface, owned);
-                       case SurfaceType.Glitz:
-                               return new GlitzSurface (surface, owned);
-                       case SurfaceType.Win32:
-                               return new Win32Surface (surface, owned);
-                       case SurfaceType.Pdf:
-                               return new PdfSurface (surface, owned);
-                       case SurfaceType.PS:
-                               return new PSSurface (surface, owned);
-                       case SurfaceType.DirectFB:
-                               return new DirectFBSurface (surface, owned);
-                       case SurfaceType.Svg:
-                               return new SvgSurface (surface, owned);
-                       case SurfaceType.GL:
-                               return new GLSurface (surface, owned);
-                       default:
-                               return new Surface (surface, owned);
-                       }
-               }
-
-               [Obsolete ("Use an ImageSurface constructor instead.")]
-               public static Cairo.Surface CreateForImage (
-                       ref byte[] data, Cairo.Format format, int width, int height, int stride)
-               {
-                       IntPtr p = NativeMethods.cairo_image_surface_create_for_data (
-                               data, format, width, height, stride);
-
-                       return new Cairo.Surface (p, true);
-               }
-
-               [Obsolete ("Use an ImageSurface constructor instead.")]
-               public static Cairo.Surface CreateForImage (
-                       Cairo.Format format, int width, int height)
-               {
-                       IntPtr p = NativeMethods.cairo_image_surface_create (
-                               format, width, height);
-
-                       return new Cairo.Surface (p, true);
-               }
-
-
-               public Cairo.Surface CreateSimilar (
-                       Cairo.Content content, int width, int height)
-               {
-                       IntPtr p = NativeMethods.cairo_surface_create_similar (
-                               this.Handle, content, width, height);
-
-                       return Surface.Lookup(p, true);
-               }
-
-               ~Surface ()
-               {
-                       Dispose (false);
-               }
-
-
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (!disposing || CairoDebug.Enabled)
-                               CairoDebug.OnDisposed<Surface> (handle, disposing);
-
-                       if (!disposing|| handle == IntPtr.Zero)
-                               return;
-
-                       NativeMethods.cairo_surface_destroy (handle);
-                       handle = IntPtr.Zero;
-               }
-               public virtual void SetSize (int width, int height) {                   
-               }
-
-               public Status Finish ()
-               {
-                       NativeMethods.cairo_surface_finish (handle);
-                       return Status;
-               }
-
-               public void Flush ()
-               {
-                       NativeMethods.cairo_surface_flush (handle);
-               }
-
-               public void MarkDirty ()
-               {
-                       NativeMethods.cairo_surface_mark_dirty (Handle);
-               }
-
-               public void MarkDirty (Crow.Rectangle rectangle)
-               {
-                       NativeMethods.cairo_surface_mark_dirty_rectangle (Handle, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
-               }
-               public virtual int Width => -1;
-               public virtual int Height => -1;
-
-               public IntPtr Handle {
-                       get {
-                               return handle;
-                       }
-               }
-
-               public PointD DeviceOffset {
-                       get {
-                               double x, y;
-                               NativeMethods.cairo_surface_get_device_offset (handle, out x, out y);
-                               return new PointD (x, y);
-                       }
-
-                       set {
-                               NativeMethods.cairo_surface_set_device_offset (handle, value.X, value.Y);
-                       }
-               }
-
-               [Obsolete ("Use Dispose()")]
-               public void Destroy()
-               {
-                       Dispose ();
-               }
-
-               public void SetFallbackResolution (double x, double y)
-               {
-                       NativeMethods.cairo_surface_set_fallback_resolution (handle, x, y);
-               }
-
-               public void WriteToPng (string filename)
-               {
-                       NativeMethods.cairo_surface_write_to_png (handle, filename);
-               }
-
-               [Obsolete ("Use Handle instead.")]
-               public IntPtr Pointer {
-                       get {
-                               return handle;
-                       }
-               }
-
-               public Status Status {
-                       get { return NativeMethods.cairo_surface_status (handle); }
-               }
-
-               public Content Content {
-                       get { return NativeMethods.cairo_surface_get_content (handle); }
-               }
-
-               public SurfaceType SurfaceType {
-                       get { return NativeMethods.cairo_surface_get_type (handle); }
-               }
-
-               public uint ReferenceCount {
-                       get { return NativeMethods.cairo_surface_get_reference_count (handle); }
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/SurfacePattern.cs b/Crow/src/Mono.Cairo/SurfacePattern.cs
deleted file mode 100644 (file)
index 53a90d3..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// Mono.Cairo.Pattern.cs
-//
-// Author: Jordi Mas (jordi@ximian.com)
-//         Hisham Mardam Bey (hisham.mardambey@gmail.com)
-// (C) Ximian Inc, 2004.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       public class SurfacePattern : Pattern
-       {
-               internal SurfacePattern (IntPtr handle, bool owned) : base (handle, owned)
-               {
-               }
-
-               public SurfacePattern (Surface surface)
-                       : base (NativeMethods.cairo_pattern_create_for_surface (surface.Handle), true)
-               {
-               }
-
-               //no idea why this is here, the base one is identical, but we can't remove it now
-               public new Extend Extend {
-                       set { NativeMethods.cairo_pattern_set_extend (Handle, value); }
-                       get { return NativeMethods.cairo_pattern_get_extend (Handle); }
-               }
-
-               public Filter Filter {
-                       set { NativeMethods.cairo_pattern_set_filter (Handle, value); }
-                       get { return NativeMethods.cairo_pattern_get_filter (Handle); }
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/SurfaceType.cs b/Crow/src/Mono.Cairo/SurfaceType.cs
deleted file mode 100644 (file)
index bd992db..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// Mono.Cairo.SurfaceType.cs
-//
-// Authors:
-//    John Luke
-//
-// (C) John Luke, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       
-       public enum SurfaceType
-       {
-               Image,
-               Pdf,
-               PS,
-               Xlib,
-               Xcb,
-               Glitz,
-               Quartz,
-               Win32,
-               BeOS,
-               DirectFB,
-               Svg,
-               OS2,
-               Win32Printing,
-               QuartzImage,
-               Script,
-               Qt,
-               Recording,
-               VG,
-               GL,
-               Drm,
-               Tee,
-               Xml,
-               Skia,
-               SubSurface
-       }
-}
diff --git a/Crow/src/Mono.Cairo/SvgSurface.cs b/Crow/src/Mono.Cairo/SvgSurface.cs
deleted file mode 100644 (file)
index c7d7298..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// Mono.Cairo.SvgSurface.cs
-//
-// Authors:
-//    John Luke
-//
-// (C) John Luke, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       public class SvgSurface : Surface
-       {
-               internal SvgSurface (IntPtr handle, bool owns) : base (handle, owns)
-               {
-               }
-
-               public SvgSurface (string filename, double width, double height)
-                       : base (NativeMethods.cairo_svg_surface_create (filename, width, height), true)
-               {
-               }
-
-               public void RestrictToVersion (SvgVersion version)
-               {
-                       NativeMethods.cairo_svg_surface_restrict_to_version (Handle, version);
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/SvgVersion.cs b/Crow/src/Mono.Cairo/SvgVersion.cs
deleted file mode 100644 (file)
index 916fb86..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Mono.Cairo.SvgVersion.cs
-//
-// Authors:
-//    John Luke
-//
-// (C) John Luke, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       
-       public enum SvgVersion
-       {
-               // FIXME: yuck
-               OnePointOne = 0,
-               OnePointTwo,
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/TextExtents.cs b/Crow/src/Mono.Cairo/TextExtents.cs
deleted file mode 100644 (file)
index 965ca04..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// Mono.Cairo.TextExtents.cs
-//
-// Authors:
-//   Duncan Mak (duncan@ximian.com)
-//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
-//
-// (C) Ximian, Inc. 2003
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Crow.Cairo
-{
-       [StructLayout (LayoutKind.Sequential)]
-       public struct TextExtents
-       {
-               double xbearing;
-               double ybearing;
-               double width;
-               double height;
-               double xadvance;
-               double yadvance;
-               
-               public double XBearing {
-                       get { return xbearing; }
-                       set { xbearing = value; }
-               }
-               
-               public double YBearing {
-                       get { return ybearing; }
-                       set { ybearing = value; }
-               }
-               
-               public double Width {
-                       get { return width; }
-                       set { width = value; }
-               }
-               
-               public double Height {
-                       get { return height; }
-                       set { height = value; }
-               }
-               
-               public double XAdvance {
-                       get { return xadvance; }
-                       set { xadvance = value; }
-               }
-               
-               public double YAdvance {
-                       get { return yadvance; }
-                       set { yadvance = value; }
-               }
-
-               public override bool Equals (object obj)
-               {
-                       if (obj is TextExtents)
-                               return this == (TextExtents)obj;
-                       return false;
-               }
-
-               public override int GetHashCode ()
-               {
-                       return (int)XBearing ^ (int)YBearing ^ (int)Width ^ (int)Height ^ (int)XAdvance ^ (int)YAdvance;
-               }
-
-               public static bool operator == (TextExtents extents, TextExtents other)
-               {
-                       return extents.XBearing == other.XBearing && extents.YBearing == other.YBearing && extents.Width == other.Width && extents.Height == other.Height && extents.XAdvance == other.XAdvance && extents.YAdvance == other.YAdvance;
-               }
-
-               public static bool operator != (TextExtents extents, TextExtents other)
-               {
-                       return !(extents == other);
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/WGLDevice.cs b/Crow/src/Mono.Cairo/WGLDevice.cs
deleted file mode 100644 (file)
index 308cfad..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// Mono.Cairo.Device.cs
-//
-// Authors:
-//                     JP Bruyère (jp_bruyere@hotmail.com)
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2016 JP Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace Crow.Cairo
-{
-       public class WGLDevice : Device
-       {
-               public WGLDevice (IntPtr hglrc) : base (NativeMethods.cairo_wgl_device_create (hglrc), true)
-               {
-               }
-
-               public IntPtr Context {
-                       get { return NativeMethods.cairo_wgl_device_get_context (Handle); }
-               }
-       }
-}
-
diff --git a/Crow/src/Mono.Cairo/Win32Surface.cs b/Crow/src/Mono.Cairo/Win32Surface.cs
deleted file mode 100644 (file)
index 4776a19..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// Mono.Cairo.Win32Surface.cs
-//
-// Authors:
-//    John Luke
-//
-// (C) John Luke, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-       
-       public class Win32Surface : Surface
-       {
-               internal Win32Surface (IntPtr handle, bool owns) : base (handle, owns)
-               {
-               }
-               
-               public Win32Surface (IntPtr hdc)
-                       : base (NativeMethods.cairo_win32_surface_create (hdc), true)
-               {
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/XcbSurface.cs b/Crow/src/Mono.Cairo/XcbSurface.cs
deleted file mode 100644 (file)
index 32a6784..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Mono.Cairo.XcbSurface.cs
-//
-// Authors:
-//    Alp Toker
-//
-// (C) Alp Toker, 2006.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-       public class XcbSurface : Surface
-       {
-               internal XcbSurface (IntPtr handle, bool owns) : base (handle, owns)
-               {
-               }
-
-               public XcbSurface (IntPtr connection, uint drawable, IntPtr visual, int width, int height)
-                       : base (NativeMethods.cairo_xcb_surface_create (connection, drawable, visual, width, height), true)
-               {
-               }
-
-               public static XcbSurface FromBitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height)
-               {
-                       IntPtr ptr = NativeMethods.cairo_xcb_surface_create_for_bitmap (connection, bitmap, screen, width, height);
-                       return new XcbSurface (ptr, true);
-               }
-               public override void SetSize (int width, int height)
-               {                       
-                       NativeMethods.cairo_xcb_surface_set_size (Handle, width, height);
-               }
-       }
-}
diff --git a/Crow/src/Mono.Cairo/XlibSurface.cs b/Crow/src/Mono.Cairo/XlibSurface.cs
deleted file mode 100644 (file)
index 18e810b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// Mono.Cairo.XlibSurface.cs
-//
-// Authors:
-//    Duncan Mak
-//    Miguel de Icaza.
-//       JP Bruyère
-//
-// (C) Ximian Inc, 2003.
-// (C) Novell, Inc. 2003.
-// (C) JP Bruyère 2021
-//
-// This is an OO wrapper API for the Cairo API
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Crow.Cairo {
-
-       public class XlibSurface : Surface
-       {
-               public XlibSurface (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height)
-                       : base (NativeMethods.cairo_xlib_surface_create (display, drawable, visual, width, height), true)
-               {
-               }
-
-               public XlibSurface (IntPtr ptr, bool own) : base (ptr, own)
-               {
-               }
-
-               public static XlibSurface FromBitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height)
-               {
-                       IntPtr ptr = NativeMethods.cairo_xlib_surface_create_for_bitmap (display, bitmap, screen, width, height);
-                       return new XlibSurface(ptr, true);
-               }
-
-               public void SetDrawable (IntPtr drawable, int width, int height)
-               {
-                       NativeMethods.cairo_xlib_surface_set_drawable (Handle, drawable, width, height);
-               }
-
-               public override void SetSize (int width, int height)
-               {
-                       NativeMethods.cairo_xlib_surface_set_size (Handle, width, height);
-               }
-
-               public int Depth => NativeMethods.cairo_xlib_surface_get_depth (Handle);
-               public IntPtr Display => NativeMethods.cairo_xlib_surface_get_display (Handle);
-               public IntPtr Drawable => NativeMethods.cairo_xlib_surface_get_drawable (Handle);
-               public override int Width => NativeMethods.cairo_xlib_surface_get_width (Handle);               
-               public override int Height => NativeMethods.cairo_xlib_surface_get_height (Handle);             
-
-               public IntPtr Screen => NativeMethods.cairo_xlib_surface_get_screen (Handle);
-               public IntPtr Visual=> NativeMethods.cairo_xlib_surface_get_visual (Handle);
-       }
-}
index 19f3ebd07b3d42d0b2c68d58e0afd677f702f723..28ca1d07108e588388477b3474276f0faff0ea2f 100644 (file)
@@ -2,7 +2,11 @@
 //
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 using System;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index c702d9ac4440fb951a8334da1cf68552877f390b..0dc156f2baf59d8d3b5d6af192d2a622ad9d9d5f 100644 (file)
@@ -3,7 +3,11 @@
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 using System;
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index 9ac4b8a012b37dbbd0cf2981fb2f48a449eb9ffa..18be21201cb2e26935256bc11f9cc565a6df8de3 100644 (file)
@@ -4,7 +4,11 @@
 
 using System;
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Glfw;
 
 namespace Crow
index af47ce3a61b85f96ae05067420785c454dd376a7..f111c45885e32e8cf765ce22811ed340226c8eb5 100644 (file)
@@ -4,7 +4,11 @@
 
 using System;
 using System.Xml.Serialization;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Glfw;
 
 namespace Crow
index 5964da02c0d5a1c8bd9f40ec1e570d6f504022c9..635ace588cd8a10a2a6af29df8dc17171a7686aa 100644 (file)
@@ -5,7 +5,11 @@
 
 using System;
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow {
        public class Gauge : Widget
index 01b8b4cbaa5314b2c874fefdd08453f7bf80166c..8d286a9fb811145fc13940077ff179c27b460d98 100644 (file)
@@ -2,7 +2,11 @@
 //
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index 55cc635353d1ce4867e692c33e6410fce904561f..936d5e4ad1ece8417afb56cda60e565d633b9ab0 100644 (file)
@@ -5,7 +5,11 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.Threading;
 
 using static Crow.Logger;
index 4c0267f83996449746e7efef779760a8b763b96d..69829a6f21f61eb1e758acfd897bef8513a2bb0a 100644 (file)
@@ -5,7 +5,11 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.Threading;
 
 using static Crow.Logger;
index 64f8217ee24720050d12168a4b289229331a37f8..11f4ac5aedc71a1cc53ccbb176f156ddc687bcb8 100644 (file)
 using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index 5f8ed06e5fb556b9976bde8d2e546da3b153e653..c3551d081bfe89e1a4231796de2fca35a23d1167 100644 (file)
@@ -3,7 +3,11 @@
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.Xml.Serialization;
 using System.ComponentModel;
 using System.Diagnostics;
index c8b4b2387b871db1dde7e9086e42c30e87d8f32f..1ec42957abecc8ea63c81e6ebf22d96b78fefbf1 100644 (file)
@@ -4,7 +4,11 @@
 
 using System;
 using System.Linq;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.ComponentModel;
 using Glfw;
 using Crow.Text;
index 17179ae392cd2481310f2e1848713aa789f9a6e2..c0c94703ac76d379a13887d18c22b7142a43fb5e 100644 (file)
@@ -5,7 +5,11 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.Text.RegularExpressions;
 using System.ComponentModel;
 
index c236bf4bdfe9f29737b7e6e4485c64d21b7be938..01ef5ac0da6363ae74d09d58916e817d9a0a5386 100644 (file)
@@ -2,7 +2,11 @@
 //
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Glfw;
 using System;
 
index 22a34f1cb6e1eaacd13ea55e3aa481b20490c587..0c35306a386a76e99fb1b06d3f8af077b04105f1 100644 (file)
@@ -3,7 +3,11 @@
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using static Crow.Logger;
 namespace Crow
 {
index ca9a1a3dca27a05f7acf437f0fd00b30bd96966b..53f90017a494049e52e7a9b71b722addd95e8884 100644 (file)
@@ -3,7 +3,11 @@
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index c56dd30c69361c7932b5ee004c42eb95338d3890..386a0ce004c8f5b49b04e8501815e8e2df38eb92 100644 (file)
@@ -3,7 +3,11 @@
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index 314a7503ea6ca66e80c7ec4e7834b8ae64123b59..8a8f640d80a55c018512361ed0c0736b948a69c7 100644 (file)
@@ -4,7 +4,11 @@
 
 using System;
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Glfw;
 
 namespace Crow
index dd8fefdf71430bb1f3852bd514b871d93b595890..da00ae3789210581603e5bc612ed1b8af25e4107 100644 (file)
@@ -6,7 +6,11 @@ using System;
 using System.ComponentModel;
 using System.IO;
 using System.Text;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index dd977128ae23bcff03296928761738e965ccfdc4..9ac69f8e9badb4dd35939d9f639b640f7df8a7f5 100644 (file)
@@ -2,7 +2,11 @@
 //
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System;
 using System.ComponentModel;
 
index 8872b92b31de6e73004970f2d132c7498ae33e92..c5a7ad3b9fb705d0afb00f89689897e1a2aef227 100644 (file)
@@ -4,7 +4,11 @@
 
 using System;
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.Linq;
 
 namespace Crow
index 5aeaede8a52451d7bdc0bbd383bd4b4ce23185be..14349c6d8e6af582cdaacc92a96070ecdaf531b5 100644 (file)
@@ -4,7 +4,11 @@
 using System;
 using System.ComponentModel;
 using System.Linq;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index 27cfb9636a9e5030bb6914a4de3116d10b9abcb3..9fb8e1ad568b3ae65e2adde94fcd82397947f7fb 100644 (file)
@@ -4,7 +4,11 @@
 using System;
 using System.ComponentModel;
 using System.Linq;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index 2184d48663065ad057f89fab5084a46e74bcd6df..0387c38fe266eb65f03d7d2fc9727c3978313d5d 100644 (file)
@@ -4,7 +4,11 @@
 using System;
 using System.ComponentModel;
 using System.Linq;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Glfw;
 
 namespace Crow
index 1ce02c1550c49b593f3e387680efcce00869c576..1155ba8cd1517f0e37496df7806350157265113f 100644 (file)
@@ -4,7 +4,11 @@
 using System;
 using System.ComponentModel;
 using System.Linq;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Glfw;
 
 namespace Crow
index 5110d941a56beb8a01d3849fcadcdbf15876d434..2c147dc13cda025dbe8fa3a75a59e233a5eaf11d 100644 (file)
@@ -7,7 +7,11 @@ using System.ComponentModel;
 using System.IO;
 using System.Reflection;
 using System.Xml;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index a1ac759c15054daabe009e25f10b207e1453f1d6..5a3fadf2f178a710757a405bb780d1ba32c3b57e 100644 (file)
@@ -8,7 +8,11 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Linq;
 using System.Threading;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Crow.IML;
 
 namespace Crow {
index 99230a057f776b175ea0baba876423e99eb6bae5..ba598959c0825d5224dca6245876f2e7f869c4d6 100644 (file)
@@ -3,7 +3,11 @@
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index ece9adc06d8f4636ee9f54e88c032b19e7306d27..84085298e735c158dc0c930bfc54ef71d4c24c19 100644 (file)
@@ -2,7 +2,11 @@
 //
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Crow.Text;
 using Glfw;
 using System;
index d118974fc6efb16d3eb4fe4d17a9600402d43f8c..9efa5cbf7767d347e28c1b455a4f332a4d2ce6ae 100644 (file)
@@ -7,7 +7,11 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Linq;
 using System.Text.RegularExpressions;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index 1a2d137529504a158038d2ed0e3d203a9f90f36a..808cd7695cc0db690735a2ea504429c80f2b8202 100644 (file)
@@ -4,7 +4,11 @@
 
 using System.Collections.Generic;
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 namespace Crow
 {
index c38f373bd0c2fa258d71471cd5fd410a6e998f67..08cc52d0bcb0cddd4327bfd0d09631ceb4fa5efd 100644 (file)
@@ -8,7 +8,11 @@ using System.ComponentModel;
 using System.Reflection;
 using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.Diagnostics;
 using Crow.IML;
 using System.Threading;
index ca06ad256abe4d49db0bce9e3f3bff3ca4d46299..bd0e725e4ac7fa2ef60ba82d432933ada6a2d951 100644 (file)
@@ -1,5 +1,9 @@
 //Copyright GPL2
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 
 
 namespace Rsvg {
index 41e782011e66e3d623e9be61c4e1b66a29ac5976..faca4414fe52e880784de5799e83d70f324a2d2a 100644 (file)
@@ -10,6 +10,7 @@
                <CrowPackageVersion>$(CrowVersion)-beta</CrowPackageVersion>
                <CrowStbSharp>true</CrowStbSharp>
                <CrowDebugLogEnabled>false</CrowDebugLogEnabled>
+               <CrowVkvgBackend>true</CrowVkvgBackend>
                <GlfwSharpVersion>0.2.11-beta</GlfwSharpVersion>
        </PropertyGroup>
 </Project>
index 6af3f6dfd2b7bd6b58e6759e2b70bb536046971b..51ce140e1459525d22436c03ab7628a979cd8840 100644 (file)
@@ -4,7 +4,11 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Crow.DebugLogger;
 using DebugLogAnalyzer;
 
index d39cc62a6c56779490b5b1b70a1b074785ae4332..ddbb91836ab626d15c3636c5ecc2b1d5844b6662 100644 (file)
@@ -10,7 +10,11 @@ using System.ComponentModel;
 using System.IO;
 using System.Linq;
 using System.Threading.Tasks;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using Crow.DebugLogger;
 using DebugLogAnalyzer;
 
index 26a1eddfec73db0c1983382ebc34476046e5a778..f29da2591dec8b714ce42b3550ccec2eb0b6549a 100644 (file)
@@ -3,7 +3,11 @@
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.Threading;
 
 namespace Crow
index c8b27d7d834caaeaa869c8ba080c3408dd5e2d7a..9ac6a63cd808d0657bd863b72b648ac04bf3f512 100644 (file)
@@ -7,7 +7,11 @@ using Glfw;
 using System.Reflection;
 using System.Runtime.Loader;
 using System.IO;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.Diagnostics;
 using System.Collections.Generic;
 using Crow.DebugLogger;
index 7e3c97bbd13b21003adb38b4c9f3ae156fdd20a3..2f7f4c81a7504388db86688009bff97e549511ab 100644 (file)
@@ -1,4 +1,8 @@
-using Crow.Cairo;
+#if VKVG
+using vkvg;
+#else
+using Crow.Cairo;
+#endif
 using System;
 using System.Collections;
 using System.Collections.Generic;
index 95de45691219e43b65e01e0685b44e5faafb72a0..be8dfcdbf40146a70f7d6005139803cf1b116066 100644 (file)
@@ -8,7 +8,11 @@ using System;
 using Glfw;
 using Crow.Text;
 using System.Collections.Generic;
+#if VKVG
+using vkvg;
+#else
 using Crow.Cairo;
+#endif
 using System.Threading.Tasks;
 using System.Linq;
 
index 2ca413577f722294af24ba40cfbf58c0e53d35cf..9f62ec7f0510c7551cf654cd337c1b09b9f338ef 100644 (file)
@@ -1,4 +1,9 @@
-using Crow;
+#if VKVG
+using vkvg;
+#else
+using Crow.Cairo;
+#endif
+
 
 namespace tests
 {
@@ -28,9 +33,9 @@ namespace tests
                        Rectangle r = e.DragSource.LastPaintedSlot;
             startGroup = e.DragSource.Parent as Group;
 
-            Crow.Cairo.Surface dragImg = surf.CreateSimilar (Crow.Cairo.Content.ColorAlpha,
+            Surface dragImg = surf.CreateSimilar (Content.ColorAlpha,
                                r.Width, r.Height);
-            using (Crow.Cairo.Context gr = new Crow.Cairo.Context(dragImg)) {
+            using (Context gr = new Context(dragImg)) {
                 gr.SetSource (e.DragSource.bmp, 0, 0);
                 gr.Paint ();
             }