This is used by plain GTypeInstance classes as well.
CCodeExpression klass;
if (get_this_type () != null) {
- var k = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_GET_CLASS"));
+ var k = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_type_get_function ((Class) parent)));
k.add_argument (new CCodeIdentifier ("self"));
klass = k;
} else {
klass = new CCodeIdentifier ("klass");
} else {
// Accessing the field from within an instance method
- var k = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_GET_CLASS"));
+ var k = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_type_get_function (cl)));
k.add_argument (new CCodeIdentifier ("self"));
klass = k;
}
} else {
// Accessing the field of an instance
- var k = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_GET_CLASS"));
+ var k = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_type_get_function (cl)));
k.add_argument (get_cvalue_ (instance));
klass = k;
}
klass = new CCodeIdentifier ("klass");
} else {
// Accessing the method from within an instance method
- var k = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_GET_CLASS"));
+ var k = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_type_get_function (cl)));
k.add_argument (get_this_cexpression ());
klass = k;
}
} else {
// Accessing the method of an instance
- var k = new CCodeFunctionCall (new CCodeIdentifier ("G_OBJECT_GET_CLASS"));
+ var k = new CCodeFunctionCall (new CCodeIdentifier (get_ccode_type_get_function (cl)));
k.add_argument (get_cvalue (ma.inner));
klass = k;
}