|
1 /* |
|
2 This file is part of the WebKit open source project. |
|
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
|
4 |
|
5 This library is free software; you can redistribute it and/or |
|
6 modify it under the terms of the GNU Library General Public |
|
7 License as published by the Free Software Foundation; either |
|
8 version 2 of the License, or (at your option) any later version. |
|
9 |
|
10 This library is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 Library General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU Library General Public License |
|
16 along with this library; see the file COPYING.LIB. If not, write to |
|
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
18 Boston, MA 02110-1301, USA. |
|
19 */ |
|
20 |
|
21 #include "config.h" |
|
22 |
|
23 |
|
24 #if ENABLE(SVG) && ENABLE(SVG_EXPERIMENTAL_FEATURES) |
|
25 |
|
26 #include "Document.h" |
|
27 #include "Frame.h" |
|
28 #include "SVGDocumentExtensions.h" |
|
29 #include "SVGElement.h" |
|
30 #include "SVGAnimatedTemplate.h" |
|
31 #include "JSSVGComponentTransferFunctionElement.h" |
|
32 |
|
33 #include <wtf/GetPtr.h> |
|
34 |
|
35 #include "JSSVGAnimatedEnumeration.h" |
|
36 #include "JSSVGAnimatedNumber.h" |
|
37 #include "JSSVGAnimatedNumberList.h" |
|
38 #include "SVGComponentTransferFunctionElement.h" |
|
39 |
|
40 using namespace KJS; |
|
41 |
|
42 namespace WebCore { |
|
43 |
|
44 /* Hash table */ |
|
45 |
|
46 static const HashEntry JSSVGComponentTransferFunctionElementTableEntries[] = |
|
47 { |
|
48 { 0, 0, 0, 0, 0 }, |
|
49 { "intercept", JSSVGComponentTransferFunctionElement::InterceptAttrNum, DontDelete|ReadOnly, 0, &JSSVGComponentTransferFunctionElementTableEntries[9] }, |
|
50 { 0, 0, 0, 0, 0 }, |
|
51 { 0, 0, 0, 0, 0 }, |
|
52 { "type", JSSVGComponentTransferFunctionElement::TypeAttrNum, DontDelete|ReadOnly, 0, &JSSVGComponentTransferFunctionElementTableEntries[7] }, |
|
53 { 0, 0, 0, 0, 0 }, |
|
54 { "slope", JSSVGComponentTransferFunctionElement::SlopeAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
55 { "tableValues", JSSVGComponentTransferFunctionElement::TableValuesAttrNum, DontDelete|ReadOnly, 0, &JSSVGComponentTransferFunctionElementTableEntries[8] }, |
|
56 { "amplitude", JSSVGComponentTransferFunctionElement::AmplitudeAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
57 { "exponent", JSSVGComponentTransferFunctionElement::ExponentAttrNum, DontDelete|ReadOnly, 0, &JSSVGComponentTransferFunctionElementTableEntries[10] }, |
|
58 { "offset", JSSVGComponentTransferFunctionElement::OffsetAttrNum, DontDelete|ReadOnly, 0, 0 } |
|
59 }; |
|
60 |
|
61 static const HashTable JSSVGComponentTransferFunctionElementTable = |
|
62 { |
|
63 2, 11, JSSVGComponentTransferFunctionElementTableEntries, 7 |
|
64 }; |
|
65 |
|
66 /* Hash table for prototype */ |
|
67 |
|
68 static const HashEntry JSSVGComponentTransferFunctionElementPrototypeTableEntries[] = |
|
69 { |
|
70 { "SVG_FECOMPONENTTRANSFER_TYPE_TABLE", WebCore::SVG_FECOMPONENTTRANSFER_TYPE_TABLE, DontDelete|ReadOnly, 0, 0 }, |
|
71 { 0, 0, 0, 0, 0 }, |
|
72 { "SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE", WebCore::SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE, DontDelete|ReadOnly, 0, 0 }, |
|
73 { "SVG_FECOMPONENTTRANSFER_TYPE_LINEAR", WebCore::SVG_FECOMPONENTTRANSFER_TYPE_LINEAR, DontDelete|ReadOnly, 0, 0 }, |
|
74 { 0, 0, 0, 0, 0 }, |
|
75 { "SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN", WebCore::SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN, DontDelete|ReadOnly, 0, &JSSVGComponentTransferFunctionElementPrototypeTableEntries[6] }, |
|
76 { "SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY", WebCore::SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY, DontDelete|ReadOnly, 0, &JSSVGComponentTransferFunctionElementPrototypeTableEntries[7] }, |
|
77 { "SVG_FECOMPONENTTRANSFER_TYPE_GAMMA", WebCore::SVG_FECOMPONENTTRANSFER_TYPE_GAMMA, DontDelete|ReadOnly, 0, 0 } |
|
78 }; |
|
79 |
|
80 static const HashTable JSSVGComponentTransferFunctionElementPrototypeTable = |
|
81 { |
|
82 2, 8, JSSVGComponentTransferFunctionElementPrototypeTableEntries, 6 |
|
83 }; |
|
84 |
|
85 const ClassInfo JSSVGComponentTransferFunctionElementPrototype::info = { "SVGComponentTransferFunctionElementPrototype", 0, &JSSVGComponentTransferFunctionElementPrototypeTable, 0 }; |
|
86 |
|
87 JSObject* JSSVGComponentTransferFunctionElementPrototype::self(ExecState* exec) |
|
88 { |
|
89 return KJS::cacheGlobalObject<JSSVGComponentTransferFunctionElementPrototype>(exec, "[[JSSVGComponentTransferFunctionElement.prototype]]"); |
|
90 } |
|
91 |
|
92 bool JSSVGComponentTransferFunctionElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
93 { |
|
94 return getStaticValueSlot<JSSVGComponentTransferFunctionElementPrototype, JSObject>(exec, &JSSVGComponentTransferFunctionElementPrototypeTable, this, propertyName, slot); |
|
95 } |
|
96 |
|
97 JSValue* JSSVGComponentTransferFunctionElementPrototype::getValueProperty(ExecState*, int token) const |
|
98 { |
|
99 // The token is the numeric value of its associated constant |
|
100 return jsNumber(token); |
|
101 } |
|
102 |
|
103 const ClassInfo JSSVGComponentTransferFunctionElement::info = { "SVGComponentTransferFunctionElement", &JSSVGElement::info, &JSSVGComponentTransferFunctionElementTable, 0 }; |
|
104 |
|
105 JSSVGComponentTransferFunctionElement::JSSVGComponentTransferFunctionElement(ExecState* exec, SVGComponentTransferFunctionElement* impl) |
|
106 : JSSVGElement(exec, impl) |
|
107 { |
|
108 setPrototype(JSSVGComponentTransferFunctionElementPrototype::self(exec)); |
|
109 } |
|
110 |
|
111 bool JSSVGComponentTransferFunctionElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
112 { |
|
113 return getStaticValueSlot<JSSVGComponentTransferFunctionElement, JSSVGElement>(exec, &JSSVGComponentTransferFunctionElementTable, this, propertyName, slot); |
|
114 } |
|
115 |
|
116 JSValue* JSSVGComponentTransferFunctionElement::getValueProperty(ExecState* exec, int token) const |
|
117 { |
|
118 switch (token) { |
|
119 case TypeAttrNum: { |
|
120 SVGComponentTransferFunctionElement* imp = static_cast<SVGComponentTransferFunctionElement*>(impl()); |
|
121 |
|
122 ASSERT(exec && exec->dynamicInterpreter()); |
|
123 |
|
124 RefPtr<SVGAnimatedEnumeration> obj = imp->typeAnimated(); |
|
125 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
126 if (activeFrame) { |
|
127 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
128 if (extensions) { |
|
129 if (extensions->hasGenericContext<SVGAnimatedEnumeration>(obj.get())) |
|
130 ASSERT(extensions->genericContext<SVGAnimatedEnumeration>(obj.get()) == imp); |
|
131 else |
|
132 extensions->setGenericContext<SVGAnimatedEnumeration>(obj.get(), imp); |
|
133 } |
|
134 } |
|
135 |
|
136 return toJS(exec, obj.get()); |
|
137 } |
|
138 case TableValuesAttrNum: { |
|
139 SVGComponentTransferFunctionElement* imp = static_cast<SVGComponentTransferFunctionElement*>(impl()); |
|
140 |
|
141 ASSERT(exec && exec->dynamicInterpreter()); |
|
142 |
|
143 RefPtr<SVGAnimatedNumberList> obj = imp->tableValuesAnimated(); |
|
144 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
145 if (activeFrame) { |
|
146 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
147 if (extensions) { |
|
148 if (extensions->hasGenericContext<SVGAnimatedNumberList>(obj.get())) |
|
149 ASSERT(extensions->genericContext<SVGAnimatedNumberList>(obj.get()) == imp); |
|
150 else |
|
151 extensions->setGenericContext<SVGAnimatedNumberList>(obj.get(), imp); |
|
152 } |
|
153 } |
|
154 |
|
155 return toJS(exec, obj.get()); |
|
156 } |
|
157 case SlopeAttrNum: { |
|
158 SVGComponentTransferFunctionElement* imp = static_cast<SVGComponentTransferFunctionElement*>(impl()); |
|
159 |
|
160 ASSERT(exec && exec->dynamicInterpreter()); |
|
161 |
|
162 RefPtr<SVGAnimatedNumber> obj = imp->slopeAnimated(); |
|
163 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
164 if (activeFrame) { |
|
165 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
166 if (extensions) { |
|
167 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
168 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
169 else |
|
170 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
171 } |
|
172 } |
|
173 |
|
174 return toJS(exec, obj.get()); |
|
175 } |
|
176 case InterceptAttrNum: { |
|
177 SVGComponentTransferFunctionElement* imp = static_cast<SVGComponentTransferFunctionElement*>(impl()); |
|
178 |
|
179 ASSERT(exec && exec->dynamicInterpreter()); |
|
180 |
|
181 RefPtr<SVGAnimatedNumber> obj = imp->interceptAnimated(); |
|
182 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
183 if (activeFrame) { |
|
184 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
185 if (extensions) { |
|
186 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
187 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
188 else |
|
189 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
190 } |
|
191 } |
|
192 |
|
193 return toJS(exec, obj.get()); |
|
194 } |
|
195 case AmplitudeAttrNum: { |
|
196 SVGComponentTransferFunctionElement* imp = static_cast<SVGComponentTransferFunctionElement*>(impl()); |
|
197 |
|
198 ASSERT(exec && exec->dynamicInterpreter()); |
|
199 |
|
200 RefPtr<SVGAnimatedNumber> obj = imp->amplitudeAnimated(); |
|
201 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
202 if (activeFrame) { |
|
203 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
204 if (extensions) { |
|
205 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
206 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
207 else |
|
208 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
209 } |
|
210 } |
|
211 |
|
212 return toJS(exec, obj.get()); |
|
213 } |
|
214 case ExponentAttrNum: { |
|
215 SVGComponentTransferFunctionElement* imp = static_cast<SVGComponentTransferFunctionElement*>(impl()); |
|
216 |
|
217 ASSERT(exec && exec->dynamicInterpreter()); |
|
218 |
|
219 RefPtr<SVGAnimatedNumber> obj = imp->exponentAnimated(); |
|
220 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
221 if (activeFrame) { |
|
222 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
223 if (extensions) { |
|
224 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
225 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
226 else |
|
227 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
228 } |
|
229 } |
|
230 |
|
231 return toJS(exec, obj.get()); |
|
232 } |
|
233 case OffsetAttrNum: { |
|
234 SVGComponentTransferFunctionElement* imp = static_cast<SVGComponentTransferFunctionElement*>(impl()); |
|
235 |
|
236 ASSERT(exec && exec->dynamicInterpreter()); |
|
237 |
|
238 RefPtr<SVGAnimatedNumber> obj = imp->offsetAnimated(); |
|
239 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
240 if (activeFrame) { |
|
241 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
242 if (extensions) { |
|
243 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
244 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
245 else |
|
246 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
247 } |
|
248 } |
|
249 |
|
250 return toJS(exec, obj.get()); |
|
251 } |
|
252 } |
|
253 return 0; |
|
254 } |
|
255 |
|
256 |
|
257 } |
|
258 |
|
259 #endif // ENABLE(SVG) && ENABLE(SVG_EXPERIMENTAL_FEATURES) |