f-spot r3720 - in trunk: . src src/Widgets
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r3720 - in trunk: . src src/Widgets
- Date: Fri, 29 Feb 2008 15:03:47 +0000 (GMT)
Author: sdelcroix
Date: Fri Feb 29 15:03:47 2008
New Revision: 3720
URL: http://svn.gnome.org/viewvc/f-spot?rev=3720&view=rev
Log:
2008-02-29 Stephane Delcroix <sdelcroix novell com>
* src/Widgets/CairoUtils.cs: drop obsolete and unused helpers.
* src/ControlOverlay.cs: replace obsolete calls, link against the system
cairo.
Modified:
trunk/ChangeLog
trunk/src/ControlOverlay.cs
trunk/src/Widgets/CairoUtils.cs
Modified: trunk/src/ControlOverlay.cs
==============================================================================
--- trunk/src/ControlOverlay.cs (original)
+++ trunk/src/ControlOverlay.cs Fri Feb 29 15:03:47 2008
@@ -8,11 +8,11 @@
*
* See COPYING for license information.
*/
+extern alias MCairo;
using System;
using Gtk;
using FSpot.Widgets;
-using Cairo;
namespace FSpot {
public class ControlOverlay : Window {
@@ -131,16 +131,16 @@
return false;
}
- protected virtual void ShapeSurface (Context cr, Cairo.Color color)
+ protected virtual void ShapeSurface (MCairo::Cairo.Context cr, MCairo::Cairo.Color color)
{
- cr.Operator = Operator.Source;
- Pattern p = new SolidPattern (new Cairo.Color (0, 0, 0, 0));
+ cr.Operator = MCairo::Cairo.Operator.Source;
+ MCairo::Cairo.Pattern p = new MCairo::Cairo.SolidPattern (new MCairo::Cairo.Color (0, 0, 0, 0));
cr.Source = p;
p.Destroy ();
cr.Paint ();
- cr.Operator = Operator.Over;
+ cr.Operator = MCairo::Cairo.Operator.Over;
- Pattern r = new SolidPattern (color);
+ MCairo::Cairo.Pattern r = new MCairo::Cairo.SolidPattern (color);
cr.Source = r;
r.Destroy ();
cr.MoveTo (round, 0);
@@ -175,9 +175,9 @@
Allocation.Width,
Allocation.Height, 1);
- Context cr = CairoUtils.CreateContext (bitmap);
+ MCairo::Cairo.Context cr = Gdk.CairoHelper.Create (bitmap);
ShapeCombineMask (bitmap, 0, 0);
- ShapeSurface (cr, new Cairo.Color (1, 1, 1));
+ ShapeSurface (cr, new MCairo::Cairo.Color (1, 1, 1));
ShapeCombineMask (bitmap, 0, 0);
((IDisposable)cr).Dispose ();
bitmap.Dispose ();
@@ -187,9 +187,9 @@
protected override bool OnExposeEvent (Gdk.EventExpose args)
{
Gdk.Color c = Style.Background (State);
- Context cr = CairoUtils.CreateContext (GdkWindow);
+ MCairo::Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow);
- ShapeSurface (cr, new Cairo.Color (c.Red / (double) ushort.MaxValue,
+ ShapeSurface (cr, new MCairo::Cairo.Color (c.Red / (double) ushort.MaxValue,
c.Blue / (double) ushort.MaxValue,
c.Green / (double) ushort.MaxValue,
0.8));
Modified: trunk/src/Widgets/CairoUtils.cs
==============================================================================
--- trunk/src/Widgets/CairoUtils.cs (original)
+++ trunk/src/Widgets/CairoUtils.cs Fri Feb 29 15:03:47 2008
@@ -24,33 +24,6 @@
}
[DllImport("libgdk-2.0-0.dll")]
- extern static void gdk_cairo_set_source_pixmap (IntPtr handle,
- IntPtr drawable,
- double x,
- double y);
-
- [Obsolete ("use Gdk.CairoHelper.SetSourcePixmap instead")]
- public static void SetSourceDrawable (Context ctx, Gdk.Drawable d, double x, double y)
- {
- try {
- gdk_cairo_set_source_pixmap (ctx.Handle, d.Handle, x, y);
- } catch (EntryPointNotFoundException) {
- int width, height;
- d.GetSize (out width, out height);
- XlibSurface surface = new XlibSurface (GdkUtils.GetXDisplay (d.Display),
- (IntPtr)GdkUtils.GetXid (d),
- GdkUtils.GetXVisual (d.Visual),
- width, height);
-
- SurfacePattern p = new SurfacePattern (surface);
- Matrix m = new Matrix ();
- m.Translate (-x, -y);
- p.Matrix = m;
- ctx.Source = p;
- }
- }
-
- [DllImport("libgdk-2.0-0.dll")]
static extern IntPtr gdk_cairo_create (IntPtr raw);
[Obsolete ("use Gdk.CairoHelper.Create instead")]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]