2007-04-03 Jürg Billeter <j@bitron.ch>
+ * vala/valasymbolbuilder.vala, vala/valacodegenerator.vala: some fixes
+ for abstract properties
+ * vala/valamethod.vala: improve default cname
+
+2007-04-03 Jürg Billeter <j@bitron.ch>
+
* vapi/glib-2.0.vala: extend unicode support, add GRegex
2007-03-28 Raffaele Sandrini <rasa@gmx.ch>
/* create properties */
var props = cl.get_properties ();
foreach (Property prop in props) {
- if (prop.base_property != null || prop.base_interface_property != null) {
+ if (prop.overrides || prop.base_interface_property != null) {
var cinst = new CCodeFunctionCall (new CCodeIdentifier ("g_object_class_override_property"));
cinst.add_argument (ccall);
cinst.add_argument (new CCodeConstant (prop.get_upper_case_cname ()));
var cswitch = new CCodeSwitchStatement (new CCodeIdentifier ("property_id"));
var props = cl.get_properties ();
foreach (Property prop in props) {
- if (prop.get_accessor == null) {
+ if (prop.get_accessor == null || prop.is_abstract) {
continue;
}
var cswitch = new CCodeSwitchStatement (new CCodeIdentifier ("property_id"));
var props = cl.get_properties ();
foreach (Property prop in props) {
- if (prop.set_accessor == null) {
+ if (prop.set_accessor == null || prop.is_abstract) {
continue;
}
}
public override void visit_end_property (Property! prop) {
- if (!prop.is_abstract) {
- prop_enum.add_value (prop.get_upper_case_cname (), null);
- }
+ prop_enum.add_value (prop.get_upper_case_cname (), null);
}
public override void visit_begin_property_accessor (PropertyAccessor! acc) {
public virtual ref string! get_default_cname () {
var parent = symbol.parent_symbol.node;
if (parent is DataType) {
- return "%s%s".printf (((DataType) parent).get_lower_case_cprefix (), name);
+ if (name.has_prefix ("_")) {
+ return "_%s%s".printf (((DataType) parent).get_lower_case_cprefix (), name.offset (1));
+ } else {
+ return "%s%s".printf (((DataType) parent).get_lower_case_cprefix (), name);
+ }
} else if (parent is Namespace) {
return "%s%s".printf (((Namespace) parent).get_lower_case_cprefix (), name);
} else {