]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vapigen: Support ref_function attribute for boxed types
authorJürg Billeter <j@bitron.ch>
Sat, 16 Jan 2010 12:41:07 +0000 (13:41 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 16 Jan 2010 12:41:07 +0000 (13:41 +0100)
vapigen/valagidlparser.vala

index 98eaa09414a82486cafa0016fbab8709bf354d79..013e84b47a0f3da32e291262bb2b5c0ad67326d3 100644 (file)
@@ -775,6 +775,12 @@ public class Vala.GIdlParser : CodeVisitor {
 
                        current_data_type = null;
                } else {
+                       bool ref_function_void = false;
+                       string ref_function = null;
+                       string unref_function = null;
+                       string copy_function = null;
+                       string free_function = null;
+
                        var cl = ns.scope.lookup (name) as Class;
                        if (cl == null) {
                                cl = new Class (name, current_source_reference);
@@ -793,6 +799,18 @@ public class Vala.GIdlParser : CodeVisitor {
                                                        }
                                                } else if (nv[0] == "const_cname") {
                                                        cl.const_cname = eval (nv[1]);
+                                               } else if (nv[0] == "free_function") {
+                                                       free_function = eval (nv[1]);
+                                               } else if (nv[0] == "ref_function") {
+                                                       ref_function = eval (nv[1]);
+                                               } else if (nv[0] == "unref_function") {
+                                                       unref_function = eval (nv[1]);
+                                               } else if (nv[0] == "copy_function") {
+                                                       copy_function = eval (nv[1]);
+                                               } else if (nv[0] == "ref_function_void") {
+                                                       if (eval (nv[1]) == "1") {
+                                                               ref_function_void = true;
+                                                       }
                                                }
                                        }
                                }
@@ -804,12 +822,6 @@ public class Vala.GIdlParser : CodeVisitor {
 
                        current_data_type = cl;
 
-                       bool ref_function_void = false;
-                       string ref_function = null;
-                       string unref_function = null;
-                       string copy_function = null;
-                       string free_function = null;
-
                        foreach (weak IdlNode member in boxed_node.members) {
                                if (member.type == IdlNodeTypeId.FUNCTION) {
                                        if (member.name == "ref") {