[vala] vapigen: add delegate_target_cname
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] vapigen: add delegate_target_cname
- Date: Sat, 15 Nov 2014 13:27:08 +0000 (UTC)
commit e97c9f50c05756e58d96c3b2d56d6a3f57008138
Author: Marc-André Lureau <marcandre lureau gmail com>
Date: Sat Nov 15 02:52:52 2014 +0100
vapigen: add delegate_target_cname
Fixes bug 740154
vala/valagirparser.vala | 7 ++++++-
vapigen/valagidlparser.vala | 2 ++
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index f179a30..270bd21 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -79,7 +79,8 @@ public class Vala.GirParser : CodeVisitor {
EXPERIMENTAL,
FLOATING,
TYPE_ID,
- RETURN_VOID;
+ RETURN_VOID,
+ DELEGATE_TARGET_CNAME;
public static ArgumentType? from_string (string name) {
var enum_class = (EnumClass) typeof(ArgumentType).class_ref ();
@@ -1030,6 +1031,10 @@ public class Vala.GirParser : CodeVisitor {
merged = true;
}
+ if (metadata.has_argument (ArgumentType.DELEGATE_TARGET_CNAME)) {
+ field.set_attribute_string ("CCode", "delegate_target_cname",
metadata.get_string (ArgumentType.DELEGATE_TARGET_CNAME));
+ }
+
if (field.variable_type is DelegateType && parent.gtype_struct_for !=
null) {
// virtual method field
var d = ((DelegateType) field.variable_type).delegate_symbol;
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index ff7c8d0..0dc7fe7 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -928,6 +928,8 @@ public class Vala.GIdlParser : CodeVisitor {
if (eval (nv[1]) == "1") {
cl.set_attribute ("Experimental", true);
}
+ } else if (nv[0] == "delegate_target_cname") {
+ cl.set_attribute_string ("CCode",
"delegate_target_cname", eval (nv[1]));
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]