]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support setting type_id to Vala.Interface
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 10 Mar 2011 21:35:59 +0000 (22:35 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Mon, 4 Apr 2011 13:14:47 +0000 (15:14 +0200)
vala/valacodewriter.vala
vala/valainterface.vala

index 847852e8b7818923f76ea3b84fad1fd9b71c9902..4a5aaf13ba98a4ea715cb5c73dede40ad3b9140c 100644 (file)
@@ -509,6 +509,8 @@ public class Vala.CodeWriter : CodeVisitor {
                        write_string (", lower_case_csuffix = \"%s\"".printf (iface.get_lower_case_csuffix ()));
                if (iface.get_type_cname () != iface.get_default_type_cname ())
                        write_string (", type_cname = \"%s\"".printf (iface.get_type_cname ()));
+               if (iface.get_type_id () != iface.get_default_type_id ())
+                       write_string (", type_id = \"%s\"".printf (iface.get_type_id ()));
 
                write_string (")]");
                write_newline ();
index 2c98426d5b4fe890205bf5222666953a17a1d41f..92d9cbc4b4494beff381cd66b53c62773394e8ac 100644 (file)
@@ -560,14 +560,22 @@ public class Vala.Interface : ObjectTypeSymbol {
                return null;
        }
 
+       public string? get_default_type_id () {
+               return get_upper_case_cname ("TYPE_");
+       }
+
        public override string? get_type_id () {
                if (type_id == null) {
-                       type_id = get_upper_case_cname ("TYPE_");
+                       type_id = get_default_type_id ();
                }
                
                return type_id;
        }
 
+       public void set_type_id (string type_id) {
+               this.type_id = type_id;
+       }
+
        public override void replace_type (DataType old_type, DataType new_type) {
                for (int i = 0; i < prerequisites.size; i++) {
                        if (prerequisites[i] == old_type) {