Author: miguel
Date: 2007-07-23 01:51:55 -0400 (Mon, 23 Jul 2007)
New Revision: 82462

Added:
   trunk/mcs/class/Mono.Cairo/Mono.Cairo/Path.cs
Modified:
   trunk/mcs/class/Mono.Cairo/Mono.Cairo.dll.sources
   trunk/mcs/class/Mono.Cairo/Mono.Cairo/Context.cs
   trunk/mcs/class/Mono.Cairo/Mono.Cairo/NativeMethods.cs
Log:
Add CopyPath, CopyPathFlat, AppendPath

Modified: trunk/mcs/class/Mono.Cairo/Mono.Cairo/Context.cs
===================================================================
--- trunk/mcs/class/Mono.Cairo/Mono.Cairo/Context.cs    2007-07-23 05:32:42 UTC 
(rev 82461)
+++ trunk/mcs/class/Mono.Cairo/Mono.Cairo/Context.cs    2007-07-23 05:51:55 UTC 
(rev 82462)
@@ -500,6 +500,22 @@
                 {
                         NativeMethods.cairo_close_path (state);
                 }
+
+               public Path CopyPath ()
+               {
+                       return new Path (NativeMethods.cairo_copy_path (state));
+               }
+
+               public Path CopyPathFlat ()
+               {
+                       return new Path (NativeMethods.cairo_copy_path_flat 
(state));
+               }
+
+               public void AppendPath (Path path)
+               {
+                       NativeMethods.cairo_append_path (state, path.handle);
+               }
+               
 #endregion
 
 #region Painting Methods

Modified: trunk/mcs/class/Mono.Cairo/Mono.Cairo/NativeMethods.cs
===================================================================
--- trunk/mcs/class/Mono.Cairo/Mono.Cairo/NativeMethods.cs      2007-07-23 
05:32:42 UTC (rev 82461)
+++ trunk/mcs/class/Mono.Cairo/Mono.Cairo/NativeMethods.cs      2007-07-23 
05:51:55 UTC (rev 82462)
@@ -72,11 +72,14 @@
                [DllImport (cairo)]
                internal static extern void cairo_copy_page (IntPtr cr);
                
-               //[DllImport (cairo)]
-               //internal static extern Path cairo_copy_path (IntPtr cr);
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_copy_path (IntPtr cr);
                
-               //[DllImport (cairo)]
-               //internal static extern Path cairo_copy_path_flat (IntPtr cr);
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_copy_path_flat (IntPtr cr);
+
+               [DllImport (cairo)]
+               internal static extern IntPtr cairo_append_path (IntPtr cr, 
IntPtr path);
                
                [DllImport (cairo)]
                internal static extern IntPtr cairo_create (IntPtr target);

Added: trunk/mcs/class/Mono.Cairo/Mono.Cairo/Path.cs
===================================================================
--- trunk/mcs/class/Mono.Cairo/Mono.Cairo/Path.cs       2007-07-23 05:32:42 UTC 
(rev 82461)
+++ trunk/mcs/class/Mono.Cairo/Mono.Cairo/Path.cs       2007-07-23 05:51:55 UTC 
(rev 82462)
@@ -0,0 +1,72 @@
+//
+// Mono.Cairo.Context.cs
+//
+// Author:
+//   Miguel de Icaza ([EMAIL PROTECTED])
+//
+// This is an OO wrapper API for the Cairo API.
+//
+// Copyright 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+using Cairo;
+
+namespace Cairo {
+
+        public class Path : IDisposable 
+        {
+                internal IntPtr handle = IntPtr.Zero;
+               
+               internal Path (IntPtr handle)
+               {
+                       this.handle = handle;
+               }
+
+               ~Path ()
+               {
+                       Dispose (false);
+               }
+
+               
+               void IDisposable.Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+               
+                protected virtual void Dispose (bool disposing)
+                {
+                       if (!disposing){
+                               Console.Error.WriteLine ("Cairo.Context: called 
from finalization thread, programmer is missing a call to Dispose");
+                               return;
+                       }
+                       
+                       if (handle == IntPtr.Zero)
+                               return;
+
+                        NativeMethods.cairo_path_destroy (handle);
+                       handle = IntPtr.Zero;
+                }
+        }
+}


Property changes on: trunk/mcs/class/Mono.Cairo/Mono.Cairo/Path.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/mcs/class/Mono.Cairo/Mono.Cairo.dll.sources
===================================================================
--- trunk/mcs/class/Mono.Cairo/Mono.Cairo.dll.sources   2007-07-23 05:32:42 UTC 
(rev 82461)
+++ trunk/mcs/class/Mono.Cairo/Mono.Cairo.dll.sources   2007-07-23 05:51:55 UTC 
(rev 82462)
@@ -28,6 +28,7 @@
 ./Mono.Cairo/Matrix.cs
 ./Mono.Cairo/NativeMethods.cs
 ./Mono.Cairo/Operator.cs
+./Mono.Cairo/Path.cs
 ./Mono.Cairo/Pattern.cs
 ./Mono.Cairo/PatternType.cs
 ./Mono.Cairo/PdfSurface.cs

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to