OLD | NEW |
1 # | 1 # |
2 # WebKit IDL parser | 2 # WebKit IDL parser |
3 # | 3 # |
4 # Copyright (C) 2005 Nikolas Zimmermann <wildfox@kde.org> | 4 # Copyright (C) 2005 Nikolas Zimmermann <wildfox@kde.org> |
5 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 5 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
6 # Copyright (C) 2007 Apple Inc. All rights reserved. | 6 # Copyright (C) 2007 Apple Inc. All rights reserved. |
7 # | 7 # |
8 # This library is free software; you can redistribute it and/or | 8 # This library is free software; you can redistribute it and/or |
9 # modify it under the terms of the GNU Library General Public | 9 # modify it under the terms of the GNU Library General Public |
10 # License as published by the Free Software Foundation; either | 10 # License as published by the Free Software Foundation; either |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 my $object = shift; | 124 my $object = shift; |
125 my $dataNode = shift; | 125 my $dataNode = shift; |
126 | 126 |
127 my @parents = @{$dataNode->parents}; | 127 my @parents = @{$dataNode->parents}; |
128 my $parentsMax = @{$dataNode->parents}; | 128 my $parentsMax = @{$dataNode->parents}; |
129 | 129 |
130 my $constantsRef = $dataNode->constants; | 130 my $constantsRef = $dataNode->constants; |
131 my $functionsRef = $dataNode->functions; | 131 my $functionsRef = $dataNode->functions; |
132 my $attributesRef = $dataNode->attributes; | 132 my $attributesRef = $dataNode->attributes; |
133 | 133 |
| 134 # Exception: For the DOM 'Node' is our topmost baseclass, not EventTargetNod
e. |
| 135 return if $parentsMax eq 1 and $parents[0] eq "EventTargetNode"; |
| 136 |
134 foreach (@{$dataNode->parents}) { | 137 foreach (@{$dataNode->parents}) { |
135 if ($ignoreParent) { | 138 if ($ignoreParent) { |
136 # Ignore first parent class, already handled by the generation itsel
f. | 139 # Ignore first parent class, already handled by the generation itsel
f. |
137 $ignoreParent = 0; | 140 $ignoreParent = 0; |
138 next; | 141 next; |
139 } | 142 } |
140 | 143 |
141 my $interface = $object->StripModule($_); | 144 my $interface = $object->StripModule($_); |
142 | 145 |
143 # Step #1: Find the IDL file associated with 'interface' | 146 # Step #1: Find the IDL file associated with 'interface' |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 my $dataNode = shift; | 189 my $dataNode = shift; |
187 | 190 |
188 my @parents = @{$dataNode->parents}; | 191 my @parents = @{$dataNode->parents}; |
189 | 192 |
190 return if @{$dataNode->parents} == 0; | 193 return if @{$dataNode->parents} == 0; |
191 | 194 |
192 my @parentList = (); | 195 my @parentList = (); |
193 | 196 |
194 foreach (@{$dataNode->parents}) { | 197 foreach (@{$dataNode->parents}) { |
195 my $interface = $object->StripModule($_); | 198 my $interface = $object->StripModule($_); |
| 199 if ($interface eq "EventTargetNode") { |
| 200 $interface = "Node"; |
| 201 } |
196 | 202 |
197 # Step #1: Find the IDL file associated with 'interface' | 203 # Step #1: Find the IDL file associated with 'interface' |
198 $endCondition = 0; | 204 $endCondition = 0; |
199 $foundFilename = ""; | 205 $foundFilename = ""; |
200 | 206 |
201 foreach (@{$useDirectories}) { | 207 foreach (@{$useDirectories}) { |
202 $object->ScanDirectory("${interface}.idl", $_, $_, 0) if $foundFilen
ame eq ""; | 208 $object->ScanDirectory("${interface}.idl", $_, $_, 0) if $foundFilen
ame eq ""; |
203 } | 209 } |
204 | 210 |
205 die("Could NOT find specified parent interface \"$interface\"!\n") if $f
oundFilename eq ""; | 211 die("Could NOT find specified parent interface \"$interface\"!\n") if $f
oundFilename eq ""; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 sub WK_lcfirst | 384 sub WK_lcfirst |
379 { | 385 { |
380 my ($object, $param) = @_; | 386 my ($object, $param) = @_; |
381 my $ret = lcfirst($param); | 387 my $ret = lcfirst($param); |
382 $ret =~ s/uRL/url/ if $ret =~ /^uRL/; | 388 $ret =~ s/uRL/url/ if $ret =~ /^uRL/; |
383 $ret =~ s/jS/js/ if $ret =~ /^jS/; | 389 $ret =~ s/jS/js/ if $ret =~ /^jS/; |
384 return $ret; | 390 return $ret; |
385 } | 391 } |
386 | 392 |
387 1; | 393 1; |
OLD | NEW |