]> 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)
committerJürg Billeter <j@bitron.ch>
Sun, 29 May 2011 07:49:14 +0000 (09:49 +0200)
vala/valacodewriter.vala
vala/valainterface.vala

index b6e31c27284b39e9a2fbb7e5617002ae6bb25e88..dbbd516f45f669930592aa8d282319fd7eb82fb6 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) {