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 | |
137 foreach (@{$dataNode->parents}) { | 134 foreach (@{$dataNode->parents}) { |
138 if ($ignoreParent) { | 135 if ($ignoreParent) { |
139 # Ignore first parent class, already handled by the generation itsel
f. | 136 # Ignore first parent class, already handled by the generation itsel
f. |
140 $ignoreParent = 0; | 137 $ignoreParent = 0; |
141 next; | 138 next; |
142 } | 139 } |
143 | 140 |
144 my $interface = $object->StripModule($_); | 141 my $interface = $object->StripModule($_); |
145 | 142 |
146 # Step #1: Find the IDL file associated with 'interface' | 143 # Step #1: Find the IDL file associated with 'interface' |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 my $dataNode = shift; | 186 my $dataNode = shift; |
190 | 187 |
191 my @parents = @{$dataNode->parents}; | 188 my @parents = @{$dataNode->parents}; |
192 | 189 |
193 return if @{$dataNode->parents} == 0; | 190 return if @{$dataNode->parents} == 0; |
194 | 191 |
195 my @parentList = (); | 192 my @parentList = (); |
196 | 193 |
197 foreach (@{$dataNode->parents}) { | 194 foreach (@{$dataNode->parents}) { |
198 my $interface = $object->StripModule($_); | 195 my $interface = $object->StripModule($_); |
199 if ($interface eq "EventTargetNode") { | |
200 $interface = "Node"; | |
201 } | |
202 | 196 |
203 # Step #1: Find the IDL file associated with 'interface' | 197 # Step #1: Find the IDL file associated with 'interface' |
204 $endCondition = 0; | 198 $endCondition = 0; |
205 $foundFilename = ""; | 199 $foundFilename = ""; |
206 | 200 |
207 foreach (@{$useDirectories}) { | 201 foreach (@{$useDirectories}) { |
208 $object->ScanDirectory("${interface}.idl", $_, $_, 0) if $foundFilen
ame eq ""; | 202 $object->ScanDirectory("${interface}.idl", $_, $_, 0) if $foundFilen
ame eq ""; |
209 } | 203 } |
210 | 204 |
211 die("Could NOT find specified parent interface \"$interface\"!\n") if $f
oundFilename eq ""; | 205 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... |
384 sub WK_lcfirst | 378 sub WK_lcfirst |
385 { | 379 { |
386 my ($object, $param) = @_; | 380 my ($object, $param) = @_; |
387 my $ret = lcfirst($param); | 381 my $ret = lcfirst($param); |
388 $ret =~ s/uRL/url/ if $ret =~ /^uRL/; | 382 $ret =~ s/uRL/url/ if $ret =~ /^uRL/; |
389 $ret =~ s/jS/js/ if $ret =~ /^jS/; | 383 $ret =~ s/jS/js/ if $ret =~ /^jS/; |
390 return $ret; | 384 return $ret; |
391 } | 385 } |
392 | 386 |
393 1; | 387 1; |
OLD | NEW |