| 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, 2008, 2009 Google Inc. | 7 # Copyright (C) 2007, 2008, 2009 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 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 } | 1088 } |
| 1089 | 1089 |
| 1090 # Make EventListeners always custom. | 1090 # Make EventListeners always custom. |
| 1091 # TODO(mbelshe): make the perl code capable of generating the | 1091 # TODO(mbelshe): make the perl code capable of generating the |
| 1092 # event setters/getters. For now, WebKit has started removing the | 1092 # event setters/getters. For now, WebKit has started removing the |
| 1093 # [Custom] attribute, so just automatically insert it to avoid forking | 1093 # [Custom] attribute, so just automatically insert it to avoid forking |
| 1094 # other files. This should be okay because we can't generate stubs | 1094 # other files. This should be okay because we can't generate stubs |
| 1095 # for any event getter/setters anyway. | 1095 # for any event getter/setters anyway. |
| 1096 if ($attrType eq "EventListener") { | 1096 if ($attrType eq "EventListener") { |
| 1097 $attribute->signature->extendedAttributes->{"Custom"} = 1; | 1097 $attribute->signature->extendedAttributes->{"Custom"} = 1; |
| 1098 $implIncludes{"v8_custom.h"} = 1; | 1098 $implIncludes{"V8CustomBinding.h"} = 1; |
| 1099 next; | 1099 next; |
| 1100 } | 1100 } |
| 1101 | 1101 |
| 1102 # Do not generate accessor if this is a custom attribute. The | 1102 # Do not generate accessor if this is a custom attribute. The |
| 1103 # call will be forwarded to a hand-written accessor | 1103 # call will be forwarded to a hand-written accessor |
| 1104 # implementation. | 1104 # implementation. |
| 1105 if ($attribute->signature->extendedAttributes->{"Custom"} || | 1105 if ($attribute->signature->extendedAttributes->{"Custom"} || |
| 1106 $attribute->signature->extendedAttributes->{"V8Custom"}) { | 1106 $attribute->signature->extendedAttributes->{"V8Custom"}) { |
| 1107 $implIncludes{"v8_custom.h"} = 1; | 1107 $implIncludes{"V8CustomBinding.h"} = 1; |
| 1108 next; | 1108 next; |
| 1109 } | 1109 } |
| 1110 | 1110 |
| 1111 # Generate the accessor. | 1111 # Generate the accessor. |
| 1112 if ($attribute->signature->extendedAttributes->{"CustomGetter"}) { | 1112 if ($attribute->signature->extendedAttributes->{"CustomGetter"}) { |
| 1113 $implIncludes{"v8_custom.h"} = 1; | 1113 $implIncludes{"V8CustomBinding.h"} = 1; |
| 1114 } else { | 1114 } else { |
| 1115 GenerateNormalAttrGetter($attribute, $dataNode, $classIndex, $implCl
assName); | 1115 GenerateNormalAttrGetter($attribute, $dataNode, $classIndex, $implCl
assName); |
| 1116 } | 1116 } |
| 1117 if ($attribute->signature->extendedAttributes->{"CustomSetter"} || | 1117 if ($attribute->signature->extendedAttributes->{"CustomSetter"} || |
| 1118 $attribute->signature->extendedAttributes->{"V8CustomSetter"}) { | 1118 $attribute->signature->extendedAttributes->{"V8CustomSetter"}) { |
| 1119 $implIncludes{"v8_custom.h"} = 1; | 1119 $implIncludes{"V8CustomBinding.h"} = 1; |
| 1120 } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) { | 1120 } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) { |
| 1121 $dataNode->extendedAttributes->{"ExtendsDOMGlobalObject"} || die "Replac
eable attribute can only be used in interface that defines ExtendsDOMGlobalObjec
t attribute!"; | 1121 $dataNode->extendedAttributes->{"ExtendsDOMGlobalObject"} || die "Replac
eable attribute can only be used in interface that defines ExtendsDOMGlobalObjec
t attribute!"; |
| 1122 # GenerateReplaceableAttrSetter($implClassName); | 1122 # GenerateReplaceableAttrSetter($implClassName); |
| 1123 } elsif ($attribute->type !~ /^readonly/ && | 1123 } elsif ($attribute->type !~ /^readonly/ && |
| 1124 !$attribute->signature->extendedAttributes->{"V8ReadOnly"}) { | 1124 !$attribute->signature->extendedAttributes->{"V8ReadOnly"}) { |
| 1125 GenerateNormalAttrSetter($attribute, $dataNode, $classIndex, $implClassN
ame); | 1125 GenerateNormalAttrSetter($attribute, $dataNode, $classIndex, $implClassN
ame); |
| 1126 } | 1126 } |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 if ($hasConstructors) { | 1129 if ($hasConstructors) { |
| 1130 GenerateConstructorGetter($implClassName, $classIndex); | 1130 GenerateConstructorGetter($implClassName, $classIndex); |
| 1131 } | 1131 } |
| 1132 | 1132 |
| 1133 # Generate methods for functions. | 1133 # Generate methods for functions. |
| 1134 foreach my $function (@{$dataNode->functions}) { | 1134 foreach my $function (@{$dataNode->functions}) { |
| 1135 # hack for addEventListener/RemoveEventListener | 1135 # hack for addEventListener/RemoveEventListener |
| 1136 # TODO(fqian): avoid naming conflict | 1136 # TODO(fqian): avoid naming conflict |
| 1137 if ($function->signature->extendedAttributes->{"Custom"} || | 1137 if ($function->signature->extendedAttributes->{"Custom"} || |
| 1138 $function->signature->extendedAttributes->{"V8Custom"}) { | 1138 $function->signature->extendedAttributes->{"V8Custom"}) { |
| 1139 $implIncludes{"v8_custom.h"} = 1; | 1139 $implIncludes{"V8CustomBinding.h"} = 1; |
| 1140 | 1140 |
| 1141 } else { | 1141 } else { |
| 1142 GenerateFunctionCallback($function, $dataNode, $classIndex, $implClassNa
me); | 1142 GenerateFunctionCallback($function, $dataNode, $classIndex, $implClassNa
me); |
| 1143 } | 1143 } |
| 1144 | 1144 |
| 1145 | 1145 |
| 1146 # If the function does not need domain security check, we need to | 1146 # If the function does not need domain security check, we need to |
| 1147 # generate an access getter that returns different function objects | 1147 # generate an access getter that returns different function objects |
| 1148 # for different calling context. | 1148 # for different calling context. |
| 1149 if (($dataNode->extendedAttributes->{"CheckDomainSecurity"} | 1149 if (($dataNode->extendedAttributes->{"CheckDomainSecurity"} |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2187 return 0; | 2187 return 0; |
| 2188 } | 2188 } |
| 2189 | 2189 |
| 2190 sub DebugPrint | 2190 sub DebugPrint |
| 2191 { | 2191 { |
| 2192 my $output = shift; | 2192 my $output = shift; |
| 2193 | 2193 |
| 2194 print $output; | 2194 print $output; |
| 2195 print "\n"; | 2195 print "\n"; |
| 2196 } | 2196 } |
| OLD | NEW |