gnome-scan r769 - in trunk: . lib
- From: bersace svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-scan r769 - in trunk: . lib
- Date: Wed, 14 Jan 2009 21:23:31 +0000 (UTC)
Author: bersace
Date: Wed Jan 14 21:23:31 2009
New Revision: 769
URL: http://svn.gnome.org/viewvc/gnome-scan?rev=769&view=rev
Log:
Preliminary prerequisite support.
Modified:
trunk/ChangeLog
trunk/lib/gnome-scan-option-manager.vala
Modified: trunk/lib/gnome-scan-option-manager.vala
==============================================================================
--- trunk/lib/gnome-scan-option-manager.vala (original)
+++ trunk/lib/gnome-scan-option-manager.vala Wed Jan 14 21:23:31 2009
@@ -27,18 +27,27 @@
public class OptionManager : Object {
// option name -> Type
- private HashTable<string,Type> rules_by_name;
+ private HashTable<weak string,Type> rules_by_name;
// option type -> Type
private HashTable<Type,Type> rules_by_type;
// option name -> option instance
- private HashTable<string,Option> options;
+ private HashTable<weak string,Option> options;
+
+ // PREREQUISITE
+ // option name -> value
+ private HashTable<weak string,Value?> defaults;
+ // option name -> range
+ private HashTable<weak string,Gnome.Scan.Range?> ranges;
+ // option name -> enums
+ private HashTable<weak string,SList<weak Gnome.Scan.EnumValue?>> enums;
construct {
- this.rules_by_name = new HashTable<string,Type>(GLib.str_hash, GLib.str_equal);
+ this.rules_by_name = new HashTable<weak string,Type>(GLib.str_hash, GLib.str_equal);
this.rules_by_type = new HashTable<Type,Type>(GLib.direct_hash, GLib.direct_equal);
- this.options = new HashTable<string,Option>(GLib.str_hash, GLib.str_equal);
-
- // add default rules ?
+ this.options = new HashTable<weak string,Option>(GLib.str_hash, GLib.str_equal);
+ this.defaults = new HashTable<weak string,Value?>(GLib.str_hash, GLib.str_equal);
+ this.ranges = new HashTable<weak string,Gnome.Scan.Range?>(GLib.str_hash, GLib.str_equal);
+ this.enums = new HashTable<weak string,SList<weak Gnome.Scan.EnumValue?>>(GLib.str_hash, GLib.str_equal);
}
public void register_option(Option option)
@@ -69,5 +78,20 @@
return Type.INVALID;
}
+
+ public void register_default_value(string option_name, Value value)
+ {
+ this.defaults.insert(option_name, value);
+ }
+
+ public void register_constraint_range(string option_name, Gnome.Scan.Range range)
+ {
+ this.ranges.insert(option_name, range);
+ }
+
+ public void register_constraint_enum(string option_name, SList<weak Gnome.Scan.EnumValue?> values)
+ {
+ this.enums.insert(option_name, values.copy());
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]