2007-07-07 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / class / Mono.Cairo / Mono.Cairo / Pattern.cs
index 6f655cec121102477e2d940c741f5107f38f03e6..96f6b12c7e44c4b0068c6eb455b0a98d04a0a787 100644 (file)
 //
 
 using System;
-using System.Runtime.InteropServices;
-using Cairo;
 
 namespace Cairo {
    
-        public class LinearGradient : Gradient
-        {              
-               public LinearGradient (double x0, double y0, double x1, double y1) : base()
-                {
-                        pattern = CairoAPI.cairo_pattern_create_linear (x0, y0, x1, y1);
-                }              
-       }
-   
-        public class RadialGradient : Gradient
-               {
-               public RadialGradient (double cx0, double cy0, double radius0,
-                                     double cx1, double cy1, double radius1) : base()
-                {
-                        pattern = CairoAPI.cairo_pattern_create_radial (cx0, cy0, radius0,
-                                                                   cx1, cy1, radius1);
-                }
-       }
-
-               public class Gradient : Pattern
-               {
-                public Status AddColorStop (double offset, Cairo.Color c)
-                {
-                        return CairoAPI.cairo_pattern_add_color_stop_rgba (pattern, offset, 
-                                                                 c.R, c.G, c.B, c.A);                
-                }
-
-                public Status AddColorStopRgb (double offset, Cairo.Color c)
-                {
-                        return CairoAPI.cairo_pattern_add_color_stop_rgb (pattern, offset, 
-                                                                 c.R, c.G, c.B);
-                }              
-               }
-
-               // FIXME: probably will change to a better name at some point
-               public class SolidPattern : Pattern
-               {
-                       public SolidPattern (Color color, bool solid)
-                       {
-                               if (solid)
-                                       pattern = CairoAPI.cairo_pattern_create_rgb (color.R, color.G, color.B);
-                               else
-                                       pattern = CairoAPI.cairo_pattern_create_rgba (color.R, color.G, color.B, color.A);
-                       }
-               }
-
-               public class SurfacePattern : Pattern
-               {
-                       public SurfacePattern (Surface surface)
-                       {
-                               pattern = CairoAPI.cairo_pattern_create_for_surface (surface.Pointer);
-                       }
-
-                       public Extend Extend {
-                               set { CairoAPI.cairo_pattern_set_extend (pattern, value); }
-                               get { return CairoAPI.cairo_pattern_get_extend (pattern); }
-                       }
-
-                       public Filter Filter {
-                               set { CairoAPI.cairo_pattern_set_filter (pattern, value); }
-                               get { return CairoAPI.cairo_pattern_get_filter (pattern); }
-                       }
-               }
-   
         public class Pattern
         {
                 protected IntPtr pattern = IntPtr.Zero;
@@ -109,9 +44,10 @@ namespace Cairo {
                        pattern = ptr;
                }               
                
+                [Obsolete ("Use the SurfacePattern constructor")]
                 public Pattern (Surface surface)
                 {
-                        pattern = CairoAPI.cairo_pattern_create_for_surface (surface.Pointer);
+                        pattern = CairoAPI.cairo_pattern_create_for_surface (surface.Handle);
                 }
                
                 protected void Reference ()
@@ -144,6 +80,10 @@ namespace Cairo {
                 public IntPtr Pointer {
                         get { return pattern; }
                 }              
+
+               public PatternType PatternType {
+                       get { return CairoAPI.cairo_pattern_get_type (pattern); }
+               }
         }
 }