gnome-scan r801 - in trunk: . lib



Author: bersace
Date: Sat Jan 31 13:36:15 2009
New Revision: 801
URL: http://svn.gnome.org/viewvc/gnome-scan?rev=801&view=rev

Log:
Added option lookup method

Modified:
   trunk/ChangeLog
   trunk/lib/gnome-scan-node.vala

Modified: trunk/lib/gnome-scan-node.vala
==============================================================================
--- trunk/lib/gnome-scan-node.vala	(original)
+++ trunk/lib/gnome-scan-node.vala	Sat Jan 31 13:36:15 2009
@@ -27,6 +27,7 @@
 		public Status status	{set; get;}
 		public string? message	{set; get;}
 
+		private HashTable<string,Option> options_table;
 		private SList<Option> _options;
 		public SList<Option>	options {
 			get {
@@ -45,6 +46,7 @@
 
 
 		construct {
+			options_table = new HashTable<string,Option>(GLib.str_hash, GLib.str_equal);
 			this.update_status(Status.INITIALIZING, null);
 		}
 
@@ -52,9 +54,10 @@
 		{
 		}
 
-		// scanner returns true whend new image is to acquire. Allows
-		// nodes to prepare next image (e.g. next filename, next page
-		// in pdf, etc.) for multi-image acquisition
+		// Allows nodes to prepare next image (e.g. next filename,
+		// next page in pdf, etc.) for multi-image
+		// acquisition. Scanner returns true when new image is to
+		// acquire.  For other node type, returned value is ignored.
 		public virtual bool start_image()
 		{
 			return false;
@@ -106,18 +109,22 @@
 		public void install_option(Option option)
 		{
 			this._options.append(option);
+			this.options_table.insert(option.name, option);
+		}
+
+		public Option lookup_option(string name)
+		{
+			return this.options_table.lookup(name);
 		}
 
 		public void append_node(Gegl.Node node)
 		{
 			this._nodes.append(node);
-			// notify ?
 		}
 
 		public void remove_node(Gegl.Node node)
 		{
 			this._nodes.remove(node);
-			// notify ?
 		}
 	}
 }
\ No newline at end of file



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