OLD | NEW |
1 #!/usr/bin/perl -w | 1 #!/usr/bin/perl -w |
2 | 2 |
3 # Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. | 3 # Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. |
4 # Copyright (C) 2009, Julien Chaffraix <jchaffraix@webkit.org> | 4 # Copyright (C) 2009, Julien Chaffraix <jchaffraix@webkit.org> |
5 # Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmob
ile.com/) | 5 # Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmob
ile.com/) |
6 # Copyright (C) 2011 Ericsson AB. All rights reserved. | 6 # Copyright (C) 2011 Ericsson AB. All rights reserved. |
7 # | 7 # |
8 # Redistribution and use in source and binary forms, with or without | 8 # Redistribution and use in source and binary forms, with or without |
9 # modification, are permitted provided that the following conditions | 9 # modification, are permitted provided that the following conditions |
10 # are met: | 10 # are met: |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 my $F; | 614 my $F; |
615 open F, ">$cppPath"; | 615 open F, ">$cppPath"; |
616 | 616 |
617 printLicenseHeader($F); | 617 printLicenseHeader($F); |
618 printCppHead($F, "DOM", $parameters{namespace}, "WebCore"); | 618 printCppHead($F, "DOM", $parameters{namespace}, "WebCore"); |
619 | 619 |
620 my $lowerNamespace = lc($parameters{namespacePrefix}); | 620 my $lowerNamespace = lc($parameters{namespacePrefix}); |
621 | 621 |
622 print F "DEFINE_GLOBAL(AtomicString, ${lowerNamespace}NamespaceURI)\n\n"; | 622 print F "DEFINE_GLOBAL(AtomicString, ${lowerNamespace}NamespaceURI)\n\n"; |
623 | 623 |
624 print F StaticString::GenerateStrings(\%allStrings); | 624 print F StaticString::GenerateStringDecls(\%allStrings); |
625 | 625 |
626 if (keys %allTags) { | 626 if (keys %allTags) { |
627 print F "// Tags\n"; | 627 print F "// Tags\n"; |
628 for my $name (sort keys %allTags) { | 628 for my $name (sort keys %allTags) { |
629 print F "DEFINE_GLOBAL(QualifiedName, ", $name, "Tag)\n"; | 629 print F "DEFINE_GLOBAL(QualifiedName, ", $name, "Tag)\n"; |
630 } | 630 } |
631 | 631 |
632 print F "\n\nWebCore::QualifiedName** get$parameters{namespace}Tags()\n"
; | 632 print F "\n\nWebCore::QualifiedName** get$parameters{namespace}Tags()\n"
; |
633 print F "{\n static WebCore::QualifiedName* $parameters{namespace}Tag
s[] = {\n"; | 633 print F "{\n static WebCore::QualifiedName* $parameters{namespace}Tag
s[] = {\n"; |
634 for my $name (sort keys %allTags) { | 634 for my $name (sort keys %allTags) { |
(...skipping 19 matching lines...) Expand all Loading... |
654 print F "}\n"; | 654 print F "}\n"; |
655 } | 655 } |
656 | 656 |
657 printInit($F, 0); | 657 printInit($F, 0); |
658 | 658 |
659 print(F " AtomicString ${lowerNamespace}NS(\"$parameters{namespaceURI}\",
AtomicString::ConstructFromLiteral);\n\n"); | 659 print(F " AtomicString ${lowerNamespace}NS(\"$parameters{namespaceURI}\",
AtomicString::ConstructFromLiteral);\n\n"); |
660 | 660 |
661 print(F " // Namespace\n"); | 661 print(F " // Namespace\n"); |
662 print(F " new ((void*)&${lowerNamespace}NamespaceURI) AtomicString(${lowe
rNamespace}NS);\n"); | 662 print(F " new ((void*)&${lowerNamespace}NamespaceURI) AtomicString(${lowe
rNamespace}NS);\n"); |
663 print(F "\n"); | 663 print(F "\n"); |
664 print F StaticString::GenerateStringAsserts(\%allStrings); | 664 print F StaticString::GenerateStringImpls(\%allStrings); |
665 | 665 |
666 if (keys %allTags) { | 666 if (keys %allTags) { |
667 my $tagsNamespace = $parameters{tagsNullNamespace} ? "nullAtom" : "${low
erNamespace}NS"; | 667 my $tagsNamespace = $parameters{tagsNullNamespace} ? "nullAtom" : "${low
erNamespace}NS"; |
668 printDefinitions($F, \%allTags, "tags", $tagsNamespace); | 668 printDefinitions($F, \%allTags, "tags", $tagsNamespace); |
669 } | 669 } |
670 if (keys %allAttrs) { | 670 if (keys %allAttrs) { |
671 my $attrsNamespace = $parameters{attrsNullNamespace} ? "nullAtom" : "${l
owerNamespace}NS"; | 671 my $attrsNamespace = $parameters{attrsNullNamespace} ? "nullAtom" : "${l
owerNamespace}NS"; |
672 printDefinitions($F, \%allAttrs, "attributes", $attrsNamespace); | 672 printDefinitions($F, \%allAttrs, "attributes", $attrsNamespace); |
673 } | 673 } |
674 | 674 |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 | 1258 |
1259 printInit($F, 1); | 1259 printInit($F, 1); |
1260 close F; | 1260 close F; |
1261 | 1261 |
1262 my $source = File::Spec->catfile($outputDir, "${baseName}Names.cpp"); | 1262 my $source = File::Spec->catfile($outputDir, "${baseName}Names.cpp"); |
1263 open F, ">$source" or die "Unable to open $source for writing."; | 1263 open F, ">$source" or die "Unable to open $source for writing."; |
1264 | 1264 |
1265 printLicenseHeader($F); | 1265 printLicenseHeader($F); |
1266 printCppHead($F, $basePrefix, $baseName, "WTF"); | 1266 printCppHead($F, $basePrefix, $baseName, "WTF"); |
1267 | 1267 |
1268 print F StaticString::GenerateStrings(\%parameters); | 1268 print F StaticString::GenerateStringDecls(\%parameters); |
1269 | 1269 |
1270 while ( my ($name, $identifier) = each %parameters ) { | 1270 while ( my ($name, $identifier) = each %parameters ) { |
1271 print F "DEFINE_GLOBAL(AtomicString, $name)\n"; | 1271 print F "DEFINE_GLOBAL(AtomicString, $name)\n"; |
1272 } | 1272 } |
1273 | 1273 |
1274 printInit($F, 0); | 1274 printInit($F, 0); |
1275 | 1275 |
1276 print F "\n"; | 1276 print F "\n"; |
1277 print F StaticString::GenerateStringAsserts(\%parameters); | 1277 print F StaticString::GenerateStringImpls(\%parameters); |
1278 | 1278 |
1279 while ( my ($name, $identifier) = each %parameters ) { | 1279 while ( my ($name, $identifier) = each %parameters ) { |
1280 print F " new ((void*)&$name) AtomicString(${name}Impl);\n"; | 1280 print F " new ((void*)&$name) AtomicString(${name}Impl);\n"; |
1281 } | 1281 } |
1282 | 1282 |
1283 print F "}\n}\n}\n"; | 1283 print F "}\n}\n}\n"; |
1284 close F; | 1284 close F; |
1285 exit 0; | 1285 exit 0; |
1286 } | 1286 } |
1287 | |
OLD | NEW |