OLD | NEW |
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> | 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> |
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> | 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> |
5 # Copyright (C) 2006 Apple Computer, Inc. | 5 # Copyright (C) 2006 Apple Computer, Inc. |
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. | 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. |
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. | 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. |
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. | 10 # Copyright (C) 2012 Ericsson AB. All rights reserved. |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 AddToHeaderIncludes("v8.h"); | 658 AddToHeaderIncludes("v8.h"); |
659 AddToHeaderIncludes("wtf/HashMap.h"); | 659 AddToHeaderIncludes("wtf/HashMap.h"); |
660 AddToHeaderIncludes("wtf/text/StringHash.h"); | 660 AddToHeaderIncludes("wtf/text/StringHash.h"); |
661 | 661 |
662 my $headerClassInclude = GetHeaderClassInclude($interfaceName); | 662 my $headerClassInclude = GetHeaderClassInclude($interfaceName); |
663 AddToHeaderIncludes($headerClassInclude) if $headerClassInclude; | 663 AddToHeaderIncludes($headerClassInclude) if $headerClassInclude; |
664 | 664 |
665 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGProperty
Types($interfaceName); | 665 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGProperty
Types($interfaceName); |
666 | 666 |
667 foreach my $headerInclude (sort keys(%headerIncludeFiles)) { | 667 foreach my $headerInclude (sort keys(%headerIncludeFiles)) { |
668 if ($headerInclude =~ /wtf|v8\.h/) { | 668 $header{includes}->add("#include \"${headerInclude}\"\n") unless $header
Include =~ /v8\.h/; |
669 $header{includes}->add("#include \<${headerInclude}\>\n"); | |
670 } else { | |
671 $header{includes}->add("#include \"${headerInclude}\"\n"); | |
672 } | |
673 } | 669 } |
| 670 $header{includes}->add("#include \<v8.h\>\n") if $headerIncludeFiles{"v8.h"}
; |
674 | 671 |
675 $header{nameSpaceWebCore}->addHeader("\ntemplate<typename PropertyType> clas
s SVGPropertyTearOff;\n") if $svgPropertyType; | 672 $header{nameSpaceWebCore}->addHeader("\ntemplate<typename PropertyType> clas
s SVGPropertyTearOff;\n") if $svgPropertyType; |
676 if ($svgNativeType) { | 673 if ($svgNativeType) { |
677 if ($svgNativeType =~ /SVGStaticListPropertyTearOff/) { | 674 if ($svgNativeType =~ /SVGStaticListPropertyTearOff/) { |
678 $header{nameSpaceWebCore}->addHeader("\ntemplate<typename PropertyTy
pe> class SVGStaticListPropertyTearOff;\n"); | 675 $header{nameSpaceWebCore}->addHeader("\ntemplate<typename PropertyTy
pe> class SVGStaticListPropertyTearOff;\n"); |
679 } else { | 676 } else { |
680 $header{nameSpaceWebCore}->addHeader("\ntemplate<typename PropertyTy
pe> class SVGListPropertyTearOff;\n"); | 677 $header{nameSpaceWebCore}->addHeader("\ntemplate<typename PropertyTy
pe> class SVGListPropertyTearOff;\n"); |
681 } | 678 } |
682 } | 679 } |
683 | 680 |
(...skipping 3370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4054 | 4051 |
4055 $header{root}->addFooter("\n"); | 4052 $header{root}->addFooter("\n"); |
4056 | 4053 |
4057 my @unsortedIncludes = (); | 4054 my @unsortedIncludes = (); |
4058 push(@unsortedIncludes, "#include \"bindings/v8/ActiveDOMCallback.h\""); | 4055 push(@unsortedIncludes, "#include \"bindings/v8/ActiveDOMCallback.h\""); |
4059 push(@unsortedIncludes, "#include \"bindings/v8/DOMWrapperWorld.h\""); | 4056 push(@unsortedIncludes, "#include \"bindings/v8/DOMWrapperWorld.h\""); |
4060 push(@unsortedIncludes, "#include \"bindings/v8/ScopedPersistent.h\""); | 4057 push(@unsortedIncludes, "#include \"bindings/v8/ScopedPersistent.h\""); |
4061 my $interfaceHeader = HeaderFileForInterface($interfaceName); | 4058 my $interfaceHeader = HeaderFileForInterface($interfaceName); |
4062 push(@unsortedIncludes, "#include \"$interfaceHeader\""); | 4059 push(@unsortedIncludes, "#include \"$interfaceHeader\""); |
4063 push(@unsortedIncludes, "#include <v8.h>"); | 4060 push(@unsortedIncludes, "#include <v8.h>"); |
4064 push(@unsortedIncludes, "#include <wtf/Forward.h>"); | 4061 push(@unsortedIncludes, "#include \"wtf/Forward.h\""); |
4065 $header{includes}->add(join("\n", sort @unsortedIncludes)); | 4062 $header{includes}->add(join("\n", sort @unsortedIncludes)); |
4066 unshift(@{$header{nameSpaceWebCore}->{header}}, "\n"); | 4063 unshift(@{$header{nameSpaceWebCore}->{header}}, "\n"); |
4067 $header{nameSpaceWebCore}->addHeader("class ScriptExecutionContext;\n\n"); | 4064 $header{nameSpaceWebCore}->addHeader("class ScriptExecutionContext;\n\n"); |
4068 $header{class}->addHeader("class $v8InterfaceName : public $interfaceName, p
ublic ActiveDOMCallback {"); | 4065 $header{class}->addHeader("class $v8InterfaceName : public $interfaceName, p
ublic ActiveDOMCallback {"); |
4069 $header{class}->addFooter("};\n"); | 4066 $header{class}->addFooter("};\n"); |
4070 | 4067 |
4071 $header{classPublic}->add(<<END); | 4068 $header{classPublic}->add(<<END); |
4072 static PassRefPtr<${v8InterfaceName}> create(v8::Handle<v8::Value> value, Sc
riptExecutionContext* context) | 4069 static PassRefPtr<${v8InterfaceName}> create(v8::Handle<v8::Value> value, Sc
riptExecutionContext* context) |
4073 { | 4070 { |
4074 ASSERT(value->IsObject()); | 4071 ASSERT(value->IsObject()); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4125 my $v8InterfaceName = "V8$interfaceName"; | 4122 my $v8InterfaceName = "V8$interfaceName"; |
4126 | 4123 |
4127 # - Add default header template | 4124 # - Add default header template |
4128 $implementation{root}->addHeader($headerTemplate); | 4125 $implementation{root}->addHeader($headerTemplate); |
4129 $implementation{root}->addHeader("\n#include \"config.h\""); | 4126 $implementation{root}->addHeader("\n#include \"config.h\""); |
4130 $implementation{includes}->add("#include \"${v8InterfaceName}.h\"\n\n"); | 4127 $implementation{includes}->add("#include \"${v8InterfaceName}.h\"\n\n"); |
4131 | 4128 |
4132 AddToImplIncludes("core/dom/ScriptExecutionContext.h"); | 4129 AddToImplIncludes("core/dom/ScriptExecutionContext.h"); |
4133 AddToImplIncludes("bindings/v8/V8Binding.h"); | 4130 AddToImplIncludes("bindings/v8/V8Binding.h"); |
4134 AddToImplIncludes("bindings/v8/V8Callback.h"); | 4131 AddToImplIncludes("bindings/v8/V8Callback.h"); |
4135 | 4132 AddToImplIncludes("wtf/Assertions.h"); |
4136 $implementation{includes}->addFooter("\n#include <wtf/Assertions.h>\n"); | |
4137 | 4133 |
4138 $implementation{nameSpaceWebCore}->add(<<END); | 4134 $implementation{nameSpaceWebCore}->add(<<END); |
4139 ${v8InterfaceName}::${v8InterfaceName}(v8::Handle<v8::Object> callback, ScriptEx
ecutionContext* context) | 4135 ${v8InterfaceName}::${v8InterfaceName}(v8::Handle<v8::Object> callback, ScriptEx
ecutionContext* context) |
4140 : ActiveDOMCallback(context) | 4136 : ActiveDOMCallback(context) |
4141 , m_callback(callback) | 4137 , m_callback(callback) |
4142 , m_world(DOMWrapperWorld::current()) | 4138 , m_world(DOMWrapperWorld::current()) |
4143 { | 4139 { |
4144 } | 4140 } |
4145 | 4141 |
4146 END | 4142 END |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5066 my $implFileName = "$outputDirectory/V8$name.cpp"; | 5062 my $implFileName = "$outputDirectory/V8$name.cpp"; |
5067 | 5063 |
5068 my @includes = (); | 5064 my @includes = (); |
5069 my %implIncludeConditions = (); | 5065 my %implIncludeConditions = (); |
5070 foreach my $include (keys %implIncludes) { | 5066 foreach my $include (keys %implIncludes) { |
5071 my $condition = $implIncludes{$include}; | 5067 my $condition = $implIncludes{$include}; |
5072 my $checkType = $include; | 5068 my $checkType = $include; |
5073 $checkType =~ s/\.h//; | 5069 $checkType =~ s/\.h//; |
5074 next if IsSVGAnimatedType($checkType); | 5070 next if IsSVGAnimatedType($checkType); |
5075 | 5071 |
5076 if ($include =~ /wtf/) { | 5072 $include = "\"$include\""; |
5077 $include = "\<$include\>"; | |
5078 } else { | |
5079 $include = "\"$include\""; | |
5080 } | |
5081 | 5073 |
5082 if ($condition eq 1) { | 5074 if ($condition eq 1) { |
5083 push @includes, $include; | 5075 push @includes, $include; |
5084 } else { | 5076 } else { |
5085 push @{$implIncludeConditions{$condition}}, $include; | 5077 push @{$implIncludeConditions{$condition}}, $include; |
5086 } | 5078 } |
5087 } | 5079 } |
5088 | 5080 |
5089 # FIXME: use $implementation{root}->toString() in both cases after generator
use class Block for non-callback implementation. | 5081 # FIXME: use $implementation{root}->toString() in both cases after generator
use class Block for non-callback implementation. |
5090 if ($interface->isCallback) { | 5082 if ($interface->isCallback) { |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5693 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { | 5685 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { |
5694 $found = 1; | 5686 $found = 1; |
5695 } | 5687 } |
5696 return 1 if $found; | 5688 return 1 if $found; |
5697 }, 0); | 5689 }, 0); |
5698 | 5690 |
5699 return $found; | 5691 return $found; |
5700 } | 5692 } |
5701 | 5693 |
5702 1; | 5694 1; |
OLD | NEW |