2006-12-27 Alp Toker <alp@atoker.com>
authorAlp Toker <alp@mono-cvs.ximian.com>
Wed, 27 Dec 2006 06:42:50 +0000 (06:42 -0000)
committerAlp Toker <alp@mono-cvs.ximian.com>
Wed, 27 Dec 2006 06:42:50 +0000 (06:42 -0000)
* Mono.Cairo.dll.sources:
* Mono.Cairo/Context.cs:
* Mono.Cairo/GlitzSurface.cs: Add new surface.

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

mcs/class/Mono.Cairo/ChangeLog
mcs/class/Mono.Cairo/Mono.Cairo/Context.cs
mcs/class/Mono.Cairo/Mono.Cairo/GlitzSurface.cs [new file with mode: 0644]

index 394e9703e560f06cfb55c3b7dbb479b0b313b61c..a0338abdad78ad12a2202e049a652d6d5bde2ff2 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-27  Alp Toker  <alp@atoker.com>
+
+       * Mono.Cairo.dll.sources:
+       * Mono.Cairo/Context.cs:
+       * Mono.Cairo/GlitzSurface.cs: Add new surface.
+
 2006-12-27  Alp Toker  <alp@atoker.com>
 
        * Mono.Cairo/Cairo.cs:
index ef9783606d29dfbc490d230ee0e6affcf60f917e..39196faf9ee2f687aa5a862f13af5a3c7084961e 100644 (file)
@@ -5,6 +5,7 @@
 //   Duncan Mak (duncan@ximian.com)
 //   Miguel de Icaza (miguel@novell.com)
 //   Hisham Mardam Bey (hisham.mardambey@gmail.com)
+//   Alp Toker (alp@atoker.com)
 //
 // (C) Ximian Inc, 2003.
 // (C) Novell Inc, 2003.
@@ -586,6 +587,8 @@ namespace Cairo {
                                                return new XlibSurface (surface, true);
                                        case SurfaceType.Xcb:
                                                return new XcbSurface (surface, true);
+                                       case SurfaceType.Glitz:
+                                               return new GlitzSurface (surface, true);
                                        case SurfaceType.Win32:
                                                return new Win32Surface (surface, true);
 #if CAIRO_1_2
diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/GlitzSurface.cs b/mcs/class/Mono.Cairo/Mono.Cairo/GlitzSurface.cs
new file mode 100644 (file)
index 0000000..387edcf
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// Mono.Cairo.GlitzSurface.cs
+//
+// Authors:
+//    Alp Toker
+//
+// (C) Alp Toker, 2006.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Cairo {
+       public class GlitzSurface : Surface
+       {
+               internal GlitzSurface (IntPtr handle, bool owns) : base (handle, owns)
+               {
+               }
+
+               public GlitzSurface (IntPtr glitz_surface)
+               {
+                       surface = CairoAPI.cairo_glitz_surface_create (glitz_surface);
+                       lock (surfaces.SyncRoot) {
+                               surfaces [surface] = this;
+                       }
+               }
+       }
+}