|
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 "JSSVGFECompositeElement.h" |
|
32 |
|
33 #include <wtf/GetPtr.h> |
|
34 |
|
35 #include "CSSMutableStyleDeclaration.h" |
|
36 #include "CSSStyleDeclaration.h" |
|
37 #include "JSCSSStyleDeclaration.h" |
|
38 #include "JSSVGAnimatedEnumeration.h" |
|
39 #include "JSSVGAnimatedLength.h" |
|
40 #include "JSSVGAnimatedNumber.h" |
|
41 #include "JSSVGAnimatedString.h" |
|
42 #include "SVGFECompositeElement.h" |
|
43 |
|
44 using namespace KJS; |
|
45 |
|
46 namespace WebCore { |
|
47 |
|
48 /* Hash table */ |
|
49 |
|
50 static const HashEntry JSSVGFECompositeElementTableEntries[] = |
|
51 { |
|
52 { "in2", JSSVGFECompositeElement::In2AttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
53 { "k2", JSSVGFECompositeElement::K2AttrNum, DontDelete|ReadOnly, 0, &JSSVGFECompositeElementTableEntries[15] }, |
|
54 { "in1", JSSVGFECompositeElement::In1AttrNum, DontDelete|ReadOnly, 0, &JSSVGFECompositeElementTableEntries[17] }, |
|
55 { 0, 0, 0, 0, 0 }, |
|
56 { "k4", JSSVGFECompositeElement::K4AttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
57 { "k1", JSSVGFECompositeElement::K1AttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
58 { "result", JSSVGFECompositeElement::ResultAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
59 { 0, 0, 0, 0, 0 }, |
|
60 { "className", JSSVGFECompositeElement::ClassNameAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
61 { "x", JSSVGFECompositeElement::XAttrNum, DontDelete|ReadOnly, 0, &JSSVGFECompositeElementTableEntries[16] }, |
|
62 { "k3", JSSVGFECompositeElement::K3AttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
63 { 0, 0, 0, 0, 0 }, |
|
64 { "_operator", JSSVGFECompositeElement::_operatorAttrNum, DontDelete|ReadOnly, 0, &JSSVGFECompositeElementTableEntries[14] }, |
|
65 { 0, 0, 0, 0, 0 }, |
|
66 { "y", JSSVGFECompositeElement::YAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
67 { "width", JSSVGFECompositeElement::WidthAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
68 { "height", JSSVGFECompositeElement::HeightAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
69 { "style", JSSVGFECompositeElement::StyleAttrNum, DontDelete|ReadOnly, 0, 0 } |
|
70 }; |
|
71 |
|
72 static const HashTable JSSVGFECompositeElementTable = |
|
73 { |
|
74 2, 18, JSSVGFECompositeElementTableEntries, 14 |
|
75 }; |
|
76 |
|
77 /* Hash table for prototype */ |
|
78 |
|
79 static const HashEntry JSSVGFECompositeElementPrototypeTableEntries[] = |
|
80 { |
|
81 { 0, 0, 0, 0, 0 }, |
|
82 { 0, 0, 0, 0, 0 }, |
|
83 { "SVG_FECOMPOSITE_OPERATOR_OUT", WebCore::SVG_FECOMPOSITE_OPERATOR_OUT, DontDelete|ReadOnly, 0, 0 }, |
|
84 { "SVG_FECOMPOSITE_OPERATOR_ATOP", WebCore::SVG_FECOMPOSITE_OPERATOR_ATOP, DontDelete|ReadOnly, 0, 0 }, |
|
85 { "SVG_FECOMPOSITE_OPERATOR_ARITHMETIC", WebCore::SVG_FECOMPOSITE_OPERATOR_ARITHMETIC, DontDelete|ReadOnly, 0, 0 }, |
|
86 { "SVG_FECOMPOSITE_OPERATOR_OVER", WebCore::SVG_FECOMPOSITE_OPERATOR_OVER, DontDelete|ReadOnly, 0, 0 }, |
|
87 { "SVG_FECOMPOSITE_OPERATOR_UNKNOWN", WebCore::SVG_FECOMPOSITE_OPERATOR_UNKNOWN, DontDelete|ReadOnly, 0, &JSSVGFECompositeElementPrototypeTableEntries[7] }, |
|
88 { "SVG_FECOMPOSITE_OPERATOR_IN", WebCore::SVG_FECOMPOSITE_OPERATOR_IN, DontDelete|ReadOnly, 0, &JSSVGFECompositeElementPrototypeTableEntries[8] }, |
|
89 { "SVG_FECOMPOSITE_OPERATOR_XOR", WebCore::SVG_FECOMPOSITE_OPERATOR_XOR, DontDelete|ReadOnly, 0, 0 } |
|
90 }; |
|
91 |
|
92 static const HashTable JSSVGFECompositeElementPrototypeTable = |
|
93 { |
|
94 2, 9, JSSVGFECompositeElementPrototypeTableEntries, 7 |
|
95 }; |
|
96 |
|
97 const ClassInfo JSSVGFECompositeElementPrototype::info = { "SVGFECompositeElementPrototype", 0, &JSSVGFECompositeElementPrototypeTable, 0 }; |
|
98 |
|
99 JSObject* JSSVGFECompositeElementPrototype::self(ExecState* exec) |
|
100 { |
|
101 return KJS::cacheGlobalObject<JSSVGFECompositeElementPrototype>(exec, "[[JSSVGFECompositeElement.prototype]]"); |
|
102 } |
|
103 |
|
104 bool JSSVGFECompositeElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
105 { |
|
106 return getStaticValueSlot<JSSVGFECompositeElementPrototype, JSObject>(exec, &JSSVGFECompositeElementPrototypeTable, this, propertyName, slot); |
|
107 } |
|
108 |
|
109 JSValue* JSSVGFECompositeElementPrototype::getValueProperty(ExecState*, int token) const |
|
110 { |
|
111 // The token is the numeric value of its associated constant |
|
112 return jsNumber(token); |
|
113 } |
|
114 |
|
115 const ClassInfo JSSVGFECompositeElement::info = { "SVGFECompositeElement", &JSSVGElement::info, &JSSVGFECompositeElementTable, 0 }; |
|
116 |
|
117 JSSVGFECompositeElement::JSSVGFECompositeElement(ExecState* exec, SVGFECompositeElement* impl) |
|
118 : JSSVGElement(exec, impl) |
|
119 { |
|
120 setPrototype(JSSVGFECompositeElementPrototype::self(exec)); |
|
121 } |
|
122 |
|
123 bool JSSVGFECompositeElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
124 { |
|
125 return getStaticValueSlot<JSSVGFECompositeElement, JSSVGElement>(exec, &JSSVGFECompositeElementTable, this, propertyName, slot); |
|
126 } |
|
127 |
|
128 JSValue* JSSVGFECompositeElement::getValueProperty(ExecState* exec, int token) const |
|
129 { |
|
130 switch (token) { |
|
131 case In1AttrNum: { |
|
132 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
133 |
|
134 ASSERT(exec && exec->dynamicInterpreter()); |
|
135 |
|
136 RefPtr<SVGAnimatedString> obj = imp->in1Animated(); |
|
137 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
138 if (activeFrame) { |
|
139 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
140 if (extensions) { |
|
141 if (extensions->hasGenericContext<SVGAnimatedString>(obj.get())) |
|
142 ASSERT(extensions->genericContext<SVGAnimatedString>(obj.get()) == imp); |
|
143 else |
|
144 extensions->setGenericContext<SVGAnimatedString>(obj.get(), imp); |
|
145 } |
|
146 } |
|
147 |
|
148 return toJS(exec, obj.get()); |
|
149 } |
|
150 case In2AttrNum: { |
|
151 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
152 |
|
153 ASSERT(exec && exec->dynamicInterpreter()); |
|
154 |
|
155 RefPtr<SVGAnimatedString> obj = imp->in2Animated(); |
|
156 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
157 if (activeFrame) { |
|
158 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
159 if (extensions) { |
|
160 if (extensions->hasGenericContext<SVGAnimatedString>(obj.get())) |
|
161 ASSERT(extensions->genericContext<SVGAnimatedString>(obj.get()) == imp); |
|
162 else |
|
163 extensions->setGenericContext<SVGAnimatedString>(obj.get(), imp); |
|
164 } |
|
165 } |
|
166 |
|
167 return toJS(exec, obj.get()); |
|
168 } |
|
169 case _operatorAttrNum: { |
|
170 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
171 |
|
172 ASSERT(exec && exec->dynamicInterpreter()); |
|
173 |
|
174 RefPtr<SVGAnimatedEnumeration> obj = imp->_operatorAnimated(); |
|
175 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
176 if (activeFrame) { |
|
177 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
178 if (extensions) { |
|
179 if (extensions->hasGenericContext<SVGAnimatedEnumeration>(obj.get())) |
|
180 ASSERT(extensions->genericContext<SVGAnimatedEnumeration>(obj.get()) == imp); |
|
181 else |
|
182 extensions->setGenericContext<SVGAnimatedEnumeration>(obj.get(), imp); |
|
183 } |
|
184 } |
|
185 |
|
186 return toJS(exec, obj.get()); |
|
187 } |
|
188 case K1AttrNum: { |
|
189 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
190 |
|
191 ASSERT(exec && exec->dynamicInterpreter()); |
|
192 |
|
193 RefPtr<SVGAnimatedNumber> obj = imp->k1Animated(); |
|
194 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
195 if (activeFrame) { |
|
196 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
197 if (extensions) { |
|
198 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
199 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
200 else |
|
201 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
202 } |
|
203 } |
|
204 |
|
205 return toJS(exec, obj.get()); |
|
206 } |
|
207 case K2AttrNum: { |
|
208 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
209 |
|
210 ASSERT(exec && exec->dynamicInterpreter()); |
|
211 |
|
212 RefPtr<SVGAnimatedNumber> obj = imp->k2Animated(); |
|
213 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
214 if (activeFrame) { |
|
215 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
216 if (extensions) { |
|
217 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
218 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
219 else |
|
220 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
221 } |
|
222 } |
|
223 |
|
224 return toJS(exec, obj.get()); |
|
225 } |
|
226 case K3AttrNum: { |
|
227 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
228 |
|
229 ASSERT(exec && exec->dynamicInterpreter()); |
|
230 |
|
231 RefPtr<SVGAnimatedNumber> obj = imp->k3Animated(); |
|
232 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
233 if (activeFrame) { |
|
234 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
235 if (extensions) { |
|
236 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
237 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
238 else |
|
239 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
240 } |
|
241 } |
|
242 |
|
243 return toJS(exec, obj.get()); |
|
244 } |
|
245 case K4AttrNum: { |
|
246 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
247 |
|
248 ASSERT(exec && exec->dynamicInterpreter()); |
|
249 |
|
250 RefPtr<SVGAnimatedNumber> obj = imp->k4Animated(); |
|
251 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
252 if (activeFrame) { |
|
253 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
254 if (extensions) { |
|
255 if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get())) |
|
256 ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp); |
|
257 else |
|
258 extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp); |
|
259 } |
|
260 } |
|
261 |
|
262 return toJS(exec, obj.get()); |
|
263 } |
|
264 case XAttrNum: { |
|
265 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
266 |
|
267 ASSERT(exec && exec->dynamicInterpreter()); |
|
268 |
|
269 RefPtr<SVGAnimatedLength> obj = imp->xAnimated(); |
|
270 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
271 if (activeFrame) { |
|
272 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
273 if (extensions) { |
|
274 if (extensions->hasGenericContext<SVGAnimatedLength>(obj.get())) |
|
275 ASSERT(extensions->genericContext<SVGAnimatedLength>(obj.get()) == imp); |
|
276 else |
|
277 extensions->setGenericContext<SVGAnimatedLength>(obj.get(), imp); |
|
278 } |
|
279 } |
|
280 |
|
281 return toJS(exec, obj.get()); |
|
282 } |
|
283 case YAttrNum: { |
|
284 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
285 |
|
286 ASSERT(exec && exec->dynamicInterpreter()); |
|
287 |
|
288 RefPtr<SVGAnimatedLength> obj = imp->yAnimated(); |
|
289 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
290 if (activeFrame) { |
|
291 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
292 if (extensions) { |
|
293 if (extensions->hasGenericContext<SVGAnimatedLength>(obj.get())) |
|
294 ASSERT(extensions->genericContext<SVGAnimatedLength>(obj.get()) == imp); |
|
295 else |
|
296 extensions->setGenericContext<SVGAnimatedLength>(obj.get(), imp); |
|
297 } |
|
298 } |
|
299 |
|
300 return toJS(exec, obj.get()); |
|
301 } |
|
302 case WidthAttrNum: { |
|
303 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
304 |
|
305 ASSERT(exec && exec->dynamicInterpreter()); |
|
306 |
|
307 RefPtr<SVGAnimatedLength> obj = imp->widthAnimated(); |
|
308 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
309 if (activeFrame) { |
|
310 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
311 if (extensions) { |
|
312 if (extensions->hasGenericContext<SVGAnimatedLength>(obj.get())) |
|
313 ASSERT(extensions->genericContext<SVGAnimatedLength>(obj.get()) == imp); |
|
314 else |
|
315 extensions->setGenericContext<SVGAnimatedLength>(obj.get(), imp); |
|
316 } |
|
317 } |
|
318 |
|
319 return toJS(exec, obj.get()); |
|
320 } |
|
321 case HeightAttrNum: { |
|
322 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
323 |
|
324 ASSERT(exec && exec->dynamicInterpreter()); |
|
325 |
|
326 RefPtr<SVGAnimatedLength> obj = imp->heightAnimated(); |
|
327 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
328 if (activeFrame) { |
|
329 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
330 if (extensions) { |
|
331 if (extensions->hasGenericContext<SVGAnimatedLength>(obj.get())) |
|
332 ASSERT(extensions->genericContext<SVGAnimatedLength>(obj.get()) == imp); |
|
333 else |
|
334 extensions->setGenericContext<SVGAnimatedLength>(obj.get(), imp); |
|
335 } |
|
336 } |
|
337 |
|
338 return toJS(exec, obj.get()); |
|
339 } |
|
340 case ResultAttrNum: { |
|
341 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
342 |
|
343 ASSERT(exec && exec->dynamicInterpreter()); |
|
344 |
|
345 RefPtr<SVGAnimatedString> obj = imp->resultAnimated(); |
|
346 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
347 if (activeFrame) { |
|
348 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
349 if (extensions) { |
|
350 if (extensions->hasGenericContext<SVGAnimatedString>(obj.get())) |
|
351 ASSERT(extensions->genericContext<SVGAnimatedString>(obj.get()) == imp); |
|
352 else |
|
353 extensions->setGenericContext<SVGAnimatedString>(obj.get(), imp); |
|
354 } |
|
355 } |
|
356 |
|
357 return toJS(exec, obj.get()); |
|
358 } |
|
359 case ClassNameAttrNum: { |
|
360 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
361 |
|
362 ASSERT(exec && exec->dynamicInterpreter()); |
|
363 |
|
364 RefPtr<SVGAnimatedString> obj = imp->classNameAnimated(); |
|
365 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
366 if (activeFrame) { |
|
367 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
368 if (extensions) { |
|
369 if (extensions->hasGenericContext<SVGAnimatedString>(obj.get())) |
|
370 ASSERT(extensions->genericContext<SVGAnimatedString>(obj.get()) == imp); |
|
371 else |
|
372 extensions->setGenericContext<SVGAnimatedString>(obj.get(), imp); |
|
373 } |
|
374 } |
|
375 |
|
376 return toJS(exec, obj.get()); |
|
377 } |
|
378 case StyleAttrNum: { |
|
379 SVGFECompositeElement* imp = static_cast<SVGFECompositeElement*>(impl()); |
|
380 |
|
381 return toJS(exec, WTF::getPtr(imp->style())); |
|
382 } |
|
383 } |
|
384 return 0; |
|
385 } |
|
386 |
|
387 |
|
388 } |
|
389 |
|
390 #endif // ENABLE(SVG) && ENABLE(SVG_EXPERIMENTAL_FEATURES) |