OLD | NEW |
1 | 1 |
2 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> | 3 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> |
4 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 4 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
5 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> | 5 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> |
6 # Copyright (C) 2006 Apple Computer, Inc. | 6 # Copyright (C) 2006 Apple Computer, Inc. |
7 # Copyright (C) 2007 Google Inc. | 7 # Copyright (C) 2007 Google Inc. |
8 # | 8 # |
9 # This file is part of the KDE project | 9 # This file is part of the KDE project |
10 # | 10 # |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 my $conditional = $dataNode->extendedAttributes->{"Conditional"}; | 255 my $conditional = $dataNode->extendedAttributes->{"Conditional"}; |
256 | 256 |
257 # - Add default header template | 257 # - Add default header template |
258 @headerContent = split("\r", $headerTemplate); | 258 @headerContent = split("\r", $headerTemplate); |
259 | 259 |
260 # - Add header protection | 260 # - Add header protection |
261 if ($className =~ /^V8SVG/) { | 261 if ($className =~ /^V8SVG/) { |
262 push(@headerContent, "\n#if ENABLE(SVG)\n"); | 262 push(@headerContent, "\n#if ENABLE(SVG)\n"); |
263 } elsif (IsVideoClassName($className)) { | 263 } elsif (IsVideoClassName($className)) { |
264 push(@headerContent, "\n#if ENABLE(VIDEO)\n"); | 264 push(@headerContent, "\n#if ENABLE(VIDEO)\n"); |
| 265 } elsif (IsWorkerClassName($className)) { |
| 266 push(@headerContent, "\n#if ENABLE(WORKERS)\n"); |
265 } | 267 } |
266 | 268 |
267 push(@headerContent, "\n#ifndef $className" . "_H"); | 269 push(@headerContent, "\n#ifndef $className" . "_H"); |
268 push(@headerContent, "\n#define $className" . "_H\n\n"); | 270 push(@headerContent, "\n#define $className" . "_H\n\n"); |
269 | 271 |
270 # Get correct pass/store types respecting PODType flag | 272 # Get correct pass/store types respecting PODType flag |
271 my $podType = $dataNode->extendedAttributes->{"PODType"}; | 273 my $podType = $dataNode->extendedAttributes->{"PODType"}; |
272 my $passType = $podType ? "JSSVGPODTypeWrapper<$podType>*" : "$implClassName
*"; | 274 my $passType = $podType ? "JSSVGPODTypeWrapper<$podType>*" : "$implClassName
*"; |
273 | 275 |
274 push(@headerContent, "#include \"$podType.h\"\n") if $podType and ($podType
ne "double" and $podType ne "float" and $podType ne "RGBA32"); | 276 push(@headerContent, "#include \"$podType.h\"\n") if $podType and ($podType
ne "double" and $podType ne "float" and $podType ne "RGBA32"); |
(...skipping 28 matching lines...) Expand all Loading... |
303 | 305 |
304 END | 306 END |
305 | 307 |
306 push(@headerContent, "}\n\n"); | 308 push(@headerContent, "}\n\n"); |
307 push(@headerContent, "#endif // $className" . "_H\n"); | 309 push(@headerContent, "#endif // $className" . "_H\n"); |
308 | 310 |
309 if ($className =~ /^V8SVG/) { | 311 if ($className =~ /^V8SVG/) { |
310 push(@headerContent, "\n#endif // ENABLE(SVG)\n"); | 312 push(@headerContent, "\n#endif // ENABLE(SVG)\n"); |
311 } elsif (IsVideoClassName($className)) { | 313 } elsif (IsVideoClassName($className)) { |
312 push(@headerContent, "\n#endif // ENABLE(VIDEO)\n"); | 314 push(@headerContent, "\n#endif // ENABLE(VIDEO)\n"); |
| 315 } elsif (IsWorkerClassName($className)) { |
| 316 push(@headerContent, "\n#endif // ENABLE(WORKERS)\n"); |
313 } | 317 } |
314 } | 318 } |
315 | 319 |
316 | 320 |
317 sub GenerateSetDOMException | 321 sub GenerateSetDOMException |
318 { | 322 { |
319 my $indent = shift; | 323 my $indent = shift; |
320 my $result = ""; | 324 my $result = ""; |
321 | 325 |
322 $result .= $indent . "if (ec) {\n"; | 326 $result .= $indent . "if (ec) {\n"; |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 push(@implFixedHeader, | 997 push(@implFixedHeader, |
994 "#include \"config.h\"\n" . | 998 "#include \"config.h\"\n" . |
995 "#include \"v8_proxy.h\"\n" . | 999 "#include \"v8_proxy.h\"\n" . |
996 "#include \"v8_binding.h\"\n\n" . | 1000 "#include \"v8_binding.h\"\n\n" . |
997 "#undef LOG\n\n"); | 1001 "#undef LOG\n\n"); |
998 | 1002 |
999 if ($className =~ /^V8SVG/) { | 1003 if ($className =~ /^V8SVG/) { |
1000 push(@implFixedHeader, "#if ENABLE(SVG)\n\n"); | 1004 push(@implFixedHeader, "#if ENABLE(SVG)\n\n"); |
1001 } elsif (IsVideoClassName($className)) { | 1005 } elsif (IsVideoClassName($className)) { |
1002 push(@implFixedHeader, "#if ENABLE(VIDEO)\n\n"); | 1006 push(@implFixedHeader, "#if ENABLE(VIDEO)\n\n"); |
| 1007 } elsif (IsWorkerClassName($className)) { |
| 1008 push(@implFixedHeader, "#if ENABLE(WORKERS)\n\n"); |
1003 } | 1009 } |
1004 | 1010 |
1005 if ($className =~ /^V8SVGAnimated/) { | 1011 if ($className =~ /^V8SVGAnimated/) { |
1006 AddIncludesForSVGAnimatedType($interfaceName); | 1012 AddIncludesForSVGAnimatedType($interfaceName); |
1007 } | 1013 } |
1008 | 1014 |
1009 $implIncludes{"${className}.h"} = 1; | 1015 $implIncludes{"${className}.h"} = 1; |
1010 | 1016 |
1011 AddIncludesForType($interfaceName); | 1017 AddIncludesForType($interfaceName); |
1012 $implIncludes{"v8_proxy.h"} = 1; | 1018 $implIncludes{"v8_proxy.h"} = 1; |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 } | 1322 } |
1317 | 1323 |
1318 push(@implContent, <<END); | 1324 push(@implContent, <<END); |
1319 } // namespace WebCore | 1325 } // namespace WebCore |
1320 END | 1326 END |
1321 | 1327 |
1322 if ($className =~ /^V8SVG/) { | 1328 if ($className =~ /^V8SVG/) { |
1323 push(@implContent, "\n#endif // ENABLE(SVG)\n"); | 1329 push(@implContent, "\n#endif // ENABLE(SVG)\n"); |
1324 } elsif (IsVideoClassName($className)) { | 1330 } elsif (IsVideoClassName($className)) { |
1325 push(@implContent, "\n#endif // ENABLE(VIDEO)\n"); | 1331 push(@implContent, "\n#endif // ENABLE(VIDEO)\n"); |
| 1332 } elsif (IsWorkerClassName($className)) { |
| 1333 push(@implContent, "\n#endif // ENABLE(WORKERS)\n"); |
1326 } | 1334 } |
1327 } | 1335 } |
1328 | 1336 |
1329 | 1337 |
1330 sub GenerateFunctionCallString() | 1338 sub GenerateFunctionCallString() |
1331 { | 1339 { |
1332 my $function = shift; | 1340 my $function = shift; |
1333 my $numberOfParameters = shift; | 1341 my $numberOfParameters = shift; |
1334 my $indent = shift; | 1342 my $indent = shift; |
1335 my $implClassName = shift; | 1343 my $implClassName = shift; |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1588 return 1 if $class eq "V8HTMLAudioElement"; | 1596 return 1 if $class eq "V8HTMLAudioElement"; |
1589 return 1 if $class eq "V8HTMLMediaElement"; | 1597 return 1 if $class eq "V8HTMLMediaElement"; |
1590 return 1 if $class eq "V8HTMLSourceElement"; | 1598 return 1 if $class eq "V8HTMLSourceElement"; |
1591 return 1 if $class eq "V8HTMLVideoElement"; | 1599 return 1 if $class eq "V8HTMLVideoElement"; |
1592 return 1 if $class eq "V8MediaError"; | 1600 return 1 if $class eq "V8MediaError"; |
1593 return 1 if $class eq "V8TimeRanges"; | 1601 return 1 if $class eq "V8TimeRanges"; |
1594 | 1602 |
1595 return 0; | 1603 return 0; |
1596 } | 1604 } |
1597 | 1605 |
| 1606 sub IsWorkerClassName |
| 1607 { |
| 1608 my $class = shift; |
| 1609 return 1 if $class eq "V8Worker"; |
| 1610 return 1 if $class eq "V8WorkerLocation"; |
| 1611 |
| 1612 return 0; |
| 1613 } |
| 1614 |
1598 sub GetNativeType | 1615 sub GetNativeType |
1599 { | 1616 { |
1600 my $type = shift; | 1617 my $type = shift; |
1601 my $isParameter = shift; | 1618 my $isParameter = shift; |
1602 | 1619 |
1603 if ($type eq "float" or $type eq "AtomicString" or $type eq "double") { | 1620 if ($type eq "float" or $type eq "AtomicString" or $type eq "double") { |
1604 return $type | 1621 return $type |
1605 } | 1622 } |
1606 | 1623 |
1607 return "int" if $type eq "short" or $type eq "unsigned short"; | 1624 return "int" if $type eq "short" or $type eq "unsigned short"; |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2086 return 0; | 2103 return 0; |
2087 } | 2104 } |
2088 | 2105 |
2089 sub DebugPrint | 2106 sub DebugPrint |
2090 { | 2107 { |
2091 my $output = shift; | 2108 my $output = shift; |
2092 | 2109 |
2093 print $output; | 2110 print $output; |
2094 print "\n"; | 2111 print "\n"; |
2095 } | 2112 } |
OLD | NEW |