[vala] girparser: Add out/ref arguments



commit 6cdaaf12bfe5563ccd831d88da2cf219ffccde92
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Aug 29 15:35:12 2010 +0200

    girparser: Add out/ref arguments

 vala/valagirparser.vala |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index fddfc20..dfb27df 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1540,7 +1540,18 @@ public class Vala.GirParser : CodeVisitor {
 		if (name == null) {
 			name = default_name;
 		}
-		string direction = reader.get_attribute ("direction");
+		string direction = null;
+		if (metadata.has_argument (ArgumentType.OUT)) {
+			if (metadata.get_bool (ArgumentType.OUT)) {
+				direction = "out";
+			} // null otherwise
+		} else if (metadata.has_argument (ArgumentType.REF)) {
+			if (metadata.get_bool (ArgumentType.REF)) {
+				direction = "inout";
+			} // null otherwise
+		} else {
+			direction = reader.get_attribute ("direction");
+		}
 		string transfer = reader.get_attribute ("transfer-ownership");
 		string allow_none = reader.get_attribute ("allow-none");
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]