mistelix r18 - in trunk: . Test/perf src src/core src/dialogs src/widgets



Author: jmas
Date: Sat Apr 11 09:09:31 2009
New Revision: 18
URL: http://svn.gnome.org/viewvc/mistelix?rev=18&view=rev

Log:
2009-04-11 Jordi Mas <jmas softcatala org>

	* src/dialogs/GtkDialog.cs: Make Destroy method virtual
	* src/dialogs/AddSlideDialog.cs: Load/Save window position
	* src/dialogs/AboutDialog.cs: Add namespace
	* src/mistelix.cs: Remove dead code
	* src/widgets/SlideShowImageView.cs: remove dead code
	* src/core/DvdProjectBuilder.cs:  Fixes Catalog.GetString string
	* src/core/TheoraProjectBuilder.cs: Fixes Catalog.GetString string
	* src/core/TransitionManager.cs: Remove dead code
	* src/core/Preferences.cs: Load/Save window position
	* src/core/SlideShow.cs: Remove dead code
	* src/core/SvgImage.cs: Add namespace
 	* src/core/SlideImage.cs: Remove dead code



Modified:
   trunk/ChangeLog
   trunk/Test/perf/SlideImagePerf.cs
   trunk/src/core/DvdProjectBuilder.cs
   trunk/src/core/Preferences.cs
   trunk/src/core/SlideImage.cs
   trunk/src/core/SlideShow.cs
   trunk/src/core/SvgImage.cs
   trunk/src/core/TheoraProjectBuilder.cs
   trunk/src/core/TransitionManager.cs
   trunk/src/dialogs/AboutDialog.cs
   trunk/src/dialogs/AddSlideDialog.cs
   trunk/src/dialogs/GtkDialog.cs
   trunk/src/mistelix.cs
   trunk/src/widgets/SlideShowImageView.cs

Modified: trunk/Test/perf/SlideImagePerf.cs
==============================================================================
--- trunk/Test/perf/SlideImagePerf.cs	(original)
+++ trunk/Test/perf/SlideImagePerf.cs	Sat Apr 11 09:09:31 2009
@@ -21,6 +21,7 @@
 			Stopwatch stopWatch = new Stopwatch ();
 			int times = 10;
 
+			project.Details.SetResolution (720, 576);
 			Application.Init ();
 
 			stopWatch.Start ();

Modified: trunk/src/core/DvdProjectBuilder.cs
==============================================================================
--- trunk/src/core/DvdProjectBuilder.cs	(original)
+++ trunk/src/core/DvdProjectBuilder.cs	Sat Apr 11 09:09:31 2009
@@ -155,7 +155,7 @@
 				Mistelix.Debugging ? project.FileToFullPath ("dvd_author_output.txt") : null);
 			
 			TimeSpan time = DateTime.Now - start_time;
-			total.Text = Catalog.GetString (String.Format ("Completed. Time used: {0}", TimeSpanToStr (time))) + "\n";
+			total.Text =  String.Format (Catalog.GetString ("Completed. Time used: {0}"), TimeSpanToStr (time)) + "\n";
 			total_handler (this, total);
 
 			// Delete temporary files

Modified: trunk/src/core/Preferences.cs
==============================================================================
--- trunk/src/core/Preferences.cs	(original)
+++ trunk/src/core/Preferences.cs	Sat Apr 11 09:09:31 2009
@@ -26,6 +26,7 @@
 using System.Xml;
 using System.Xml.Serialization;
 using System.Text;
+using System.Diagnostics;
 
 using Mistelix.DataModel;
 
@@ -55,6 +56,11 @@
 		public const string MainWindowY = "MainWindowY";
 		public const string MainWindowWidth = "MainWindowWidth";
 		public const string MainWindowHeight = "MainWindowHeight";
+	
+		public const string SlideWindowX = "SlideWindowX";
+		public const string SlideWindowY = "SlideWindowY";
+		public const string SlideWindowWidth = "SlideWindowWidth";
+		public const string SlideWindowHeight = "SlideWindowHeight";
 
 	    	public class SerializableDictionary <TKey, TValue> : Dictionary <TKey, TValue>, IXmlSerializable
 		{
@@ -197,11 +203,15 @@
 			properties.Add (SafeAreaKey, false.ToString ());
 
 			properties.Add (MainWindowMaximizedKey, true.ToString ());
-
 			properties.Add (MainWindowX, "-1");
 			properties.Add (MainWindowY, "-1");
 			properties.Add (MainWindowWidth, "-1");
 			properties.Add (MainWindowHeight, "-1");
+
+			properties.Add (SlideWindowX, "-1");
+			properties.Add (SlideWindowY, "-1");
+			properties.Add (SlideWindowWidth, "-1");
+			properties.Add (SlideWindowHeight, "-1");
 		}
 
 		void Load ()
@@ -226,7 +236,6 @@
 			const string key = "XDG_VIDEOS_DIR";
 			string home_dir = Environment.GetEnvironmentVariable ("HOME");
 			string config_file;
-			string home_value;
 
 			try {
 				config_file = Path.Combine (home_dir, ".config/user-dirs.dirs");

Modified: trunk/src/core/SlideImage.cs
==============================================================================
--- trunk/src/core/SlideImage.cs	(original)
+++ trunk/src/core/SlideImage.cs	Sat Apr 11 09:09:31 2009
@@ -275,7 +275,10 @@
 		void LoadAndScaleImage (int width, int height)
 		{
 			if (image == null)
-				throw new InvalidOperationException (String.Format ("SlideImage.LoadAndScaleImage: no filename defined for image"));
+				throw new InvalidOperationException ("SlideImage.LoadAndScaleImage: no filename defined for image");
+
+			if (width <= 0 || height <= 0)
+				throw new InvalidOperationException ("SlideImage.LoadAndScaleImage: width and height should be > 0");
 
 			Logger.Debug ("SlideImage.LoadAndScaleImage {0} {1} {2}", image, width, height);
 
@@ -387,23 +390,21 @@
 
 		public void ProcessEffects ()
 		{
-			SlideImage processed, previous;
+			SlideImage processed;
 			Effect effect;
 
 			if (Effects == null)
 				return;
 
-			previous = processed = this;
+			processed = this;
 
 			foreach (string name in Effects)
 			{
 				Logger.Debug ("SlideImage.ProcessEffects -> effect {0}", name);
 				effect = EffectManager.CreateFromName (name);
-				previous = processed;
 				processed = effect.Apply (processed);
 			}
  
-			CopyProperties (processed);
 			Pixels = processed.Pixels;
 		}
 

Modified: trunk/src/core/SlideShow.cs
==============================================================================
--- trunk/src/core/SlideShow.cs	(original)
+++ trunk/src/core/SlideShow.cs	Sat Apr 11 09:09:31 2009
@@ -41,7 +41,6 @@
 
 		public string Generate (Project project, ProgressEventHandler progress)
 		{
-			SlideImage[] images_transition;
 			MistelixLib lib = new MistelixLib ();
 			int total_frames = 0;
 			int frames_sec = project.Details.FramesPerSecond;

Modified: trunk/src/core/SvgImage.cs
==============================================================================
--- trunk/src/core/SvgImage.cs	(original)
+++ trunk/src/core/SvgImage.cs	Sat Apr 11 09:09:31 2009
@@ -26,114 +26,117 @@
 using System.IO;
 using System.Runtime.InteropServices;
 
-//
-// SVG image class based on rsvg library
-//
-public class SvgImage : IDisposable
+namespace Mistelix.Core
 {
-	//lib rsvg2
-	[DllImport("rsvg-2")]
-	static extern void rsvg_handle_render_cairo (IntPtr Rsvghandle, IntPtr cairo_t);
+	//
+	// SVG image class based on rsvg library
+	//
+	public class SvgImage : IDisposable
+	{
+		//lib rsvg2
+		[DllImport("rsvg-2")]
+		static extern void rsvg_handle_render_cairo (IntPtr Rsvghandle, IntPtr cairo_t);
 
-	[DllImport("rsvg-2")]
-	static extern IntPtr rsvg_handle_new_from_file (string file_name, out int error);
+		[DllImport("rsvg-2")]
+		static extern IntPtr rsvg_handle_new_from_file (string file_name, out int error);
 
-	[DllImport("rsvg-2")]
-	static extern void rsvg_handle_free (IntPtr handle);
+		[DllImport("rsvg-2")]
+		static extern void rsvg_handle_free (IntPtr handle);
 
-	[DllImport("rsvg-2")]
-	static extern void rsvg_handle_get_dimensions (IntPtr handle, ref RsvgDimensionData dimension);
+		[DllImport("rsvg-2")]
+		static extern void rsvg_handle_get_dimensions (IntPtr handle, ref RsvgDimensionData dimension);
 
-	[DllImport("rsvg-2")]
-	static extern IntPtr rsvg_handle_new_from_data (byte[] data, int len, out int error);
+		[DllImport("rsvg-2")]
+		static extern IntPtr rsvg_handle_new_from_data (byte[] data, int len, out int error);
 
-	[StructLayout(LayoutKind.Sequential)]
-	struct RsvgDimensionData
-	{
-	    	public int width;
-	    	public int height;
-	    	public double em;
-		public double ex;
-	}
+		[StructLayout(LayoutKind.Sequential)]
+		struct RsvgDimensionData
+		{
+		    	public int width;
+		    	public int height;
+		    	public double em;
+			public double ex;
+		}
 
-	RsvgDimensionData dimension;
-	IntPtr handle;
+		RsvgDimensionData dimension;
+		IntPtr handle;
 
-	public SvgImage (System.Reflection.Assembly _assembly, string resource)
-	{
-		try {
-			byte[] array;
-			Stream stream;
-			int error = 0;
+		public SvgImage (System.Reflection.Assembly _assembly, string resource)
+		{
+			try {
+				byte[] array;
+				Stream stream;
+				int error = 0;
 
-			stream =  _assembly.GetManifestResourceStream (resource);
-			array = new byte [stream.Length];
+				stream =  _assembly.GetManifestResourceStream (resource);
+				array = new byte [stream.Length];
 
-			stream.Read (array, 0, (int) stream.Length);
+				stream.Read (array, 0, (int) stream.Length);
 			
-			handle = rsvg_handle_new_from_data (array, array.Length, out error);
-			rsvg_handle_get_dimensions (handle, ref dimension);
-		} 
-		finally
-		{
-			if (handle == IntPtr.Zero)
-				throw new System.IO.IOException ("Resource not found: " + resource);
+				handle = rsvg_handle_new_from_data (array, array.Length, out error);
+				rsvg_handle_get_dimensions (handle, ref dimension);
+			} 
+			finally
+			{
+				if (handle == IntPtr.Zero)
+					throw new System.IO.IOException ("Resource not found: " + resource);
+			}
 		}
-	}
 	
-	public SvgImage (string file)
-	{
-		int error = 0;
-		dimension = new RsvgDimensionData ();
+		public SvgImage (string file)
+		{
+			int error = 0;
+			dimension = new RsvgDimensionData ();
 
-		try {
-			handle = rsvg_handle_new_from_file (file, out error);
+			try {
+				handle = rsvg_handle_new_from_file (file, out error);
 
-			if (handle != IntPtr.Zero)		
-				rsvg_handle_get_dimensions (handle, ref dimension);
+				if (handle != IntPtr.Zero)		
+					rsvg_handle_get_dimensions (handle, ref dimension);
 
-		}
+			}
 
-		finally
-		{
-			if (handle == IntPtr.Zero)
-				throw new System.IO.IOException ("File not found: " + file);
+			finally
+			{
+				if (handle == IntPtr.Zero)
+					throw new System.IO.IOException ("File not found: " + file);
 
+			}
 		}
-	}
 
-	public int Width {
-		get { return dimension.width; }
-	}
+		public int Width {
+			get { return dimension.width; }
+		}
 	
-	public int Height {
-		get { return dimension.height; }
-	}
+		public int Height {
+			get { return dimension.height; }
+		}
 
-	~SvgImage ()
-	{
-		Dispose (false);
-	}
+		~SvgImage ()
+		{
+			Dispose (false);
+		}
 
-	public void Dispose ()
-	{
-		Dispose (true);
-		System.GC.SuppressFinalize (this);
-	}
+		public void Dispose ()
+		{
+			Dispose (true);
+			System.GC.SuppressFinalize (this);
+		}
 
-	protected virtual void Dispose (bool disposing)
-	{
-		if (handle == IntPtr.Zero)
-			return;
+		protected virtual void Dispose (bool disposing)
+		{
+			if (handle == IntPtr.Zero)
+				return;
 
-		rsvg_handle_free (handle);
-		handle = IntPtr.Zero;
-	}
+			rsvg_handle_free (handle);
+			handle = IntPtr.Zero;
+		}
 
-	public void RenderToCairo (IntPtr cairo_surface)
-	{
-		if (handle != IntPtr.Zero)
-			rsvg_handle_render_cairo (handle, cairo_surface);
+		public void RenderToCairo (IntPtr cairo_surface)
+		{
+			if (handle != IntPtr.Zero)
+				rsvg_handle_render_cairo (handle, cairo_surface);
+		}
 	}
 }
 

Modified: trunk/src/core/TheoraProjectBuilder.cs
==============================================================================
--- trunk/src/core/TheoraProjectBuilder.cs	(original)
+++ trunk/src/core/TheoraProjectBuilder.cs	Sat Apr 11 09:09:31 2009
@@ -95,7 +95,7 @@
 			}
 
 			TimeSpan time = DateTime.Now - start_time;
-			total.Text = Catalog.GetString (String.Format ("Completed. Time used: {0}", TimeSpanToStr (time))) + "\n";
+			total.Text =  String.Format (Catalog.GetString ("Completed. Time used: {0}"), TimeSpanToStr (time)) + "\n";
 			total_handler (this, total);
 			Logger.Debug ("ProjectBuilderTheora.Create thread finished");
 		}

Modified: trunk/src/core/TransitionManager.cs
==============================================================================
--- trunk/src/core/TransitionManager.cs	(original)
+++ trunk/src/core/TransitionManager.cs	Sat Apr 11 09:09:31 2009
@@ -56,7 +56,6 @@
 			}
 		}
 
-		static None none;
 		static TransitionName[] names;
 		
 		static TransitionManager ()

Modified: trunk/src/dialogs/AboutDialog.cs
==============================================================================
--- trunk/src/dialogs/AboutDialog.cs	(original)
+++ trunk/src/dialogs/AboutDialog.cs	Sat Apr 11 09:09:31 2009
@@ -29,41 +29,43 @@
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-
-public class AboutDialog : Gtk.AboutDialog
+namespace Mistelix.Dialogs
 {
-	public AboutDialog () : base ()
+	public class AboutDialog : Gtk.AboutDialog
 	{
-		string [] authors = new string [] {
-			"Jordi Mas i HernÃndez <jmas softcatala org>",
-		};
-
-		// Name of the people that translated the application
-		string translators = Catalog.GetString ("translator-credits");
-
-		if (translators == "translator-credits")
-			translators = null;
-
-		ProgramName = Defines.APPNAME;
-		Version = Defines.VERSION;
-		Authors = authors;
+		public AboutDialog () : base ()
+		{
+			string [] authors = new string [] {
+				"Jordi Mas i HernÃndez <jmas softcatala org>",
+			};
+
+			// Name of the people that translated the application
+			string translators = Catalog.GetString ("translator-credits");
+
+			if (translators == "translator-credits")
+				translators = null;
+
+			ProgramName = Defines.APPNAME;
+			Version = Defines.VERSION;
+			Authors = authors;
 	
-		Logo = LoadFromAssembly ("mistelix.svg");
+			Logo = LoadFromAssembly ("mistelix.svg");
 
-		Copyright = "Jordi Mas i Hernandez <jmas softcatala org>";
-		Comments = Catalog.GetString ("Mistelix is a DVD authoring application with also Theora slideshow creation capabilities.");
-		Website = "http://www.mistelix.org";;
-		WebsiteLabel = Catalog.GetString ("Mistelix web site");
-		TranslatorCredits = translators;
-		Response += delegate (object o, Gtk.ResponseArgs e) {Destroy ();};
-	}
+			Copyright = "Jordi Mas i Hernandez <jmas softcatala org>";
+			Comments = Catalog.GetString ("Mistelix is a DVD authoring application with also Theora slideshow creation capabilities.");
+			Website = "http://www.mistelix.org";;
+			WebsiteLabel = Catalog.GetString ("Mistelix web site");
+			TranslatorCredits = translators;
+			Response += delegate (object o, Gtk.ResponseArgs e) {Destroy ();};
+		}
 
-	static Pixbuf LoadFromAssembly (string resource)
-	{
-		try {
-			return new Pixbuf (System.Reflection.Assembly.GetEntryAssembly (), resource);
-		} catch {
-			return null;
+		static Pixbuf LoadFromAssembly (string resource)
+		{
+			try {
+				return new Pixbuf (System.Reflection.Assembly.GetEntryAssembly (), resource);
+			} catch {
+				return null;
+			}
 		}
 	}
 }

Modified: trunk/src/dialogs/AddSlideDialog.cs
==============================================================================
--- trunk/src/dialogs/AddSlideDialog.cs	(original)
+++ trunk/src/dialogs/AddSlideDialog.cs	Sat Apr 11 09:09:31 2009
@@ -28,8 +28,6 @@
 using Cairo;
 using System.Collections;
 using System.Collections.Generic;
-using Mono.Addins;
-using System.Threading;
 using System.Timers;
 
 using Mistelix.Widgets;
@@ -72,6 +70,9 @@
 		// TODO: Since allows editing probably should be renamed to SlideDialog
 		public AddSlideDialog () : base ("addslide")		
 		{
+	
+			LoadWindowPosition ();
+
 			image_view = new SlideShowImageView ();
 			image_view.ChangeEvent = new ShowImageSelectionEventHandler (OnChangeImage);
 			image_view.UpdatedElements = new ShowImageUpdatedElementsEventHandler (OnUpdatedImages);
@@ -106,7 +107,6 @@
 			SetTransisitionToNone ();
 			ImageControlsSensitive (false);
 			OnUpdatedImages (this, EventArgs.Empty);
-
 			duration_spin.ValueChanged += new EventHandler (TimeValueChanged);
 		}
 
@@ -142,6 +142,7 @@
 			}
 		}
 
+
 		void OnDirectoryChanged (object sender, ChangeDirectoryEventArgs args)
 		{
 			file_view.OnDirChanged (args.Directory);
@@ -205,15 +206,12 @@
 
 		// This is a particular case since the Cancel button is not part of the standard dlg button bar
 		void OnCancel (object sender, EventArgs args)
-		{	
-			FreeResources ();
+		{
 			Dialog.Respond (ResponseType.Cancel);
 		}
 
 		void OnTransitionComboChanged (object sender, EventArgs args)
 		{
-			Logger.Debug ("OnTransitionComboChanged");
-
 			ComboBox combo = sender as ComboBox;
 			TreeIter iter;
 			TreeModel model;
@@ -222,6 +220,8 @@
 			TreeSelection selection;
 			TreePath[] paths;
 
+			Logger.Debug ("OnTransitionComboChanged");
+
 			if (!combo.GetActiveIter (out iter))
 				return;
 			
@@ -242,8 +242,6 @@
 
 		void OnTextPositionComboChanged (object sender, EventArgs args)
 		{
-			Logger.Debug ("OnTextPositionComboChanged");
-
 			ComboBox combo = sender as ComboBox;
 			TreeIter iter;
 			TreeModel model;
@@ -252,6 +250,8 @@
 			TreeSelection selection;
 			TreePath[] paths;
 
+			Logger.Debug ("OnTextPositionComboChanged");
+
 			if (!combo.GetActiveIter (out iter))
 				return;
 			
@@ -344,6 +344,42 @@
 					TextPositionConverter.FromEnum ((TextPosition) i), i);
 			}
 		}
+	
+		public override void Destroy ()
+		{
+			SaveWindowPosition ();
+			base.Destroy ();
+		}
+
+		void LoadWindowPosition ()
+		{
+			int x, y, width, height;
+
+			x = Mistelix.Preferences.GetIntValue (Preferences.SlideWindowX);
+			y = Mistelix.Preferences.GetIntValue (Preferences.SlideWindowY);
+			width = Mistelix.Preferences.GetIntValue (Preferences.SlideWindowWidth);
+			height = Mistelix.Preferences.GetIntValue (Preferences.SlideWindowHeight);
+
+			if (x==-1 && y ==-1 && width == -1 && height == -1)
+				return;
+
+			Dialog.Move (x, y);
+			Dialog.Resize (width, height);
+		}
+
+		void SaveWindowPosition ()
+		{
+			int x, y, width, height;
+
+			Dialog.GetPosition (out x, out y);
+			Dialog.GetSize (out width, out height);
+
+			Mistelix.Preferences.SetIntValue (Preferences.SlideWindowX, x);
+			Mistelix.Preferences.SetIntValue (Preferences.SlideWindowY, y);
+			Mistelix.Preferences.SetIntValue (Preferences.SlideWindowWidth, width);
+			Mistelix.Preferences.SetIntValue (Preferences.SlideWindowHeight, height);
+			Mistelix.Preferences.Save ();
+		}
 	}
 
 	// Transition preview
@@ -355,13 +391,11 @@
 		SlideImage slide_b;
 		Transition images_transition;
 		SlideImage img;
-		int idx;
 		bool next;
 		System.Timers.Timer timer;
 
 		public TransitionPreview ()
 		{
-			idx = -1;
 			img_a = new Cairo.ImageSurface (Format.Argb32, 100, 100);
 			Cairo.Context gr = new Cairo.Context (img_a);
 
@@ -387,6 +421,9 @@
 
 			timer = new System.Timers.Timer ();
 			timer.Elapsed += TimerUpdater;
+
+			((IDisposable)img_a).Dispose ();
+			((IDisposable)img_b).Dispose ();
 		}
 
 		public void UpdateTransitionType (string type)

Modified: trunk/src/dialogs/GtkDialog.cs
==============================================================================
--- trunk/src/dialogs/GtkDialog.cs	(original)
+++ trunk/src/dialogs/GtkDialog.cs	Sat Apr 11 09:09:31 2009
@@ -70,7 +70,7 @@
 			}
 		}
 
-		public void Destroy ()
+		public virtual void Destroy ()
 		{
 			Dialog.Destroy ();
 			FreeResources ();

Modified: trunk/src/mistelix.cs
==============================================================================
--- trunk/src/mistelix.cs	(original)
+++ trunk/src/mistelix.cs	Sat Apr 11 09:09:31 2009
@@ -81,7 +81,7 @@
 			preferences = new Preferences ();
 
 			if (String.Compare (Environment.GetEnvironmentVariable ("MISTELIX_DEBUG"), "true", false) == 0) { 
-					debugging = true;
+				debugging = true;
 				Logger.LogLevel = Level.DEBUG;
 				Logger.LogDevice = new FileLogger ();
 			}
@@ -98,13 +98,11 @@
 			Glade.XML gXML = new Glade.XML (null, "mistelix.glade", "mistelix", null);
 			gXML.Autoconnect (this);
 
-			foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes ("/Mistelix/SlideTransitions")) {
+			foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes ("/Mistelix/SlideTransitions"))
 				Logger.Info ("Extension:" + node.CreateInstance ());
-			}
 
-			foreach (TypeExtensionNode node in EffectManager.List) {
+			foreach (TypeExtensionNode node in EffectManager.List)
 				Logger.Info ("Extension:" + node.CreateInstance ());
-			}
 			
 			OnProjectView ();
 
@@ -157,11 +155,6 @@
 			scrolledwin_elements.Add (element_view);
 		}
 
-		Gdk.Pixbuf GetIcon (string name)
-		{
-			return Gtk.IconTheme.Default.LoadIcon (name, 48, (Gtk.IconLookupFlags) 0);
-		}
-
 		public static void Main (string [] args) 
 		{
 			Mistelix gui = new Mistelix (args);
@@ -211,20 +204,11 @@
 
 		void OnAbout (object sender, EventArgs args)
 		{
-			AboutDialog about = new AboutDialog ();
+			Dialogs.AboutDialog about = new Dialogs.AboutDialog ();
 			about.Run ();
 			about.Destroy ();
 		}
 
-		Pixbuf LoadFromAssembly (string resource)
-		{
-			try {
-				return new Pixbuf (System.Reflection.Assembly.GetEntryAssembly (), resource);
-			} catch {
-				return null;
-			}
-		}
-		
 		void OnQuit (object sender, EventArgs args)
 		{
 			SaveWindowPosition ();

Modified: trunk/src/widgets/SlideShowImageView.cs
==============================================================================
--- trunk/src/widgets/SlideShowImageView.cs	(original)
+++ trunk/src/widgets/SlideShowImageView.cs	Sat Apr 11 09:09:31 2009
@@ -84,12 +84,8 @@
 		protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background, Gdk.Rectangle cell, Gdk.Rectangle expose, CellRendererState flags)
 		{
 			Cairo.Context cr = Gdk.CairoHelper.Create (window);
-			//Console.WriteLine ("Render {0}", DateTime.Now);
 
-			SlideImage image = (SlideImage) parent.store.GetValue (iter, SlideShowImageView.COL_OBJECT);
-			string filename = image.image;
-
-			surface = (DataImageSurface) parent.store.GetValue (iter, SlideShowImageView.COL_CAIROIMAGE);
+			surface = (DataImageSurface) parent.ListStore.GetValue (iter, SlideShowImageView.COL_CAIROIMAGE);
 
 			if (surface == null) {
 				parent.RequestThumbnail (iter);
@@ -115,7 +111,7 @@
 			Date_Descending
 		}
 
-		public ListStore store; // todo: property
+		ListStore store;
 		Gtk.Image image;
 		BackgroundWorker thumbnailing;
 		int cnt = 1;
@@ -171,6 +167,10 @@
 			Dispose (false);
 		}
 
+		public ListStore ListStore {
+			get { return store; }
+		}
+
 		public override void Dispose ()
 		{
 			Dispose (true);
@@ -185,17 +185,13 @@
 				DataImageSurface image = (DataImageSurface) store.GetValue (iter, COL_CAIROIMAGE);
 
 				if (image != null)
-					image.Dispose ();
+					((IDisposable)image).Dispose ();
 
 				return false;
 			});
 			Logger.Debug ("SlideShowImageView.Disposed");
 			thumbnailing.Dispose ();
-			def_image.Dispose ();
-		}
-
-		public ListStore ListStore {
-			get { return store; }
+			((IDisposable)def_image).Dispose ();
 		}
 
 		public void LoadSlideShow (SlideShow slideshow)
@@ -641,7 +637,7 @@
 			TreeIter iter;
 			TreePath[] paths;
 			Effect effect;
-			SlideImage image, effect_image;
+			SlideImage image;
 			DataImageSurface cairo_image, prev_image;
 
 			paths = Selection.GetSelectedRows ();
@@ -671,7 +667,7 @@
 				store.SetValue (iter, COL_CAIROIMAGE, cairo_image);
 
 				if (prev_image != null)
-					prev_image.Dispose ();
+					((IDisposable)prev_image).Dispose ();
 			}
 		}
 
@@ -698,7 +694,7 @@
 				store.SetValue (iter, COL_CAIROIMAGE, cairo_image);
 
 				if (prev_image != null)
-					prev_image.Dispose ();
+					((IDisposable)prev_image).Dispose ();
 			}
 		}	
 	



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