2008-04-08 Jordi Mas i Hernandez <jordimash@gmail.com>
authorJordi Mas i Hernandez <jordi@mono-cvs.ximian.com>
Tue, 8 Apr 2008 20:25:25 +0000 (20:25 -0000)
committerJordi Mas i Hernandez <jordi@mono-cvs.ximian.com>
Tue, 8 Apr 2008 20:25:25 +0000 (20:25 -0000)
* Context.cs: New ReferenceCount property
   * FontFace.cs: New FontFace.cs method
* LinearGradient.cs: New LinearPoints property
* Surface.cs: New ReferenceCount property
* SolidPattern.cs: New Color property
* Gradient.cs: New ColorStopCount property
* NativeMethods.cs: Update new methods and remove CAIRO_1_4 define

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

mcs/class/Mono.Cairo/ChangeLog
mcs/class/Mono.Cairo/Mono.Cairo/Context.cs
mcs/class/Mono.Cairo/Mono.Cairo/FontFace.cs
mcs/class/Mono.Cairo/Mono.Cairo/Gradient.cs
mcs/class/Mono.Cairo/Mono.Cairo/LinearGradient.cs
mcs/class/Mono.Cairo/Mono.Cairo/NativeMethods.cs
mcs/class/Mono.Cairo/Mono.Cairo/SolidPattern.cs
mcs/class/Mono.Cairo/Mono.Cairo/Surface.cs

index 5c36fa714c7a90cb4e5e2ebff338071e8ac28d9e..65abca300629e268d477675fffc86e90151b7dd9 100644 (file)
@@ -1,3 +1,13 @@
+2008-04-08 Jordi Mas i Hernandez <jordimash@gmail.com>
+
+       * Context.cs: New ReferenceCount property
+       * FontFace.cs: New FontFace.cs method
+       * LinearGradient.cs: New LinearPoints property
+       * Surface.cs: New ReferenceCount property
+       * SolidPattern.cs: New Color property
+       * Gradient.cs: New ColorStopCount property
+       * NativeMethods.cs: Update new methods and remove CAIRO_1_4 define
+
 2008-04-05 Jordi Mas i Hernandez <jordimash@gmail.com>
 
        * ScaledFont.cs: Adds class to encapsulate scaled font API
index 3b2ac636ec74da250438a29b713750c2948ede24..32c55df482af57878e768bbf476565ae0fb314a0 100644 (file)
@@ -383,6 +383,10 @@ namespace Cairo {
                         }
                 }
 
+               public uint ReferenceCount {
+                       get { return NativeMethods.cairo_get_reference_count (state); }
+               }
+
                public void SetSourceRGB (double r, double g, double b)
                {
                        NativeMethods.cairo_set_source_rgb (state, r, g, b);
index a7adbd9339a6204ec2149719059ed1a80f02af06..c2944b84b3e7dd79d58fe669598d24c04b7b3b38 100644 (file)
@@ -93,6 +93,10 @@ namespace Cairo
                                return NativeMethods.cairo_font_face_get_type (handle);
                        }
                }
+
+               public uint ReferenceCount {
+                       get { return NativeMethods.cairo_font_face_get_reference_count (handle); }
+               }
        }
 }
 
index 19790c2897b615d0ecb1c30216135d3cca7ad4fa..c15980b071c2a5448a38ed8649eab093c5d5922d 100644 (file)
@@ -40,7 +40,15 @@ namespace Cairo {
                protected Gradient ()
                {
                }
-               
+
+               public int ColorStopCount {
+                       get {
+                               int cnt;
+                               NativeMethods.cairo_pattern_get_color_stop_count (pattern, out cnt);
+                               return cnt;
+                       }
+               }
+
                public Status AddColorStop (double offset, Cairo.Color c)
                {
                        NativeMethods.cairo_pattern_add_color_stop_rgba (pattern, offset, c.R, c.G, c.B, c.A);
index d7825ee948f342fd1e2132f61f76ec15c23ee429..58d8e21ab8a8024a50362e0a461ce926b339b776 100644 (file)
@@ -41,6 +41,20 @@ namespace Cairo {
                {
                        pattern = NativeMethods.cairo_pattern_create_linear (x0, y0, x1, y1);
                }
+
+               public PointD[] LinearPoints {
+                        get {
+                               double x0, y0, x1, y1;
+                               PointD[] points = new PointD [2];
+
+                               NativeMethods.cairo_pattern_get_linear_points (pattern, out x0, out y0, out x1, out y1);
+
+                               points[0] = new PointD (x0, y0);
+                               points[1] = new PointD (x1, y1);
+                               return points;
+                        }
+                }
+
        }
 }
 
index cc5380f9e0f0baa1777d837caf25342ca6356ec4..64bc4dd65c381f87a56d7eed9f92071378ffe5e4 100644 (file)
@@ -61,10 +61,8 @@ namespace Cairo
                [DllImport (cairo)]
                internal static extern void cairo_clip_preserve (IntPtr cr);
 
-#if CAIRO_1_4
                [DllImport (cairo)]
                internal static extern void cairo_clip_extents (IntPtr cr, out double x1, out double y1, out double x2, out double y2);
-#endif
                
                [DllImport (cairo)]
                internal static extern void cairo_close_path (IntPtr cr);
@@ -83,6 +81,9 @@ namespace Cairo
                
                [DllImport (cairo)]
                internal static extern IntPtr cairo_create (IntPtr target);
+
+               [DllImport (cairo)]
+               internal static extern uint cairo_get_reference_count (IntPtr surface);
                
                [DllImport (cairo)]
                internal static extern void cairo_curve_to (IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3);
@@ -129,6 +130,9 @@ namespace Cairo
                
                [DllImport (cairo)]
                internal static extern Status cairo_font_face_status (IntPtr font_face);
+
+               [DllImport (cairo)]
+               internal static extern uint cairo_font_face_get_reference_count (IntPtr surface);
                
                // FontOptions
                [DllImport (cairo)]
@@ -283,6 +287,9 @@ namespace Cairo
                
                [DllImport (cairo)]
                internal static extern int cairo_image_surface_get_width  (IntPtr surface);
+
+               [DllImport (cairo)]
+               internal static extern uint cairo_surface_get_reference_count (IntPtr surface);
                
                [DllImport (cairo)]
                [return: MarshalAs (UnmanagedType.U1)]
@@ -363,36 +370,28 @@ namespace Cairo
                [DllImport (cairo)]
                internal static extern void cairo_pattern_add_color_stop_rgba (IntPtr pattern, double offset, double red, double green, double blue, double alpha);
 
-#if CAIRO_1_4
                [DllImport (cairo)]
                internal static extern Status cairo_pattern_get_color_stop_count (IntPtr pattern, out int count);
                [DllImport (cairo)]
                internal static extern Status cairo_pattern_get_color_stop_rgba (IntPtr pattern, int index, out double offset, out double red, out double green, out double blue, out double alpha);
-#endif
                
                [DllImport (cairo)]
                internal static extern IntPtr cairo_pattern_create_for_surface (IntPtr surface);
 
-#if CAIRO_1_4
                [DllImport (cairo)]
                internal static extern Status cairo_pattern_get_surface (IntPtr pattern, out IntPtr surface);
-#endif
                
                [DllImport (cairo)]
                internal static extern IntPtr cairo_pattern_create_linear (double x0, double y0, double x1, double y1);
 
-#if CAIRO_1_4
                [DllImport (cairo)]
                internal static extern Status cairo_pattern_get_linear_points (IntPtr pattern, out double x0, out double y0, out double x1, out double y1);
-#endif
                
                [DllImport (cairo)]
                internal static extern IntPtr cairo_pattern_create_radial (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1);
 
-#if CAIRO_1_4
                [DllImport (cairo)]
                internal static extern Status cairo_pattern_get_radial_circles (IntPtr pattern, out double x0, out double y0, out double r0, out double x1, out double y1, out double r1);
-#endif
                
                [DllImport (cairo)]
                internal static extern IntPtr cairo_pattern_create_rgb (double r, double g, double b);
@@ -400,10 +399,8 @@ namespace Cairo
                [DllImport (cairo)]
                internal static extern IntPtr cairo_pattern_create_rgba (double r, double g, double b, double a);
 
-#if CAIRO_1_4
                [DllImport (cairo)]
                internal static extern Status cairo_pattern_get_rgba (IntPtr pattern, out double red, out double green, out double blue, out double alpha);
-#endif
                
                [DllImport (cairo)]
                internal static extern void cairo_pattern_destroy (IntPtr pattern);
@@ -560,13 +557,11 @@ namespace Cairo
                [DllImport (cairo)]
                internal static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset);
 
-#if CAIRO_1_4
                [DllImport (cairo)]
                internal static extern void cairo_get_dash (IntPtr cr, IntPtr dashes, out double offset);
 
                [DllImport (cairo)]
                internal static extern int cairo_get_dash_count (IntPtr cr);
-#endif
                
                [DllImport (cairo)]
                internal static extern void cairo_set_fill_rule (IntPtr cr, Cairo.FillRule fill_rule);
@@ -640,13 +635,11 @@ namespace Cairo
                [DllImport (cairo)]
                internal static extern void cairo_stroke_preserve (IntPtr cr);
                
-#if CAIRO_1_4
                [DllImport (cairo)]
                internal static extern void cairo_rectangle_list_destroy (IntPtr rectangle_list);
 
                [DllImport (cairo)]
                internal static extern IntPtr cairo_copy_clip_rectangle_list (IntPtr cr);
-#endif
 
                // Surface
                [DllImport (cairo)]
@@ -751,10 +744,8 @@ namespace Cairo
                [DllImport (cairo)]
                internal static extern IntPtr cairo_win32_surface_create (IntPtr hdc);
                
-#if CAIRO_1_4
                [DllImport (cairo)]
                internal static extern IntPtr cairo_win32_surface_create_with_ddb (IntPtr hdc, Format format, int width, int height);
-#endif
 
                // XcbSurface
                [DllImport (cairo)]
index 1057ae11a09fe0e4370a8bfd39a22467a96a51a3..44dba86a97d9acbf3ae527b89b59c5bb88d4350e 100644 (file)
@@ -59,6 +59,15 @@ namespace Cairo {
                        else
                                pattern = NativeMethods.cairo_pattern_create_rgba (color.R, color.G, color.B, color.A);
                }
+
+               public Color Color {
+                        get {
+                               double red, green, blue, alpha;
+
+                               NativeMethods.cairo_pattern_get_rgba  (pattern, out red, out green, out blue, out alpha);
+                               return new Color (red, green, blue, alpha);
+                        }
+                }
        }
 }
 
index bf4df528ca48a94b974518af7ede6c3ee5ff3b35..e1a54da477666e623122d052c92778874b90bcee 100644 (file)
@@ -229,5 +229,9 @@ namespace Cairo {
                public SurfaceType SurfaceType {
                        get { return NativeMethods.cairo_surface_get_type (surface); }
                }
+
+               public uint ReferenceCount {
+                       get { return NativeMethods.cairo_surface_get_reference_count (surface); }
+               }
         }
 }