2006-09-02 Jürg Billeter <j@bitron.ch>
+ * vala/parser.y: set accessibility for constants
+ * vala/valasemanticanalyzer.vala: set return type in property set
+ accessors to void
+ * vala/valacodegenerator.vala: move public constants to header file
+ * vala/valaclass.vala: don't create fields for properties in VAPI files
+ * vala/valaconstant.vala: add access member
+
+2006-09-02 Jürg Billeter <j@bitron.ch>
+
* vapi/cairo.vala: mark Matrix as reference type
2006-08-24 Jürg Billeter <j@bitron.ch>
g_object_unref (src);
g_object_unref ($5);
g_object_unref ($6);
+ if ($3 != 0) {
+ $$->access = $3;
+ }
}
;
public void add_property (Property! prop) {
properties.append (prop);
- if (prop.set_accessor != null && prop.set_accessor.body == null) {
+ if (prop.set_accessor != null && prop.set_accessor.body == null &&
+ source_reference != null && !source_reference.file.pkg) {
/* automatic property accessor body generation */
var f = new Field ("_%s".printf (prop.name), prop.type_reference, null, prop.source_reference);
f.access = MemberAccessibility.PRIVATE;
}
cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("%s%s".printf (c.get_cname (), arr), (CCodeExpression) c.initializer.ccodenode));
cdecl.modifiers = CCodeModifiers.STATIC;
- source_type_member_declaration.append (cdecl);
+
+ if (c.access == MemberAccessibility.PUBLIC) {
+ header_type_member_declaration.append (cdecl);
+ } else {
+ source_type_member_declaration.append (cdecl);
+ }
}
}
*/
public Expression initializer { get; set; }
+ /**
+ * Specifies the accessibility of this constant. Public accessibility
+ * doesn't limit access. Default accessibility limits access to this
+ * program or library. Private accessibility limits access to instances
+ * of the contained type.
+ */
+ public MemberAccessibility access;
+
private string cname;
/**
if (acc.readable) {
current_return_type = prop.type_reference;
+ } else {
+ // void
+ current_return_type = new TypeReference ();
}
}