2005-12-16 John Luke <john.luke@gmail.com>
authorJohn Luke <jluke@mono-cvs.ximian.com>
Fri, 16 Dec 2005 20:36:22 +0000 (20:36 -0000)
committerJohn Luke <jluke@mono-cvs.ximian.com>
Fri, 16 Dec 2005 20:36:22 +0000 (20:36 -0000)
        * Mono.Cairo/Cairo.cs: organize and add missing API
        split out enums and structs
        * Mono.Cairo/*.cs: add enums and structs as seperate files
        implement ==, !=, Equals, and GetHashCode for the structs
        move public fields to properties

svn path=/trunk/mcs/; revision=54542

24 files changed:
mcs/class/Mono.Cairo/ChangeLog
mcs/class/Mono.Cairo/Mono.Cairo.dll.sources
mcs/class/Mono.Cairo/Mono.Cairo/Antialias.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/Cairo.cs
mcs/class/Mono.Cairo/Mono.Cairo/Content.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/Extend.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/FillRule.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/Filter.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/FontExtents.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/FontFace.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/FontSlant.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/FontWeight.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/Format.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/Glyph.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/HintMetrics.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/HintStyle.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/LineCap.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/LineJoin.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/Operator.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/Pattern.cs
mcs/class/Mono.Cairo/Mono.Cairo/Status.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/SubpixelOrder.cs [new file with mode: 0644]
mcs/class/Mono.Cairo/Mono.Cairo/Surface.cs
mcs/class/Mono.Cairo/Mono.Cairo/TextExtents.cs [new file with mode: 0644]

index 71124f2497fe1e5e195eec8afc2539ead4c1aab0..ba20d03053dc969353eff1b795b2045f3cbff6aa 100644 (file)
@@ -1,3 +1,11 @@
+2005-12-16  John Luke  <john.luke@gmail.com>
+
+       * Mono.Cairo/Cairo.cs: organize and add missing API
+       split out enums and structs
+       * Mono.Cairo/*.cs: add enums and structs as seperate files
+       implement ==, !=, Equals, and GetHashCode for the structs
+       move public fields to properties
+
 2005-12-16  John Luke  <john.luke@gmail.com>
 
        * Mono.Cairo/Cairo.cs:
index fa14dd3ead52c20e062badc02baa8390901f291b..55fccaaac619ff474d281583ccaae937f3e21ea1 100644 (file)
@@ -1,11 +1,29 @@
 ./Assembly/AssemblyInfo.cs
 ../../build/common/Consts.cs
 ../../build/common/Locale.cs
+./Mono.Cairo/Antialias.cs
 ./Mono.Cairo/Cairo.cs
+./Mono.Cairo/Content.cs
+./Mono.Cairo/Context.cs
+./Mono.Cairo/Extend.cs
+./Mono.Cairo/FillRule.cs
+./Mono.Cairo/Filter.cs
+./Mono.Cairo/FontExtents.cs
 ./Mono.Cairo/FontOptions.cs
+./Mono.Cairo/FontSlant.cs
+./Mono.Cairo/FontWeight.cs
+./Mono.Cairo/Format.cs
+./Mono.Cairo/Glyph.cs
+./Mono.Cairo/HintMetrics.cs
+./Mono.Cairo/HintStyle.cs
+./Mono.Cairo/LineCap.cs
+./Mono.Cairo/LineJoin.cs
 ./Mono.Cairo/Matrix.cs
-./Mono.Cairo/Context.cs
+./Mono.Cairo/Operator.cs
+./Mono.Cairo/Pattern.cs
 ./Mono.Cairo/Rectangle.cs
+./Mono.Cairo/Status.cs
+./Mono.Cairo/SubpixelOrder.cs
 ./Mono.Cairo/Surface.cs
-./Mono.Cairo/Pattern.cs
+./Mono.Cairo/TextExtents.cs
 
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/Antialias.cs b/mcs/class/Mono.Cairo/Mono.Cairo/Antialias.cs
new file mode 100644 (file)
index 0000000..9ea64f7
--- /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 Cairo
+{
+       [Serializable]
+       public enum Antialias
+       {
+               Default,
+               None,
+               Gray,
+               Subpixel,
+       }
+}
index 544e218068c9c8bb9cab087ee0a7f6e9008c2071..2b126aa951e1bb442b5063318c4df9863fff6b99 100644 (file)
@@ -1,16 +1,13 @@
 //
-// Mono.Cairo.Cairo.cs
+// 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)
 //
 // (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 and all
-// enumerations are also listed here.
-//
 // 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
 using System;
 using System.Runtime.InteropServices;
 
-namespace Cairo {
-
-       internal class CairoAPI
-        {
-                internal const string CairoImp = "libcairo-2.dll";
-               
-                //
-                // Manipulating state objects
-                //
-               [DllImport (CairoImp)]
-               public static extern IntPtr cairo_create (IntPtr target);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_reference (IntPtr cr);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_destroy (IntPtr cr);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_save (IntPtr cr);                
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_restore (IntPtr cr);
-
-                //
-                // Modify state
-                //
-                [DllImport (CairoImp)]
-                public static extern IntPtr cairo_image_surface_create_for_data (
-                        IntPtr data, Cairo.Format format, int width, int height, int stride);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_set_operator (IntPtr cr, Cairo.Operator op);
-
-                       [DllImport (CairoImp)]
-               public static extern void cairo_set_source_rgba (IntPtr cr, double red, double green, double blue, double alpha);
+namespace Cairo
+{
+       // sort these so it is easier to find what is missing
+       // http://www.cairographics.org/manual/ix01.html
+       // FIXME: this should be static and named NativeMethods
+       internal sealed class CairoAPI
+       {
+               const string cairo = "libcairo-2.dll";
+               
+               private CairoAPI ()
+               {
+               }
                
-                       [DllImport (CairoImp)]
-               public static extern void cairo_set_source_rgb (IntPtr cr, double red, double green, double blue);              
-                               
-                [DllImport (CairoImp)]
-                public static extern void cairo_set_source (IntPtr cr, IntPtr pattern);
+               //[DllImport (cairo)]
+               //internal static extern void cairo_append_path (IntPtr cr, Path path);
                
-                [DllImport (CairoImp)]
-                public static extern IntPtr cairo_get_source (IntPtr cr);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_set_tolerance (IntPtr cr, double tolerance);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_set_line_width (IntPtr cr, double width);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_set_line_cap (IntPtr cr, Cairo.LineCap line_cap);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_set_line_join (IntPtr cr, Cairo.LineJoin line_join);
-
-                       [DllImport (CairoImp)]
-               public static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_set_miter_limit (IntPtr cr, double limit);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_translate (IntPtr cr, double tx, double ty);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_scale (IntPtr cr, double sx, double sy);
-
-                [DllImport (CairoImp)]                
-                public static extern void cairo_rotate (IntPtr cr, double angle);
-               
-               [DllImport (CairoImp)]
-               public static extern void cairo_transform (IntPtr cr, Matrix matrix);
-                
-                [DllImport (CairoImp)]
-                public static extern void cairo_set_matrix (IntPtr cr, Matrix matrix);
-                
-                [DllImport (CairoImp)]
-                public static extern void cairo_identity_matrix (IntPtr cr);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_user_to_device_distance (IntPtr cr, ref double dx, ref double dy);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_device_to_user (IntPtr cr, ref double x, ref double y);
+               [DllImport (cairo)]
+               internal static extern void cairo_arc (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_arc_negative (IntPtr cr, double xc, double yc, double radius, double angle1, double angle2);
 
-                [DllImport (CairoImp)]
-                public static extern void cairo_device_to_user_distance (IntPtr cr, ref double dx, ref double dy);
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_atsui_font_face_create_for_atsu_font_id (IntPtr font_id);
                
-                //
-                // Path creation
-                //
-               [DllImport (CairoImp)]
-               public static extern void cairo_new_path (IntPtr cr);
+               [DllImport (cairo)]
+               internal static extern void cairo_clip (IntPtr cr);
                
-               [DllImport (CairoImp)]
-               public static extern void cairo_move_to (IntPtr cr, double x, double y);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_line_to (IntPtr cr, double x, double y);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_curve_to (
-                        IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_arc (
-                        IntPtr cr, double xc, double yc, double radius, double angel1, double angel2);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_arc_negative (
-                        IntPtr cr, double xc, double yc, double radius, double angel1, double angel2);
+               [DllImport (cairo)]
+               internal static extern void cairo_clip_preserve (IntPtr cr);
                
-               [DllImport (CairoImp)]
-               public static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_rel_curve_to (
-                        IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_close_path (IntPtr cr);
-
-                //
-                // Painting
-                //
-                [DllImport (CairoImp)]
-                public static extern void cairo_stroke (IntPtr cr);
-               
-                [DllImport (CairoImp)]
-                public static extern void cairo_stroke_preserve (IntPtr cr);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_stroke_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_fill (IntPtr cr);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_fill_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
-
-               [DllImport (CairoImp)]
-                public static extern void cairo_fill_preserve (IntPtr cr);
+               [DllImport (cairo)]
+               internal static extern void cairo_close_path (IntPtr cr);
                
-               [DllImport (CairoImp)]
-                public static extern void cairo_copy_page (IntPtr cr);
+               [DllImport (cairo)]
+               internal static extern void cairo_copy_page (IntPtr cr);
                
-               [DllImport (CairoImp)]
-                public static extern void cairo_show_page (IntPtr cr);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_clip (IntPtr cr);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_clip_preserve (IntPtr cr);
+               //[DllImport (cairo)]
+               //internal static extern Path cairo_copy_path (IntPtr cr);
                
-                [DllImport (CairoImp)]
-                public static extern void cairo_reset_clip (IntPtr cr);
-
-                //
-                // Font / Text
-                //
-                [DllImport (CairoImp)]
-                public static extern void cairo_select_font_face (IntPtr cr, 
-                                                             string family, 
-                                                             FontSlant slant, 
-                                                             FontWeight weight);
-
-               [DllImport (CairoImp)]
-                public static extern void cairo_set_font_size (IntPtr cr,
-                                                            double size);
+               //[DllImport (cairo)]
+               //internal static extern Path cairo_copy_path_flat (IntPtr cr);
                
-               [DllImport (CairoImp)]
-                public static extern IntPtr cairo_get_font_face (IntPtr cr);
-
-               [DllImport (CairoImp)]
-                public static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace);
-
-               [DllImport (CairoImp)]
-                public static extern Matrix cairo_get_font_matrix (IntPtr cr);
-
-               [DllImport (CairoImp)]
-                public static extern void cairo_set_font_matrix (IntPtr cr, Matrix matrix);
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_create (IntPtr target);
                
-                [DllImport (CairoImp)]
-                public static extern void cairo_show_text (IntPtr cr, string utf8);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_font_extents (IntPtr source, ref FontExtents extents);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_show_glyphs (IntPtr ct, IntPtr glyphs, int num_glyphs);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_text_path  (IntPtr ct, string utf8);
-
-               [DllImport (CairoImp)]
-                public static extern void cairo_text_extents  (IntPtr cr, string utf8, ref TextExtents extents);
-
-                               // FontOptions
-                               [DllImport (CairoImp)]
-                               internal static extern IntPtr cairo_font_options_create ();
-
-                               [DllImport (CairoImp)]
-                               internal static extern IntPtr cairo_font_options_copy (IntPtr handle);
-
-                               [DllImport (CairoImp)]
-                               internal static extern void cairo_font_options_destroy (IntPtr handle);
-
-                               [DllImport (CairoImp)]
-                               internal static extern bool cairo_font_options_equal (IntPtr h1, IntPtr h2);
-
-                               [DllImport (CairoImp)]
-                               internal static extern long cairo_font_options_hash (IntPtr handle);
-
-                               [DllImport (CairoImp)]
-                               internal static extern void cairo_font_options_merge (IntPtr handle, IntPtr other);
-
-                               [DllImport (CairoImp)]
-                               internal static extern Antialias cairo_font_options_get_antialias (IntPtr handle);
-
-                               [DllImport (CairoImp)]
-                               internal static extern void cairo_font_options_set_antialias (IntPtr handle, Antialias aa);
-
-                               [DllImport (CairoImp)]
-                               internal static extern HintMetrics cairo_font_options_get_hint_metrics (IntPtr handle);
-
-                               [DllImport (CairoImp)]
-                               internal static extern void cairo_font_options_set_hint_metrics (IntPtr handle, HintMetrics metrics);
-
-                               [DllImport (CairoImp)]
-                               internal static extern HintStyle cairo_font_options_get_hint_style (IntPtr handle);
-
-                               [DllImport (CairoImp)]
-                               internal static extern void cairo_font_options_set_hint_style (IntPtr handle, HintStyle style);
-
-                               [DllImport (CairoImp)]
-                               internal static extern SubpixelOrder cairo_font_options_get_subpixel_order (IntPtr handle);
-
-                               [DllImport (CairoImp)]
-                               internal static extern void cairo_font_options_set_subpixel_order (IntPtr handle, SubpixelOrder order);
-
-                               [DllImport (CairoImp)]
-                               internal static extern Status cairo_font_options_status (IntPtr handle);
-
-                               [DllImport (CairoImp)]
-                               internal static extern void cairo_get_font_options (IntPtr cr, IntPtr options);
-
-                               [DllImport (CairoImp)]
-                               internal static extern void cairo_set_font_options (IntPtr cr, IntPtr options);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_glyph_path (IntPtr ct, IntPtr glyphs, int num_glyphs);
-        
-                //
-                // Image
-                //
-               [DllImport (CairoImp)]
-                public static extern void cairo_set_source_surface (IntPtr cr, IntPtr surface, int width, int height);
-               
-                [DllImport (CairoImp)]
-                internal static extern void cairo_mask (IntPtr cr, IntPtr pattern);
-                
-                               [DllImport (CairoImp)]
-                internal static extern void cairo_mask_surface (IntPtr cr, IntPtr surface, double x, double y);
-                               
-                [DllImport (CairoImp)]
-                public static extern void cairo_paint (IntPtr cr);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_paint_with_alpha (IntPtr cr, double alpha);
+               [DllImport (cairo)]
+               internal static extern void cairo_curve_to (IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3);
                
-               [DllImport (CairoImp)]
-                public static extern IntPtr cairo_image_surface_create_from_png  (string filename);
+               [DllImport (cairo)]
+               internal static extern void cairo_debug_reset_static_data ();
                
-               [DllImport (CairoImp)]
-                public static extern int cairo_image_surface_get_width  (IntPtr surface);
+               [DllImport (cairo)]
+               internal static extern void cairo_destroy (IntPtr cr);
                
-               [DllImport (CairoImp)]
-                public static extern int cairo_image_surface_get_height (IntPtr surface);
+               [DllImport (cairo)]
+               internal static extern void cairo_device_to_user (IntPtr cr, ref double x, ref double y);
                
-                //
-                // query
-                //
-               [DllImport (CairoImp)]
-               public static extern bool cairo_in_stroke (IntPtr cr, double x, double y);
-
-               [DllImport (CairoImp)]
-               public static extern bool cairo_in_fill (IntPtr cr, double x, double y);
+               [DllImport (cairo)]
+               internal static extern void cairo_device_to_user_distance (IntPtr cr, ref double dx, ref double dy);
 
-               [DllImport (CairoImp)]
-               public static extern Cairo.Operator cairo_get_operator (IntPtr cr);
+               [DllImport (cairo)]
+               internal static extern void cairo_fill (IntPtr cr);
                
-               [DllImport (CairoImp)]
-               public static extern double cairo_get_tolerance (IntPtr cr);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_get_current_point (
-                        IntPtr cr, out double x, out double y);
-
-               [DllImport (CairoImp)]
-               public static extern Cairo.FillRule cairo_get_fill_rule (IntPtr cr);
-
-                [DllImport (CairoImp)]
-               public static extern double cairo_get_line_width (IntPtr cr);
-
-                [DllImport (CairoImp)]
-               public static extern LineCap cairo_get_line_cap (IntPtr cr);
-
-                       [DllImport (CairoImp)]
-               public static extern LineJoin cairo_get_line_join (IntPtr cr);
-
-               [DllImport (CairoImp)]
-               public static extern double cairo_get_miter_limit (IntPtr cr);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_get_matrix (IntPtr cr, Matrix matrix);
+               [DllImport (cairo)]
+               internal static extern void cairo_fill_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_fill_preserve (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_font_extents (IntPtr cr, ref FontExtents extents);
+               
+               // FontFace
+               [DllImport (cairo)]
+               internal static extern void cairo_font_face_destroy (IntPtr font_face);
+               
+               //[DllImport (cairo)]
+               //internal static extern void cairo_font_face_get_user_data (IntPtr font_face);
+               
+               //[DllImport (cairo)]
+               //internal static extern void cairo_font_face_set_user_data (IntPtr font_face);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_font_face_reference (IntPtr font_face);
+               
+               [DllImport (cairo)]
+               internal static extern Status cairo_font_face_status (IntPtr font_face);
+               
+               // FontOptions
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_font_options_copy (IntPtr original);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_font_options_create ();
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_font_options_destroy (IntPtr options);
+               
+               [DllImport (cairo)]
+               [return: MarshalAs (UnmanagedType.U1)]
+               internal static extern bool cairo_font_options_equal (IntPtr options, IntPtr other);
+               
+               [DllImport (cairo)]
+               internal static extern Antialias cairo_font_options_get_antialias (IntPtr options);
+               
+               [DllImport (cairo)]
+               internal static extern HintMetrics cairo_font_options_get_hint_metrics (IntPtr options);
+               
+               [DllImport (cairo)]
+               internal static extern HintStyle cairo_font_options_get_hint_style (IntPtr options);
+               
+               [DllImport (cairo)]
+               internal static extern SubpixelOrder cairo_font_options_get_subpixel_order (IntPtr options);
+               
+               [DllImport (cairo)]
+               internal static extern long cairo_font_options_hash (IntPtr options);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_font_options_merge (IntPtr options, IntPtr other);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_font_options_set_antialias (IntPtr options, Antialias aa);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_font_options_set_hint_metrics (IntPtr options, HintMetrics metrics);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_font_options_set_hint_style (IntPtr options, HintStyle style);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_font_options_set_subpixel_order (IntPtr options, SubpixelOrder order);
+               
+               [DllImport (cairo)]
+               internal static extern Status cairo_font_options_status (IntPtr options);
+               
+               // Freetype / FontConfig 
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_ft_font_face_create_for_ft_face (IntPtr face, int load_flags);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_ft_font_face_create_for_pattern (IntPtr fc_pattern);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_ft_font_options_substitute (FontOptions options, IntPtr pattern);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_ft_scaled_font_lock_face (IntPtr scaled_font);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_ft_scaled_font_unlock_face (IntPtr scaled_font);
+               
+               [DllImport (cairo)]
+               internal static extern Antialias cairo_get_antialias (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_get_current_point (IntPtr cr, out double x, out double y);
+               
+               [DllImport (cairo)]
+               internal static extern FillRule cairo_get_fill_rule (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_get_font_face (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern Matrix cairo_get_font_matrix (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_get_font_options (IntPtr cr, IntPtr options);
+               
+               [DllImport (cairo)]
+               internal static extern LineCap cairo_get_line_cap (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern LineJoin cairo_get_line_join (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern double cairo_get_line_width (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_get_matrix (IntPtr cr, Matrix matrix);
+               
+               [DllImport (cairo)]
+               internal static extern double cairo_get_miter_limit (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern Operator cairo_get_operator (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_get_source (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_get_target (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern double cairo_get_tolerance (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_glitz_surface_create (IntPtr surface);
 
-                [DllImport (CairoImp)]
-                public static extern IntPtr cairo_get_target (IntPtr cr);
-               
-                //
-                // Error status queries
-                //
-                [DllImport (CairoImp)]
-                public static extern Cairo.Status cairo_status (IntPtr cr);
+               [DllImport (cairo)]
+               internal static extern void cairo_glyph_extents (IntPtr cr, IntPtr glyphs, int num_glyphs, TextExtents extents);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_glyph_path (IntPtr cr, IntPtr glyphs, int num_glyphs);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_identity_matrix (IntPtr cr);
+               
+               // ImageSurface
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_image_surface_create (Cairo.Format format, int width, int height);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_image_surface_create_for_data (string data, Cairo.Format format, int width, int height, int stride);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_image_surface_create_from_png  (string filename);
+               
+               //[DllImport (cairo)]
+               //internal static extern IntPtr cairo_image_surface_create_from_png_stream  (string filename);
+               
+               [DllImport (cairo)]
+               internal static extern int cairo_image_surface_get_height (IntPtr surface);
+               
+               [DllImport (cairo)]
+               internal static extern int cairo_image_surface_get_width  (IntPtr surface);
+               
+               [DllImport (cairo)]
+               [return: MarshalAs (UnmanagedType.U1)]
+               internal static extern bool cairo_in_fill (IntPtr cr, double x, double y);
+               
+               [DllImport (cairo)]
+               [return: MarshalAs (UnmanagedType.U1)]
+               internal static extern bool cairo_in_stroke (IntPtr cr, double x, double y);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_line_to (IntPtr cr, double x, double y);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_mask (IntPtr cr, IntPtr pattern);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_mask_surface (IntPtr cr, IntPtr surface, double x, double y);
+               
+               // Matrix
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_init (Matrix matrix, double xx, double yx, double xy, double yy, double x0, double y0);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_init_identity (Matrix matrix);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_init_rotate (Matrix matrix, double radians);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_init_scale (Matrix matrix, double sx, double sy);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_init_translate (Matrix matrix, double tx, double ty);
+               
+               [DllImport (cairo)]
+               internal static extern Status cairo_matrix_invert (Matrix matrix);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_multiply (Matrix result, Matrix a, Matrix b);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_scale (Matrix matrix, double sx, double sy);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_rotate (Matrix matrix, double radians);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_transform_distance (Matrix matrix, ref double dx, ref double dy);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_transform_point (Matrix matrix, ref double x, ref double y);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_matrix_translate (Matrix matrix, double tx, double ty);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_move_to (IntPtr cr, double x, double y);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_new_path (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_paint (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_paint_with_alpha (IntPtr cr, double alpha);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_path_destroy (IntPtr path);
+               
+               // Pattern
+               [DllImport (cairo)]
+               internal static extern void cairo_pattern_add_color_stop_rgb (IntPtr pattern, double offset, double red, double green, double blue);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_pattern_add_color_stop_rgba (IntPtr pattern, double offset, double red, double green, double blue, double alpha);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_pattern_create_linear (double x0, double y0, double x1, double y1);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_pattern_create_rgb (double r, double g, double b);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_pattern_create_rgba (double r, double g, double b, double a);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_pattern_destroy (IntPtr pattern);
+               
+               [DllImport (cairo)]
+               internal static extern Extend cairo_pattern_get_extend (IntPtr pattern);
+               
+               [DllImport (cairo)]
+               internal static extern Filter cairo_pattern_get_filter (IntPtr pattern);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_pattern_get_matrix (IntPtr pattern, Matrix matrix);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_pattern_reference (IntPtr pattern);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_pattern_set_extend (IntPtr pattern, Extend extend);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_pattern_set_filter (IntPtr pattern, Filter filter);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_pattern_set_matrix (IntPtr pattern, Matrix matrix);
+               
+               [DllImport (cairo)]
+               internal static extern Status cairo_pattern_status (IntPtr pattern);
+       
+               // PdfSurface
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_pdf_surface_create (string filename, double width, double height);
+               
+               //[DllImport (cairo)]
+               //internal static extern IntPtr cairo_pdf_surface_create_for_stream (string filename, double width, double height);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_pdf_surface_set_dpi (IntPtr surface, double x_dpi, double y_dpi);
+               
+               // PostscriptSurface
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_ps_surface_create (string filename, double width, double height);
+               
+               //[DllImport (cairo)]
+               //internal static extern IntPtr cairo_ps_surface_create_for_stream (string filename, double width, double height);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_ps_surface_set_dpi (IntPtr surface, double x_dpi, double y_dpi);
 
-                //
-                // Surface Manipulation
-                //
-                
-               [DllImport (CairoImp)]
-                public static extern IntPtr cairo_xlib_surface_create (IntPtr dpi,
-                       IntPtr win, IntPtr visual, int w, int h);
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_quartz_surface_create (IntPtr context, bool flipped, int width, int height);
 
-               [DllImport (CairoImp)]
-                public static extern void cairo_xlib_surface_set_drawable (IntPtr surface, IntPtr drawable, int width, int height);
-               
-               [DllImport (CairoImp)]
-                public static extern void cairo_xlib_surface_set_size (IntPtr surface, int width, int height);
-               
-               [DllImport (CairoImp)]                
-                public static extern Cairo.Status cairo_surface_finish (IntPtr surface);
-               
-        [DllImport (CairoImp)]                
-        internal static extern Cairo.Status cairo_surface_flush (IntPtr surface);
-               
-               [DllImport (CairoImp)]                
-                internal static extern Cairo.Status cairo_surface_status (IntPtr surface);
-               
-               [DllImport (CairoImp)]                
-                public static extern void cairo_surface_set_device_offset (IntPtr surface,
-                                                                      double x, double y);
+               [DllImport (cairo)]
+               internal static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_reference (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_rel_curve_to (IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_reset_clip (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_restore (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_rotate (IntPtr cr, double angle);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_save (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_scale (IntPtr cr, double sx, double sy);
+               
+               // ScaledFont
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_scaled_font_create (IntPtr fontFace, Matrix matrix, Matrix ctm, IntPtr options);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_scaled_font_destroy (IntPtr scaled_font);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_scaled_font_extents (IntPtr scaled_font, TextExtents extents);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_scaled_font_glyph_extents (IntPtr scaled_font, IntPtr glyphs, int num_glyphs, TextExtents extents);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_scaled_font_reference (IntPtr scaled_font);
 
-                [DllImport (CairoImp)]                
-                public static extern IntPtr cairo_image_surface_create_for_data (
-                        string data, Cairo.Format format, int width, int height, int stride);
+               [DllImport (cairo)]
+               internal static extern Status cairo_scaled_font_status (IntPtr scaled_font);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_select_font_face (IntPtr cr, string family, FontSlant slant, FontWeight weight);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_antialias (IntPtr cr, Antialias antialias);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_font_face (IntPtr cr, IntPtr fontFace);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_font_matrix (IntPtr cr, Matrix matrix);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_font_options (IntPtr cr, IntPtr options);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_font_size (IntPtr cr, double size);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_line_cap (IntPtr cr, LineCap line_cap);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_line_join (IntPtr cr, LineJoin line_join);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_line_width (IntPtr cr, double width);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_matrix (IntPtr cr, Matrix matrix);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_miter_limit (IntPtr cr, double limit);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_operator (IntPtr cr, Cairo.Operator op);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_source (IntPtr cr, IntPtr pattern);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_source_rgb (IntPtr cr, double red, double green, double blue);
 
-                [DllImport (CairoImp)]
-                public static extern IntPtr cairo_image_surface_create (Cairo.Format format, int width,
-                        int height);
-               
-        [DllImport (CairoImp)]
+               [DllImport (cairo)]
+               internal static extern void cairo_set_source_rgba (IntPtr cr, double red, double green, double blue, double alpha);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_source_surface (IntPtr cr, IntPtr surface, double width, double height);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_set_tolerance (IntPtr cr, double tolerance);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_show_glyphs (IntPtr ct, IntPtr glyphs, int num_glyphs);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_show_page (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_show_text (IntPtr cr, string utf8);
+               
+               [DllImport (cairo)]
+               internal static extern Status cairo_status (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_status_to_string (Status status);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_stroke (IntPtr cr);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_stroke_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_stroke_preserve (IntPtr cr);
+               
+               // Surface
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_surface_create_similar (IntPtr surface, Cairo.Content content, int width, int height);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_surface_destroy (IntPtr surface);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_surface_finish (IntPtr surface);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_surface_flush (IntPtr surface);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_surface_get_font_options (IntPtr surface, IntPtr FontOptions);
+               
+               [DllImport (cairo)]
                internal static extern void cairo_surface_mark_dirty (IntPtr surface);
                
-               [DllImport (CairoImp)]
+               [DllImport (cairo)]
                internal static extern void cairo_surface_mark_dirty_rectangle (IntPtr surface, int x, int y, int width, int height);
-
-                [DllImport (CairoImp)]
-                public static extern IntPtr cairo_surface_create_similar (
-                        IntPtr surface, Cairo.Content content, int width, int height);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_surface_reference (IntPtr surface);
-
-                [DllImport (CairoImp)]                
-                public static extern void cairo_surface_destroy (IntPtr surface);
-
-                [DllImport (CairoImp)]                
-                public static extern void cairo_surface_write_to_png (IntPtr surface, string filename);
-
-                [DllImport (CairoImp)]                
-                public static extern IntPtr cairo_pdf_surface_create (string filename, double width, double height);
-
-                [DllImport (CairoImp)]                
-                public static extern void cairo_pdf_surface_set_dpi (IntPtr surface, double x_dpi, double y_dpi);
-
-                [DllImport (CairoImp)]                
-                public static extern IntPtr cairo_ps_surface_create (string filename, double width, double height);
-
-                [DllImport (CairoImp)]                
-                public static extern void cairo_ps_surface_set_dpi (IntPtr surface, double x_dpi, double y_dpi);
-                               
-                [DllImport (CairoImp)]                
-                public static extern IntPtr cairo_win32_surface_create (IntPtr hdc);
-
-                //
-                // Matrix
-                //
                
-               [DllImport (CairoImp)]                
-               public static extern void cairo_matrix_init_translate (Matrix matrix, double tx, double ty);
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_surface_reference (IntPtr surface);
                
-               [DllImport (CairoImp)]                
-               public static extern void cairo_matrix_translate (Matrix matrix, double tx, double ty);
+               [DllImport (cairo)]
+               internal static extern void cairo_surface_set_device_offset (IntPtr surface, double x, double y);
                
-               [DllImport (CairoImp)]
-               public static extern void cairo_matrix_init_identity (Matrix matrix);
-
-               [DllImport (CairoImp)]                
-               public static extern void cairo_matrix_init_scale (Matrix matrix, double sx, double sy);
+               [DllImport (cairo)]
+               internal static extern Status cairo_surface_status (IntPtr surface);
                
-               [DllImport (CairoImp)]                
-               public static extern void cairo_matrix_scale (Matrix matrix, double sx, double sy);
-
-               [DllImport (CairoImp)]
-               public static extern void cairo_matrix_init_rotate (Matrix matrix, double radians);             
+               [DllImport (cairo)]
+               internal static extern void cairo_surface_write_to_png (IntPtr surface, string filename);
                
-               [DllImport (CairoImp)]                                
-               public static extern void cairo_matrix_rotate (Matrix matrix, double radians);
-
-               [DllImport (CairoImp)]                                
-               public static extern Cairo.Status cairo_matrix_invert (Matrix matrix);
-
-               [DllImport (CairoImp)]                                
-               public static extern void cairo_matrix_multiply (Matrix result, Matrix a, Matrix b);
-
-               [DllImport (CairoImp)]                                
-               public static extern void cairo_matrix_transform_distance (Matrix matrix, ref double dx, ref double dy);
-
-               [DllImport (CairoImp)]                                
-               public static extern void cairo_matrix_transform_point (Matrix matrix, ref double x, ref double y);
-
-                //
-                // Pattern functions
-                //
-                [DllImport (CairoImp)]
-                public static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface);
-
-                [DllImport (CairoImp)]
-                public static extern IntPtr cairo_pattern_create_linear (double x0, double y0,
-                       double x1, double y1);
-
-                [DllImport (CairoImp)]
-                public static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0,
-                        double radius0, double cx1, double cy1, double radius1);
-               
-               [DllImport (CairoImp)]
-                public static extern IntPtr cairo_pattern_create_rgb (double r, 
-                                                                 double g,
-                                                                 double b);
-               
-               [DllImport (CairoImp)]
-                public static extern IntPtr cairo_pattern_create_rgba (double r, 
-                                                                 double g,
-                                                                 double b,
-                                                                 double a);            
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_pattern_reference (IntPtr pattern);
-
-                [DllImport (CairoImp)]
-                public static extern void cairo_pattern_destroy (IntPtr pattern);
-
-                [DllImport (CairoImp)]
-                public static extern Status cairo_pattern_add_color_stop_rgba (IntPtr pattern,
-                       double offset, double red, double green, double blue, double alpha);
+               //[DllImport (cairo)]
+               //internal static extern void cairo_surface_write_to_png_stream (IntPtr surface, WriteFunc writeFunc);
                
-                [DllImport (CairoImp)]
-                public static extern Status cairo_pattern_add_color_stop_rgb (IntPtr pattern,
-                       double offset, double red, double green, double blue);
-
-                [DllImport (CairoImp)]
-                public static extern Status cairo_pattern_set_matrix (IntPtr pattern, Matrix matrix);
-
-                [DllImport (CairoImp)]
-                public static extern Status cairo_pattern_get_matrix (IntPtr pattern, Matrix matrix);
-
-                [DllImport (CairoImp)]
-                public static extern Status cairo_pattern_set_extend (IntPtr pattern, Extend extend);
-
-                [DllImport (CairoImp)]
-                public static extern Extend cairo_pattern_get_extend (IntPtr pattern);
-
-                [DllImport (CairoImp)]
-                public static extern Status cairo_pattern_set_filter (IntPtr pattern, Filter filter);
-
-                [DllImport (CairoImp)]
-                public static extern Filter cairo_pattern_get_filter (IntPtr pattern);
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_svg_surface_create (string fileName, double width, double height);
                
-               [DllImport (CairoImp)]
-                public static extern Status cairo_pattern_status (IntPtr pattern);
-
-                               [DllImport (CairoImp)]
-                               public static extern void cairo_set_antialias (IntPtr cr, Antialias antialias);
-
-                               [DllImport (CairoImp)]
-                               public static extern Antialias cairo_get_antialias (IntPtr cr);
-
-        }
-
-        //
-        // Enumerations
-        //
-               
-               public enum Antialias {
-                               Default,
-                               None,
-                               Gray,
-                               Subpixel,
-               }
-
-               public enum Content {
-                       Color = 0x1000,
-                       Alpha= 0x2000,
-                       ColorAlpha  = 0x3000,
-               }
+               //[DllImport (cairo)]
+               //internal static extern IntPtr cairo_svg_surface_create_for_stream (double width, double height);
                
-        public enum Format {
-                ARGB32,
-                RGB24,
-                A8,
-                A1,
-        }
-
-        public enum Operator {
-               Clear,
-
-               Source,
-               Over,
-               In,
-               Out,
-               Atop,
-
-               Dest,
-               DestOver,
-               DestIn,
-               DestOut,
-               DestAtop,
-
-               Xor,
-               Add,
-               Saturate,
-        }
-
-        public enum FillRule {
-                Winding,
-                EvenOdd
-        }
-
-        public enum LineCap {
-                Butt, Round, Square
-        }
-
-        public enum LineJoin {
-                Miter, Round, Bevel
-        }
-
-        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 Filter {
-                Fast,
-                Good,
-                Best,
-                Nearest,
-                Bilinear,
-                Gaussian,
-        }
-
-        public enum FontSlant {
-                Normal  = 0,
-                Italic  = 1,
-                Oblique = 2
-        }
-
-        public enum FontWeight {
-                Normal  = 0,
-                Bold    = 1,
-        }
-
-        public enum Extend {
-                None,
-                Repeat,
-                Reflect,
-        }
-
-               public enum HintMetrics {
-                       Default,
-                       Off,
-                       On,
-               }
-
-               public enum HintStyle {
-                       Default,
-                       None,
-                       Slight,
-                       Medium,
-                       Full,
-               }
-
-               public enum SubpixelOrder {
-                       Default,
-                       Rgb,
-                       Bgr,
-                       Vrgb,
-                       Vbgr,
-               }
-
-        [StructLayout(LayoutKind.Sequential)]
-        public struct FontExtents
-        {
-                public  double Ascent;
-                public  double Descent;
-                public  double Height;
-                public  double MaxXAdvance;
-                public  double MaxYAdvance;
-        }        
-   
-   
-        [StructLayout(LayoutKind.Sequential)]
-        public struct TextExtents
-        {
-                public  double XBearing;
-                public  double YBearing;
-                public  double Width;
-                public  double Height;
-                public  double XAdvance;
-                public  double YAdvance;
-        }
-
-        [StructLayout(LayoutKind.Sequential)]
-        public struct Glyph
-        {
-                public  long Index;
-                public  double X;
-                public  double Y;
-        }
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_svg_surface_set_dpi (IntPtr handle, double width, double height);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_text_extents (IntPtr cr, string utf8, ref TextExtents extents);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_text_path (IntPtr ct, string utf8);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_transform (IntPtr cr, Matrix matrix);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_translate (IntPtr cr, double tx, double ty);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_user_to_device_distance (IntPtr cr, ref double dx, ref double dy);
+               
+               [DllImport (cairo)]
+               internal static extern int cairo_version ();
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_version_string ();
+               
+               // win32 fonts
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_win32_font_face_create_for_logfontw (IntPtr logfontw);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_win32_scaled_font_done_font (IntPtr scaled_font);
+               
+               [DllImport (cairo)]
+               internal static extern double cairo_win32_scaled_font_get_metrics_factor (IntPtr scaled_font);
+               
+               [DllImport (cairo)]
+               internal static extern Status cairo_win32_scaled_font_select_font (IntPtr scaled_font, IntPtr hdc);
+               
+               // win32 surface
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_win32_surface_create (IntPtr hdc);
+               
+               // XcbSurface
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_xcb_surface_create (IntPtr connection, IntPtr drawable, IntPtr visual, int width, int height);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_xcb_surface_create_for_bitmap (IntPtr connection, IntPtr bitmap, int width, int height);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_xcb_surface_set_size (IntPtr surface, int width, int height);
+               
+               // XlibSurface
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_xlib_surface_create (IntPtr display, IntPtr drawable, IntPtr visual, int width, int height);
+               
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_xlib_surface_create_for_bitmap (IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_xlib_surface_set_drawable (IntPtr surface, IntPtr drawable, int width, int height);
+               
+               [DllImport (cairo)]
+               internal static extern void cairo_xlib_surface_set_size (IntPtr surface, int width, int height);
+       }
 }
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/Content.cs b/mcs/class/Mono.Cairo/Mono.Cairo/Content.cs
new file mode 100644 (file)
index 0000000..a88d35a
--- /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 Cairo
+{
+       //[Flags]
+       [Serializable]
+       public enum Content
+       {
+               Color = 0x1000,
+               Alpha = 0x2000,
+               ColorAlpha = 0x3000,
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/Extend.cs b/mcs/class/Mono.Cairo/Mono.Cairo/Extend.cs
new file mode 100644 (file)
index 0000000..ae49a5e
--- /dev/null
@@ -0,0 +1,47 @@
+//
+// 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 Cairo
+{
+       [Serializable]
+       public enum Extend
+       {
+               None,
+               Repeat,
+               Reflect,
+#if CAIRO_1_2
+               Pad,
+#endif
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/FillRule.cs b/mcs/class/Mono.Cairo/Mono.Cairo/FillRule.cs
new file mode 100644 (file)
index 0000000..6d8c062
--- /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 Cairo
+{
+       [Serializable]
+       public enum FillRule
+       {
+               Winding,
+               EvenOdd
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/Filter.cs b/mcs/class/Mono.Cairo/Mono.Cairo/Filter.cs
new file mode 100644 (file)
index 0000000..d602ed7
--- /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 Cairo
+{
+       [Serializable]
+       public enum Filter
+       {
+               Fast,
+               Good,
+               Best,
+               Nearest,
+               Bilinear,
+               Gaussian,
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/FontExtents.cs b/mcs/class/Mono.Cairo/Mono.Cairo/FontExtents.cs
new file mode 100644 (file)
index 0000000..76c7e65
--- /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 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/mcs/class/Mono.Cairo/Mono.Cairo/FontFace.cs b/mcs/class/Mono.Cairo/Mono.Cairo/FontFace.cs
new file mode 100644 (file)
index 0000000..205aac9
--- /dev/null
@@ -0,0 +1,19 @@
+using System;
+
+namespace Cairo
+{
+       public class FontFace
+       {
+               IntPtr handle;
+
+               public FontFace (IntPtr handle)
+               {
+                       this.handle = handle;
+               }
+
+               public IntPtr Handle {
+                       get { return handle; }
+               }
+       }
+}
+
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/FontSlant.cs b/mcs/class/Mono.Cairo/Mono.Cairo/FontSlant.cs
new file mode 100644 (file)
index 0000000..c4e1af7
--- /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 Cairo
+{
+       [Serializable]
+       public enum FontSlant
+       {
+               Normal,
+               Italic,
+               Oblique
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/FontWeight.cs b/mcs/class/Mono.Cairo/Mono.Cairo/FontWeight.cs
new file mode 100644 (file)
index 0000000..9d1927d
--- /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 Cairo
+{
+       [Serializable]
+       public enum FontWeight
+       {
+               Normal,
+               Bold,
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/Format.cs b/mcs/class/Mono.Cairo/Mono.Cairo/Format.cs
new file mode 100644 (file)
index 0000000..fac4d0e
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// 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 Cairo
+{
+       [Serializable]
+       public enum Format
+       {
+               // FIXME: these should not be all caps
+               ARGB32,
+               RGB24,
+               A8,
+               A1,
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/Glyph.cs b/mcs/class/Mono.Cairo/Mono.Cairo/Glyph.cs
new file mode 100644 (file)
index 0000000..23d8cbf
--- /dev/null
@@ -0,0 +1,93 @@
+//
+// 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 Cairo
+{
+       [StructLayout(LayoutKind.Sequential)]
+       public struct Glyph
+       {
+               long index;
+               double x;
+               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; }
+               }
+               
+               public double X {
+                       get { return x; }
+               }
+               
+               public double Y {
+                       get { return y; }
+               }
+
+               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);
+                       int pos = dest.ToInt32 ();
+                       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/mcs/class/Mono.Cairo/Mono.Cairo/HintMetrics.cs b/mcs/class/Mono.Cairo/Mono.Cairo/HintMetrics.cs
new file mode 100644 (file)
index 0000000..d434142
--- /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 Cairo
+{
+       [Serializable]
+       public enum HintMetrics
+       {
+               Default,
+               Off,
+               On,
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/HintStyle.cs b/mcs/class/Mono.Cairo/Mono.Cairo/HintStyle.cs
new file mode 100644 (file)
index 0000000..bb84820
--- /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 Cairo
+{
+       [Serializable]
+       public enum HintStyle
+       {
+               Default,
+               None,
+               Slight,
+               Medium,
+               Full,
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/LineCap.cs b/mcs/class/Mono.Cairo/Mono.Cairo/LineCap.cs
new file mode 100644 (file)
index 0000000..57cfdec
--- /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 Cairo
+{
+       [Serializable]
+       public enum LineCap
+       {
+               Butt,
+               Round,
+               Square,
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/LineJoin.cs b/mcs/class/Mono.Cairo/Mono.Cairo/LineJoin.cs
new file mode 100644 (file)
index 0000000..439b2a5
--- /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 Cairo
+{
+       [Serializable]
+       public enum LineJoin
+       {
+               Miter,
+               Round,
+               Bevel
+       }
+}
+
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/Operator.cs b/mcs/class/Mono.Cairo/Mono.Cairo/Operator.cs
new file mode 100644 (file)
index 0000000..c1ced71
--- /dev/null
@@ -0,0 +1,56 @@
+//
+// 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 Cairo
+{
+       [Serializable]
+       public enum Operator
+       {
+               Clear,
+               Source,
+               Over,
+               In,
+               Out,
+               Atop,
+
+               Dest,
+               DestOver,
+               DestIn,
+               DestOut,
+               DestAtop,
+               
+               Xor,
+               Add,
+               Saturate,
+       }
+}
index 374b7fcd7f9cf436d6708566d40dd343b7d8b292..53790b2e67227d1e5637ae7fd9831a0b97dc62ef 100644 (file)
@@ -55,14 +55,16 @@ namespace Cairo {
                {
                 public Status AddColorStop (double offset, Cairo.Color c)
                 {
-                        return CairoAPI.cairo_pattern_add_color_stop_rgba (pattern, offset, 
+                        CairoAPI.cairo_pattern_add_color_stop_rgba (pattern, offset, 
                                                                  c.R, c.G, c.B, c.A);                
+                       return Status;
                 }
 
                 public Status AddColorStopRgb (double offset, Cairo.Color c)
                 {
-                        return CairoAPI.cairo_pattern_add_color_stop_rgb (pattern, offset, 
+                        CairoAPI.cairo_pattern_add_color_stop_rgb (pattern, offset, 
                                                                  c.R, c.G, c.B);
+                       return Status;
                 }              
                }
 
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/Status.cs b/mcs/class/Mono.Cairo/Mono.Cairo/Status.cs
new file mode 100644 (file)
index 0000000..f1dabb3
--- /dev/null
@@ -0,0 +1,60 @@
+//
+// Mono.Cairo.Status.cs
+//
+// Authors:
+//   Duncan Mak (duncan@ximian.com)
+//   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//   John Luke (john.luke@gmail.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 Cairo
+{
+       [Serializable]
+       public enum Status
+       {
+               Success = 0,
+               NoMemory,
+               InvalidRestore,
+               InvalidPopGroup,
+               NoCurrentPoint,
+               InvalidMatrix,
+               InvalidStatus,
+               NullPointer,
+               InvalidString,
+               InvalidPathData,
+               ReadError,
+               WriteError,
+               SurfaceFinished,
+               SurfaceTypeMismatch,
+               PatternTypeMismatch,
+               InvalidContent,
+               InvalidFormat,
+               InvalidVisual,
+               FileNotFound,
+               InvalidDash
+       }
+}
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/SubpixelOrder.cs b/mcs/class/Mono.Cairo/Mono.Cairo/SubpixelOrder.cs
new file mode 100644 (file)
index 0000000..e8ab658
--- /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 Cairo
+{
+       [Serializable]
+       public enum SubpixelOrder
+       {
+               Default,
+               Rgb,
+               Bgr,
+               Vrgb,
+               Vbgr,
+       }
+}
index 3650603389ccb3d0cb4ecfb5f0cf159f7cfdabc5..ced7360402b7f6bd83e740d47f06747fe190e4f5 100644 (file)
@@ -238,14 +238,15 @@ namespace Cairo {
                        surface = (IntPtr) 0;
                }
                
-               public Cairo.Status Finish ()
+               public Status Finish ()
                {
-                       return CairoAPI.cairo_surface_finish (surface);
+                       CairoAPI.cairo_surface_finish (surface);
+                       return Status;
                }
                
-               public Cairo.Status Flush ()
+               public void Flush ()
                {
-                       return CairoAPI.cairo_surface_flush (surface);
+                       CairoAPI.cairo_surface_flush (surface);
                }
                
                public void MarkDirty ()
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/TextExtents.cs b/mcs/class/Mono.Cairo/Mono.Cairo/TextExtents.cs
new file mode 100644 (file)
index 0000000..f9cd560
--- /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 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);
+               }
+       }
+}