[vala] girparser: Add cprefix metadata argument for classes
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] girparser: Add cprefix metadata argument for classes
- Date: Mon, 27 Jun 2011 18:34:41 +0000 (UTC)
commit 28c8bf3cb12a6442acfd7f59a9a4764fffad0cf9
Author: Luca Bruno <lucabru src gnome org>
Date: Mon Jun 27 20:17:12 2011 +0200
girparser: Add cprefix metadata argument for classes
vala/valagirparser.vala | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 567d9be..b64f2dd 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -66,7 +66,8 @@ public class Vala.GirParser : CodeVisitor {
PRINTF_FORMAT,
ARRAY_LENGTH_FIELD,
SENTINEL,
- CLOSURE;
+ CLOSURE,
+ CPREFIX;
public static ArgumentType? from_string (string name) {
var enum_class = (EnumClass) typeof(ArgumentType).class_ref ();
@@ -565,6 +566,9 @@ public class Vala.GirParser : CodeVisitor {
return "";
}
if (new_symbol) {
+ if (metadata.has_argument (ArgumentType.CPREFIX)) {
+ return metadata.get_string (ArgumentType.CPREFIX);
+ }
return "%s%s_".printf (parent.get_lower_case_cprefix (), Symbol.camel_case_to_lower_case (name));
} else {
return symbol.get_lower_case_cprefix ();
@@ -2193,6 +2197,9 @@ public class Vala.GirParser : CodeVisitor {
if (cname != null) {
cl.set_cname (cname);
}
+ if (metadata.has_argument (ArgumentType.CPREFIX)) {
+ cl.set_lower_case_cprefix (metadata.get_string (ArgumentType.CPREFIX));
+ }
if (parent != null) {
cl.add_base_type (parse_type_from_gir_name (parent));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]