From: Jürg Billeter Date: Fri, 28 Nov 2008 19:55:20 +0000 (+0000) Subject: Support construct properties X-Git-Tag: VALA_0_5_2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c08eb060c1e08c00e2b5180492e4a5ce87cabbea;p=thirdparty%2Fvala.git Support construct properties 2008-11-28 Jürg Billeter * vapigen/valagirparser.vala: Support construct properties svn path=/trunk/; revision=2079 --- diff --git a/ChangeLog b/ChangeLog index 7b3848cce..c1ddc1535 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-28 Jürg Billeter + + * vapigen/valagirparser.vala: + + Support construct properties + 2008-11-28 Jürg Billeter * vapigen/valagirparser.vala: diff --git a/vapigen/valagirparser.vala b/vapigen/valagirparser.vala index b15a98380..7d267de88 100644 --- a/vapigen/valagirparser.vala +++ b/vapigen/valagirparser.vala @@ -652,12 +652,19 @@ public class Vala.GirParser : CodeVisitor { Property parse_property () { start_element ("property"); string name = string.joinv ("_", reader.get_attribute ("name").split ("-")); + string readable = reader.get_attribute ("readable"); + string writable = reader.get_attribute ("writable"); + string construct_ = reader.get_attribute ("construct"); next (); var type = parse_type (); var prop = new Property (name, type, null, null, get_current_src ()); prop.access = SymbolAccessibility.PUBLIC; - prop.get_accessor = new PropertyAccessor (true, false, false, null, null); - prop.set_accessor = new PropertyAccessor (false, true, false, null, null); + if (readable != "0") { + prop.get_accessor = new PropertyAccessor (true, false, false, null, null); + } + if (writable == "1" || construct_ == "1") { + prop.set_accessor = new PropertyAccessor (false, (writable == "1"), (construct_ == "1"), null, null); + } end_element ("property"); return prop; }