|
|
|
@ -232,7 +232,11 @@ sub render_global_class {
|
|
|
|
|
render_struct_fields($type);
|
|
|
|
|
|
|
|
|
|
my $vms = $type->findnodes('child::virtual-methods')->[0];
|
|
|
|
|
render_class_vmethods($vms) if $vms;
|
|
|
|
|
if ($vms)
|
|
|
|
|
{
|
|
|
|
|
my $voff = render_class_vmethods_voff($parent);
|
|
|
|
|
render_class_vmethods($vms, $voff);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
push @lines_rb, "end\n";
|
|
|
|
|
}
|
|
|
|
@ -275,7 +279,6 @@ sub render_struct_field_refs {
|
|
|
|
|
my ($parent, $field, $name) = @_;
|
|
|
|
|
|
|
|
|
|
my $reftg = $field->getAttribute('ref-target');
|
|
|
|
|
render_field_reftarget($parent, $field, $name, $reftg) if ($reftg);
|
|
|
|
|
|
|
|
|
|
my $refto = $field->getAttribute('refers-to');
|
|
|
|
|
render_field_refto($parent, $name, $refto) if ($refto);
|
|
|
|
@ -285,6 +288,8 @@ sub render_struct_field_refs {
|
|
|
|
|
if ($meta and $meta eq 'container' and $item) {
|
|
|
|
|
my $itemreftg = $item->getAttribute('ref-target');
|
|
|
|
|
render_container_reftarget($parent, $item, $name, $itemreftg) if $itemreftg;
|
|
|
|
|
} elsif ($reftg) {
|
|
|
|
|
render_field_reftarget($parent, $field, $name, $reftg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -368,9 +373,29 @@ sub render_container_reftarget {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# return the size of the parent's vtables
|
|
|
|
|
sub render_class_vmethods_voff {
|
|
|
|
|
my ($name) = @_;
|
|
|
|
|
|
|
|
|
|
return 0 if !$name;
|
|
|
|
|
|
|
|
|
|
my $type = $global_types{$name};
|
|
|
|
|
my $parent = $type->getAttribute('inherits-from');
|
|
|
|
|
|
|
|
|
|
my $voff = render_class_vmethods_voff($parent);
|
|
|
|
|
my $vms = $type->findnodes('child::virtual-methods')->[0];
|
|
|
|
|
|
|
|
|
|
for my $meth ($vms->findnodes('child::vmethod'))
|
|
|
|
|
{
|
|
|
|
|
$voff += 4 if $meth->getAttribute('is-destructor') and $os eq 'linux';
|
|
|
|
|
$voff += 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $voff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sub render_class_vmethods {
|
|
|
|
|
my ($vms) = @_;
|
|
|
|
|
my $voff = 0;
|
|
|
|
|
my ($vms, $voff) = @_;
|
|
|
|
|
|
|
|
|
|
for my $meth ($vms->findnodes('child::vmethod'))
|
|
|
|
|
{
|
|
|
|
|