Fix interface properties in GObject classes
authorJürg Billeter <j@bitron.ch>
Fri, 17 Oct 2008 13:28:49 +0000 (13:28 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 17 Oct 2008 13:28:49 +0000 (13:28 +0000)
2008-10-17  Jürg Billeter  <j@bitron.ch>

* vala/valainterface.vala:
* gobject/valaccodetypesymbolbinding.vala:

Fix interface properties in GObject classes

svn path=/trunk/; revision=1851

ChangeLog
gobject/valaccodetypesymbolbinding.vala
vala/valainterface.vala

index 1184398..6153761 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-10-17  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valainterface.vala:
+       * gobject/valaccodetypesymbolbinding.vala:
+
+       Fix interface properties in GObject classes
+
+2008-10-17  Jürg Billeter  <j@bitron.ch>
+
        * gobject/valaccodeclassbinding.vala:
        * gobject/valaccodegenerator.vala:
        * vapi/glib-2.0.vapi:
index 821ff65..22cd12a 100644 (file)
@@ -32,9 +32,8 @@ public abstract class Vala.CCodeTypeSymbolBinding : CCodeBinding {
 
 
                if ((prop.property_type.data_type is Class && !(((Class) prop.property_type.data_type).is_compact)) || prop.property_type.data_type is Interface) {
-               //if ((prop.property_type.data_type is Class && ((Class) prop.property_type.data_type).is_subtype_of (codegen.gobject_type)) || prop.property_type.data_type is Interface) {
                        string param_spec_name = prop.property_type.data_type.get_param_spec_function ();
-                       if ( param_spec_name == null ) {
+                       if (param_spec_name == null) {
                                cspec.call = new CCodeIdentifier ("g_param_spec_pointer");
                        } else {
                                cspec.call = new CCodeIdentifier ( param_spec_name );
index 83bc577..d5d8017 100644 (file)
@@ -533,4 +533,16 @@ public class Vala.Interface : ObjectTypeSymbol {
        public override CodeBinding? create_code_binding (CodeGenerator codegen) {
                return codegen.create_interface_binding (this);
        }
+
+       public override string? get_param_spec_function () {
+               foreach (DataType prerequisite in prerequisites) {
+                       var prereq = prerequisite as ObjectType;
+                       var cl = prereq.type_symbol as Class;
+                       if (cl != null) {
+                               return cl.get_param_spec_function ();
+                       }
+               }
+
+               return null;
+       }
 }