[f-spot] Extract an IImageLoader interface.
- From: Ruben Vermeersch <rubenv src gnome org>
- To: svn-commits-list gnome org
- Subject: [f-spot] Extract an IImageLoader interface.
- Date: Wed, 8 Jul 2009 14:22:50 +0000 (UTC)
commit a1f81169d062d061c9fd700a34b45585f33634fe
Author: Ruben Vermeersch <ruben savanne be>
Date: Wed Jul 8 09:55:14 2009 +0100
Extract an IImageLoader interface.
src/IImageLoader.cs | 29 +++++++++++++++++++++++++++++
src/ImageLoader.cs | 2 +-
src/Makefile.am | 1 +
src/PhotoImageView.cs | 8 ++++----
4 files changed, 35 insertions(+), 5 deletions(-)
---
diff --git a/src/IImageLoader.cs b/src/IImageLoader.cs
new file mode 100644
index 0000000..e91def4
--- /dev/null
+++ b/src/IImageLoader.cs
@@ -0,0 +1,29 @@
+//
+// Fspot.IImageLoader.cs
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// Author(s)
+// Stephane Delcroix <sdelcroix novell com>
+//
+// This is free software. See COPYING for details
+//
+
+using FSpot.Utils;
+using System;
+using Gdk;
+
+namespace FSpot {
+ public interface IImageLoader : IDisposable {
+ bool Loading { get; }
+
+ event EventHandler<AreaPreparedEventArgs> AreaPrepared;
+ event EventHandler<AreaUpdatedEventArgs> AreaUpdated;
+ event EventHandler Completed;
+
+ void Load (Uri uri);
+
+ Pixbuf Pixbuf { get; }
+ PixbufOrientation PixbufOrientation { get; }
+ }
+}
diff --git a/src/ImageLoader.cs b/src/ImageLoader.cs
index f99add9..9f07c24 100644
--- a/src/ImageLoader.cs
+++ b/src/ImageLoader.cs
@@ -43,7 +43,7 @@ namespace FSpot {
}
}
- public class ImageLoader : Gdk.PixbufLoader
+ public class ImageLoader : Gdk.PixbufLoader, IImageLoader
{
#region public api
public ImageLoader () : base ()
diff --git a/src/Makefile.am b/src/Makefile.am
index afe144f..d75ed2f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -174,6 +174,7 @@ F_SPOT_CSDISTFILES = \
$(srcdir)/GroupSelector.cs \
$(srcdir)/Accelerometer.cs \
$(srcdir)/Histogram.cs \
+ $(srcdir)/IImageLoader.cs \
$(srcdir)/ImageLoaderThread.cs \
$(srcdir)/ImageLoader.cs \
$(srcdir)/ImportBackend.cs \
diff --git a/src/PhotoImageView.cs b/src/PhotoImageView.cs
index 6885604..683de2d 100644
--- a/src/PhotoImageView.cs
+++ b/src/PhotoImageView.cs
@@ -195,7 +195,7 @@ namespace FSpot.Widgets {
#region loader
uint timer;
- ImageLoader loader;
+ IImageLoader loader;
void Load (Uri uri)
{
timer = Log.DebugTimerStart ();
@@ -211,7 +211,7 @@ namespace FSpot.Widgets {
void HandlePixbufPrepared (object sender, AreaPreparedEventArgs args)
{
- ImageLoader loader = sender as ImageLoader;
+ IImageLoader loader = sender as IImageLoader;
if (loader != this.loader)
return;
@@ -229,7 +229,7 @@ namespace FSpot.Widgets {
void HandlePixbufAreaUpdated (object sender, AreaUpdatedEventArgs args)
{
- ImageLoader loader = sender as ImageLoader;
+ IImageLoader loader = sender as IImageLoader;
if (loader != this.loader)
return;
@@ -243,7 +243,7 @@ namespace FSpot.Widgets {
void HandleDone (object sender, System.EventArgs args)
{
Log.DebugTimerPrint (timer, "Loading image took {0}");
- ImageLoader loader = sender as ImageLoader;
+ IImageLoader loader = sender as IImageLoader;
if (loader != this.loader)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]