[vala] vapigen: Support ref_function attribute for boxed types
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] vapigen: Support ref_function attribute for boxed types
- Date: Sat, 16 Jan 2010 12:42:30 +0000 (UTC)
commit 5304961c6cdf1f1fe708559f979f15e8cc82db56
Author: Jürg Billeter <j bitron ch>
Date: Sat Jan 16 13:41:07 2010 +0100
vapigen: Support ref_function attribute for boxed types
vapigen/valagidlparser.vala | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 98eaa09..013e84b 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -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") {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]