[f-spot] Drop Mono.Cairo < 1.2.5 support.



commit 18ead17055d6781293f075513d7b9bb57a4ae2d0
Author: Ruben Vermeersch <ruben savanne be>
Date:   Tue May 25 21:20:13 2010 +0200

    Drop Mono.Cairo < 1.2.5 support.

 configure.ac            |    6 +-----
 src/ControlOverlay.cs   |    8 --------
 src/Loupe.cs            |   35 -----------------------------------
 src/Widgets/IconView.cs |   14 +-------------
 4 files changed, 2 insertions(+), 61 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f43d0d6..abe4dee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,7 +145,7 @@ GTKSHARP_REQUIRED=2.12.2
 GTK_REQUIRED=2.14
 NDESK_DBUS_REQUIRED=0.4.2
 NDESK_DBUS_GLIB_REQUIRED=0.3.0
-MONO_CAIRO_REQUIRED=1.2.4
+MONO_CAIRO_REQUIRED=1.2.5
 CAIRO_REQUIRED=1.4.0
 LCMS_REQUIRED=1.12
 LIBGPHOTO2_REQUIRED=2.4
@@ -164,10 +164,6 @@ PKG_CHECK_MODULES(GNOME_SHARP, gnome-sharp-2.0 >= 2.8)
 
 PKG_CHECK_MODULES(GLIBSHARP, glib-sharp-2.0 >= 2.12)
 
-if pkg-config --atleast-version=1.2.5 mono-cairo; then
-   CSC_DEFINES="$CSC_DEFINES -d:CAIRO_1_2_5"
-fi
-
 if pkg-config --atleast-version=2.13.0 gtk-sharp-2.0 && pkg-config --max-version=2.14 gtk-sharp-2.0; then
 	AC_MSG_ERROR([There's a svn version of gtk-sharp 2.13.x installed. Uninstall it.])
 fi
diff --git a/src/ControlOverlay.cs b/src/ControlOverlay.cs
index 51c92b4..141203f 100644
--- a/src/ControlOverlay.cs
+++ b/src/ControlOverlay.cs
@@ -204,11 +204,7 @@ namespace FSpot {
 							    Allocation.Width, 
 							    Allocation.Height, 1);
 
-#if CAIRO_1_2_5			
 			Context cr = Gdk.CairoHelper.Create (bitmap);
-#else			
-			Context cr = CairoUtils.CreateContext (bitmap);
-#endif			
 			ShapeCombineMask (bitmap, 0, 0);
 			ShapeSurface (cr, new Color (1, 1, 1));
 			ShapeCombineMask (bitmap, 0, 0);
@@ -220,11 +216,7 @@ namespace FSpot {
 		protected override bool OnExposeEvent (Gdk.EventExpose args)
 		{
 			Gdk.Color c = Style.Background (State);
-#if CAIRO_1_2_5			
 			Context cr = Gdk.CairoHelper.Create (GdkWindow);
-#else
-			Context cr = CairoUtils.CreateContext (GdkWindow);
-#endif						
 
 			ShapeSurface (cr, new Cairo.Color (c.Red / (double) ushort.MaxValue,
 							   c.Blue / (double) ushort.MaxValue, 
diff --git a/src/Loupe.cs b/src/Loupe.cs
index b3e417e..e9231fe 100644
--- a/src/Loupe.cs
+++ b/src/Loupe.cs
@@ -190,11 +190,7 @@ namespace FSpot.Widgets {
 							    Allocation.Width, 
 							    Allocation.Height, 1);
 			
-#if CAIRO_1_2_5
 			Context g = CairoHelper.Create (bitmap);
-#else			
-			Context g = CairoUtils.CreateContext (bitmap);
-#endif			
 			DrawShape (g, Allocation.Width, Allocation.Height);
 			
 			((IDisposable)g).Dispose ();
@@ -202,11 +198,7 @@ namespace FSpot.Widgets {
 			if (use_shape_ext)
 				ShapeCombineMask (bitmap, 0, 0);
 			else {
-#if CAIRO_1_2_5			 
 				Cairo.Context rgba = CairoHelper.Create (GdkWindow);
-#else				
-				Context rgba = CairoUtils.CreateContext (GdkWindow);
-#endif				
 				DrawShape (rgba, Allocation.Width, Allocation.Height);
 				((IDisposable)rgba).Dispose ();
 				try {
@@ -281,22 +273,13 @@ namespace FSpot.Widgets {
 			g.Matrix = new Matrix ();
 			g.Translate (cx, cy);
 			if (source != null)
-#if CAIRO_1_2_5			 
 			CairoHelper.SetSourcePixbuf (g, source, -source.Width / 2, -source.Height / 2);
-#else
-			SetSourcePixbuf (g, source, -source.Width / 2, -source.Height / 2);
-#endif								
 
 			g.Arc (0, 0, radius, 0, 2 * Math.PI);
 			g.Fill ();
 
 			if (overlay != null) {
-#if CAIRO_1_2_5			 
 				CairoHelper.SetSourcePixbuf (g, overlay, -overlay.Width / 2, -overlay.Height / 2);
-#else
-				SetSourcePixbuf (g, overlay, -overlay.Width / 2, -overlay.Height / 2);
-
-#endif
 				g.Arc (0, 0, radius, angle, angle + Math.PI);
 				g.ClosePath ();
 				g.FillPreserve ();
@@ -305,27 +288,9 @@ namespace FSpot.Widgets {
 			}
 		}
 
-#if !CAIRO_1_2_5
-		[DllImport("libgdk-2.0-0.dll")] 	 
-	        extern static void gdk_cairo_set_source_pixbuf (IntPtr handle, 	 
-	                                                        IntPtr pixbuf, 	 
-	                                                        double        pixbuf_x, 	 
-	                                                        double        pixbuf_y); 	 
-	  	 
-	        [Obsolete ("use Gdk.CairoHelper.SetSourcePixbuf instead")] 	 
-	        static void SetSourcePixbuf (Context ctx, Gdk.Pixbuf pixbuf, double x, double y) 	 
-	        { 	 
-	                gdk_cairo_set_source_pixbuf (ctx.Handle, pixbuf.Handle, x, y); 	 
-	        }	 
-#endif				
-
 		protected override bool OnExposeEvent (Gdk.EventExpose args)
 		{
-#if CAIRO_1_2_5		 
 			Context g = CairoHelper.Create (GdkWindow);
-#else
-			Context g = CairoUtils.CreateContext (GdkWindow);			
-#endif						
 			
 			DrawShape (g, Allocation.Width, Allocation.Height);
 			//base.OnExposeEvent (args);
diff --git a/src/Widgets/IconView.cs b/src/Widgets/IconView.cs
index a934624..0c635b7 100644
--- a/src/Widgets/IconView.cs
+++ b/src/Widgets/IconView.cs
@@ -1137,8 +1137,7 @@ namespace FSpot.Widgets
 			if (isRectSelection) {
 				Gdk.Rectangle inter;
 				if (area.Intersect (rect_select, out inter)) {
-#if CAIRO_1_2_5
-				        Cairo.Context cairo_g = CairoHelper.Create (BinWindow);
+					Cairo.Context cairo_g = CairoHelper.Create (BinWindow);
 					Gdk.Color col = Style.Background(StateType.Selected);
 					cairo_g.Color = new Cairo.Color (col.Red/65535.0, col.Green/65535.0, col.Blue/65535.0, 0.5);
 					cairo_g.Rectangle (inter.X, inter.Y, inter.Width, inter.Height);
@@ -1146,17 +1145,6 @@ namespace FSpot.Widgets
 
 					((IDisposable) cairo_g.Target).Dispose ();
 					((IDisposable) cairo_g).Dispose ();
-#else
-					if (rect_gc == null) {
-						rect_gc = new Gdk.GC(BinWindow);
-						rect_gc.Copy (Style.BackgroundGC(StateType.Selected));
-						rect_gc.Fill = Fill.Stippled;
-						string bitmap_data = new string ((char) 0x02, (char) 0x01);
-						Pixmap pix = Pixmap.CreateBitmapFromData (BinWindow, bitmap_data, 2, 2);
-						rect_gc.Stipple = pix;
-					}
-					BinWindow.DrawRectangle (rect_gc, true, inter);
-#endif
 				}
 			}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]