vala r1741 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1741 - in trunk: . gobject
- Date: Sun, 10 Aug 2008 09:32:24 +0000 (UTC)
Author: juergbi
Date: Sun Aug 10 09:32:24 2008
New Revision: 1741
URL: http://svn.gnome.org/viewvc/vala?rev=1741&view=rev
Log:
2008-08-10 JÃrg Billeter <j bitron ch>
* gobject/valaccodegenerator.vala:
* gobject/valaccodememberaccessbinding.vala:
Fix base access for properties, fixes bug 506075
Modified:
trunk/ChangeLog
trunk/gobject/valaccodegenerator.vala
trunk/gobject/valaccodememberaccessbinding.vala
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Sun Aug 10 09:32:24 2008
@@ -3895,6 +3895,27 @@
}
public CCodeFunctionCall get_property_set_call (Property prop, MemberAccess ma, CCodeExpression cexpr) {
+ if (ma.inner is BaseAccess) {
+ if (prop.base_property != null) {
+ var base_class = (Class) prop.base_property.parent_symbol;
+ var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (base_class.get_upper_case_cname (null))));
+ vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (current_class.get_lower_case_cname (null))));
+
+ var ccall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, "set_%s".printf (prop.name)));
+ ccall.add_argument ((CCodeExpression) ma.inner.ccodenode);
+ ccall.add_argument (cexpr);
+ return ccall;
+ } else if (prop.base_interface_property != null) {
+ var base_iface = (Interface) prop.base_interface_property.parent_symbol;
+ string parent_iface_var = "%s_%s_parent_iface".printf (current_class.get_lower_case_cname (null), base_iface.get_lower_case_cname (null));
+
+ var ccall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (new CCodeIdentifier (parent_iface_var), "set_%s".printf (prop.name)));
+ ccall.add_argument ((CCodeExpression) ma.inner.ccodenode);
+ ccall.add_argument (cexpr);
+ return ccall;
+ }
+ }
+
var set_func = "g_object_set";
var base_property = prop;
Modified: trunk/gobject/valaccodememberaccessbinding.vala
==============================================================================
--- trunk/gobject/valaccodememberaccessbinding.vala (original)
+++ trunk/gobject/valaccodememberaccessbinding.vala Sun Aug 10 09:32:24 2008
@@ -138,6 +138,27 @@
if (prop.get_accessor == null) {
return;
}
+
+ if (expr.inner is BaseAccess) {
+ if (prop.base_property != null) {
+ var base_class = (Class) prop.base_property.parent_symbol;
+ var vcast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (base_class.get_upper_case_cname (null))));
+ vcast.add_argument (new CCodeIdentifier ("%s_parent_class".printf (codegen.current_class.get_lower_case_cname (null))));
+
+ var ccall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, "get_%s".printf (prop.name)));
+ ccall.add_argument ((CCodeExpression) expr.inner.ccodenode);
+ expr.ccodenode = ccall;
+ return;
+ } else if (prop.base_interface_property != null) {
+ var base_iface = (Interface) prop.base_interface_property.parent_symbol;
+ string parent_iface_var = "%s_%s_parent_iface".printf (codegen.current_class.get_lower_case_cname (null), base_iface.get_lower_case_cname (null));
+
+ var ccall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (new CCodeIdentifier (parent_iface_var), "get_%s".printf (prop.name)));
+ ccall.add_argument ((CCodeExpression) expr.inner.ccodenode);
+ expr.ccodenode = ccall;
+ return;
+ }
+ }
if (prop.get_accessor.automatic_body &&
codegen.current_type_symbol == prop.parent_symbol &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]