seed r4 - in trunk: libseed tests



Author: racarr
Date: Fri Oct 17 22:59:41 2008
New Revision: 4
URL: http://svn.gnome.org/viewvc/seed?rev=4&view=rev

Log:
Make G_TYPE_ENUM properties work.


Modified:
   trunk/libseed/seed-engine.c
   trunk/tests/enum.js

Modified: trunk/libseed/seed-engine.c
==============================================================================
--- trunk/libseed/seed-engine.c	(original)
+++ trunk/libseed/seed-engine.c	Fri Oct 17 22:59:41 2008
@@ -530,6 +530,7 @@
 		GParamSpec * spec = 0;
 		GObject * obj;
 		GValue gval = {0};
+		GType type;
 		gchar * cproperty_name;
 		int length;
 
@@ -578,9 +579,12 @@
 		}
 	
 		g_value_unset(&gval);
+		
+		if (g_type_is_a(spec->value_type, G_TYPE_ENUM))
+			type = G_TYPE_INT;
 
-		if (!(seed_gvalue_from_seed_value(value, spec->value_type, &gval) &&
-			  g_type_is_a(G_VALUE_TYPE(&gval), spec->value_type)))
+		if (!(seed_gvalue_from_seed_value(value, type, &gval) &&
+			  g_type_is_a(G_VALUE_TYPE(&gval), type)))
 		{
 				gchar * mes = g_strdup_printf("Not able to set property %s on object of type %s."
 											  " Expected type: %s. \n", cproperty_name, 

Modified: trunk/tests/enum.js
==============================================================================
--- trunk/tests/enum.js	(original)
+++ trunk/tests/enum.js	Fri Oct 17 22:59:41 2008
@@ -1,9 +1,15 @@
 #!/usr/local/bin/seed
 // Returns: 0
 // STDIN:
-// STDOUT:4.000000
+// STDOUT:2.000000
 // STDERR:
  
-Seed.import_namespace("Gst");
-Seed.print(Gst.State.playing);
+Seed.import_namespace("Gtk");
+Gtk.init(null, null);
+
+b = new Gtk.Button();
+b.relief = Gtk.ReliefStyle.none;
+
+Seed.print(Gtk.ReliefStyle.none);
+
 



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