gstreamer/parser/gst-gapi2xml.pl.diff

109 lines
3.4 KiB
Diff
Raw Normal View History

--- tmp/parser/gapi2xml.pl 2009-04-13 19:44:48.000000000 +0200
+++ gapi2xml.pl 2009-06-05 21:03:21.000000000 +0200
@@ -32,6 +32,9 @@
}
$ns = $ARGV[0];
+$ns_main = $ns;
+$ns_main =~ s/\..*//g;
+
$libname = $ARGV[2];
# Used by name mangling sub
@@ -231,7 +234,7 @@
$def = $edefs{$cname};
$cname = $etypes{$cname} if (exists($etypes{$cname}));
$enums{lc($cname)} = $cname;
- $enum_elem = addNameElem($ns_elem, 'enum', $cname, $ns);
+ $enum_elem = addNameElem($ns_elem, 'enum', $cname, $ns_main);
if ($def =~ /^deprecated/) {
$enum_elem->setAttribute("deprecated", "1");
$def =~ s/deprecated//g;
@@ -296,7 +299,7 @@
next if ($cbname =~ /^_/);
$cbcnt++;
$fdef = $cb = $fpdefs{$cbname};
- $cb_elem = addNameElem($ns_elem, 'callback', $cbname, $ns);
+ $cb_elem = addNameElem($ns_elem, 'callback', $cbname, $ns_main);
$cb =~ /typedef\s+(.*)\(.*\).*\((.*)\);/;
$ret = $1; $params = $2;
addReturnElem($cb_elem, $ret);
@@ -318,7 +321,7 @@
delete $types{$inst};
$ifacecnt++;
- $iface_el = addNameElem($ns_elem, 'interface', $inst, $ns);
+ $iface_el = addNameElem($ns_elem, 'interface', $inst, $ns_main);
$elem_table{lc($inst)} = $iface_el;
@@ -355,7 +358,7 @@
warn "Strange Class $inst\n" if (!$instdef && $debug);
$classcnt++;
- $obj_el = addNameElem($ns_elem, 'object', $inst, $ns);
+ $obj_el = addNameElem($ns_elem, 'object', $inst, $ns_main);
$elem_table{lc($inst)} = $obj_el;
@@ -424,7 +427,7 @@
} elsif ($types{$type} =~ /struct/ && $type =~ /^$ns/) {
$def = $types{$type};
} else {
- $elem = addNameElem($ns_elem, 'alias', $key, $ns);
+ $elem = addNameElem($ns_elem, 'alias', $key, $ns_main);
$elem->setAttribute('type', $lasttype);
warn "alias $key to $lasttype\n" if $debug;
next;
@@ -432,11 +435,11 @@
# fixme: hack
if ($key eq "GdkBitmap") {
- $struct_el = addNameElem($ns_elem, 'object', $key, $ns);
+ $struct_el = addNameElem($ns_elem, 'object', $key, $ns_main);
} elsif (exists($boxdefs{$key})) {
- $struct_el = addNameElem($ns_elem, 'boxed', $key, $ns);
+ $struct_el = addNameElem($ns_elem, 'boxed', $key, $ns_main);
} else {
- $struct_el = addNameElem($ns_elem, 'struct', $key, $ns);
+ $struct_el = addNameElem($ns_elem, 'struct', $key, $ns_main);
}
if ($def =~ /^deprecated/) {
@@ -459,7 +462,7 @@
foreach $key (sort (keys (%ptrs))) {
next if $ptrs{$key} !~ /struct\s+(\w+)/;
$type = $1;
- $struct_el = addNameElem ($ns_elem, 'struct', $key, $ns);
+ $struct_el = addNameElem ($ns_elem, 'struct', $key, $ns_main);
$struct_el->setAttribute('opaque', 'true');
$elem_table{lc($key)} = $struct_el;
}
@@ -761,6 +764,8 @@
$ns_prefix = "";
$global_el = "";
+ $ns_clean = lc($ns);
+ $ns_clean =~ s/\.//g;
for ($i = 0; $i < $mcount; $i++) {
$mname = $mnames[$i];
@@ -770,7 +775,7 @@
if ($ns_prefix eq "") {
my (@toks) = split(/_/, $prefix);
for ($j = 0; $j < @toks; $j++) {
- if (join ("", @toks[0 .. $j]) eq lc($ns)) {
+ if (join ("", @toks[0 .. $j]) eq $ns_clean) {
$ns_prefix = join ("_", @toks[0 .. $j]);
last;
}
@@ -885,7 +890,7 @@
if ($parm =~ /(.*)\(\s*\**\s*(\w+)\)\s+\((.*)\)/) {
my $ret = $1; my $cbn = $2; my $params = $3;
my $type = $parent->getAttribute('name') . StudlyCaps($cbn);
- $cb_elem = addNameElem($ns_elem, 'callback', $type, $ns);
+ $cb_elem = addNameElem($ns_elem, 'callback', $type, $ns_main);
addReturnElem($cb_elem, $ret);
if ($params && ($params ne "void")) {
addParamsElem($cb_elem, split(/,/, $params));