~ubuntu-branches/ubuntu/quantal/vala/quantal

« back to all changes in this revision

Viewing changes to codegen/valagobjectmodule.vala

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-02-15 11:44:25 UTC
  • mfrom: (1.5.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20110215114425-8vtvfqmnely5x8tt
Tags: 0.11.6-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
202
202
                                continue;
203
203
                        }
204
204
 
205
 
                        string prefix = cl.get_lower_case_cname (null);
 
205
                        Property base_prop = prop;
206
206
                        CCodeExpression cself = new CCodeIdentifier ("self");
207
207
                        if (prop.base_property != null) {
208
208
                                var base_type = (Class) prop.base_property.parent_symbol;
209
 
                                prefix = base_type.get_lower_case_cname (null);
 
209
                                base_prop = prop.base_property;
210
210
                                cself = transform_expression (cself, new ObjectType (cl), new ObjectType (base_type));
211
211
 
212
212
                                generate_property_accessor_declaration (prop.base_property.get_accessor, cfile);
213
213
                        } else if (prop.base_interface_property != null) {
214
214
                                var base_type = (Interface) prop.base_interface_property.parent_symbol;
215
 
                                prefix = base_type.get_lower_case_cname (null);
 
215
                                base_prop = prop.base_interface_property;
216
216
                                cself = transform_expression (cself, new ObjectType (cl), new ObjectType (base_type));
217
217
 
218
218
                                generate_property_accessor_declaration (prop.base_interface_property.get_accessor, cfile);
227
227
                                cdecl.add_declarator (new CCodeVariableDeclarator (boxed));
228
228
                                block.add_statement (cdecl);
229
229
 
230
 
                                ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_get_%s".printf (prefix, prop.name)));
 
230
                                ccall = new CCodeFunctionCall (new CCodeIdentifier (base_prop.get_accessor.get_cname ()));
231
231
                                ccall.add_argument (cself);
232
232
                                var boxed_addr = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (boxed));
233
233
                                ccall.add_argument (boxed_addr);
243
243
                                        cswitch.add_statement (new CCodeExpressionStatement (get_unref_expression (new CCodeIdentifier (boxed), prop.get_accessor.value_type, null)));
244
244
                                }
245
245
                        } else {
246
 
                                ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_get_%s".printf (prefix, prop.name)));
 
246
                                ccall = new CCodeFunctionCall (new CCodeIdentifier (base_prop.get_accessor.get_cname ()));
247
247
                                ccall.add_argument (cself);
248
248
                                var array_type = prop.property_type as ArrayType;
249
249
                                if (array_type != null && array_type.element_type.data_type == string_type.data_type) {
308
308
                                continue;
309
309
                        }
310
310
 
311
 
                        string prefix = cl.get_lower_case_cname (null);
 
311
                        Property base_prop = prop;
312
312
                        CCodeExpression cself = new CCodeIdentifier ("self");
313
313
                        if (prop.base_property != null) {
314
314
                                var base_type = (Class) prop.base_property.parent_symbol;
315
 
                                prefix = base_type.get_lower_case_cname (null);
 
315
                                base_prop = prop.base_property;
316
316
                                cself = transform_expression (cself, new ObjectType (cl), new ObjectType (base_type));
317
317
 
318
318
                                generate_property_accessor_declaration (prop.base_property.set_accessor, cfile);
319
319
                        } else if (prop.base_interface_property != null) {
320
320
                                var base_type = (Interface) prop.base_interface_property.parent_symbol;
321
 
                                prefix = base_type.get_lower_case_cname (null);
 
321
                                base_prop = prop.base_interface_property;
322
322
                                cself = transform_expression (cself, new ObjectType (cl), new ObjectType (base_type));
323
323
 
324
324
                                generate_property_accessor_declaration (prop.base_interface_property.set_accessor, cfile);
325
325
                        }
326
326
 
327
327
                        cswitch.add_statement (new CCodeCaseStatement (new CCodeIdentifier (prop.get_upper_case_cname ())));
328
 
                        ccall = new CCodeFunctionCall (new CCodeIdentifier ("%s_set_%s".printf (prefix, prop.name)));
 
328
                        ccall = new CCodeFunctionCall (new CCodeIdentifier (base_prop.set_accessor.get_cname ()));
329
329
                        ccall.add_argument (cself);
330
330
                        if (prop.property_type is ArrayType && ((ArrayType)prop.property_type).element_type.data_type == string_type.data_type) {
331
331
                                if (!boxed_declared) {