|
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 #if ENABLE(SVG) && ENABLE(FILTERS) |
|
24 |
|
25 #include "JSSVGFEImageElement.h" |
|
26 |
|
27 #include "CSSMutableStyleDeclaration.h" |
|
28 #include "CSSStyleDeclaration.h" |
|
29 #include "CSSValue.h" |
|
30 #include "JSCSSStyleDeclaration.h" |
|
31 #include "JSCSSValue.h" |
|
32 #include "JSSVGAnimatedBoolean.h" |
|
33 #include "JSSVGAnimatedLength.h" |
|
34 #include "JSSVGAnimatedPreserveAspectRatio.h" |
|
35 #include "JSSVGAnimatedString.h" |
|
36 #include "KURL.h" |
|
37 #include "SVGFEImageElement.h" |
|
38 #include <runtime/Error.h> |
|
39 #include <runtime/JSString.h> |
|
40 #include <wtf/GetPtr.h> |
|
41 |
|
42 using namespace JSC; |
|
43 |
|
44 namespace WebCore { |
|
45 |
|
46 ASSERT_CLASS_FITS_IN_CELL(JSSVGFEImageElement); |
|
47 |
|
48 /* Hash table */ |
|
49 #if ENABLE(JIT) |
|
50 #define THUNK_GENERATOR(generator) , generator |
|
51 #else |
|
52 #define THUNK_GENERATOR(generator) |
|
53 #endif |
|
54 |
|
55 static const HashTableValue JSSVGFEImageElementTableValues[14] = |
|
56 { |
|
57 { "preserveAspectRatio", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementPreserveAspectRatio), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
58 { "href", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementHref), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
59 { "xmllang", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementXmllang), (intptr_t)setJSSVGFEImageElementXmllang THUNK_GENERATOR(0) }, |
|
60 { "xmlspace", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementXmlspace), (intptr_t)setJSSVGFEImageElementXmlspace THUNK_GENERATOR(0) }, |
|
61 { "externalResourcesRequired", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementExternalResourcesRequired), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
62 { "x", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementX), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
63 { "y", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementY), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
64 { "width", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementWidth), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
65 { "height", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementHeight), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
66 { "result", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementResult), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
67 { "className", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementClassName), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
68 { "style", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementStyle), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
69 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEImageElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
70 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
71 }; |
|
72 |
|
73 #undef THUNK_GENERATOR |
|
74 static JSC_CONST_HASHTABLE HashTable JSSVGFEImageElementTable = { 33, 31, JSSVGFEImageElementTableValues, 0 }; |
|
75 /* Hash table for constructor */ |
|
76 #if ENABLE(JIT) |
|
77 #define THUNK_GENERATOR(generator) , generator |
|
78 #else |
|
79 #define THUNK_GENERATOR(generator) |
|
80 #endif |
|
81 |
|
82 static const HashTableValue JSSVGFEImageElementConstructorTableValues[1] = |
|
83 { |
|
84 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
85 }; |
|
86 |
|
87 #undef THUNK_GENERATOR |
|
88 static JSC_CONST_HASHTABLE HashTable JSSVGFEImageElementConstructorTable = { 1, 0, JSSVGFEImageElementConstructorTableValues, 0 }; |
|
89 class JSSVGFEImageElementConstructor : public DOMConstructorObject { |
|
90 public: |
|
91 JSSVGFEImageElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
92 |
|
93 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
94 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
95 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
96 static const JSC::ClassInfo s_info; |
|
97 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
98 { |
|
99 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
100 } |
|
101 protected: |
|
102 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
103 }; |
|
104 |
|
105 const ClassInfo JSSVGFEImageElementConstructor::s_info = { "SVGFEImageElementConstructor", 0, &JSSVGFEImageElementConstructorTable, 0 }; |
|
106 |
|
107 JSSVGFEImageElementConstructor::JSSVGFEImageElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
108 : DOMConstructorObject(JSSVGFEImageElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
109 { |
|
110 putDirect(exec->propertyNames().prototype, JSSVGFEImageElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
111 } |
|
112 |
|
113 bool JSSVGFEImageElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
114 { |
|
115 return getStaticValueSlot<JSSVGFEImageElementConstructor, DOMObject>(exec, &JSSVGFEImageElementConstructorTable, this, propertyName, slot); |
|
116 } |
|
117 |
|
118 bool JSSVGFEImageElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
119 { |
|
120 return getStaticValueDescriptor<JSSVGFEImageElementConstructor, DOMObject>(exec, &JSSVGFEImageElementConstructorTable, this, propertyName, descriptor); |
|
121 } |
|
122 |
|
123 /* Hash table for prototype */ |
|
124 #if ENABLE(JIT) |
|
125 #define THUNK_GENERATOR(generator) , generator |
|
126 #else |
|
127 #define THUNK_GENERATOR(generator) |
|
128 #endif |
|
129 |
|
130 static const HashTableValue JSSVGFEImageElementPrototypeTableValues[2] = |
|
131 { |
|
132 { "getPresentationAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGFEImageElementPrototypeFunctionGetPresentationAttribute), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
133 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
134 }; |
|
135 |
|
136 #undef THUNK_GENERATOR |
|
137 static JSC_CONST_HASHTABLE HashTable JSSVGFEImageElementPrototypeTable = { 2, 1, JSSVGFEImageElementPrototypeTableValues, 0 }; |
|
138 const ClassInfo JSSVGFEImageElementPrototype::s_info = { "SVGFEImageElementPrototype", 0, &JSSVGFEImageElementPrototypeTable, 0 }; |
|
139 |
|
140 JSObject* JSSVGFEImageElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
141 { |
|
142 return getDOMPrototype<JSSVGFEImageElement>(exec, globalObject); |
|
143 } |
|
144 |
|
145 bool JSSVGFEImageElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
146 { |
|
147 return getStaticFunctionSlot<JSObject>(exec, &JSSVGFEImageElementPrototypeTable, this, propertyName, slot); |
|
148 } |
|
149 |
|
150 bool JSSVGFEImageElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
151 { |
|
152 return getStaticFunctionDescriptor<JSObject>(exec, &JSSVGFEImageElementPrototypeTable, this, propertyName, descriptor); |
|
153 } |
|
154 |
|
155 const ClassInfo JSSVGFEImageElement::s_info = { "SVGFEImageElement", &JSSVGElement::s_info, &JSSVGFEImageElementTable, 0 }; |
|
156 |
|
157 JSSVGFEImageElement::JSSVGFEImageElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGFEImageElement> impl) |
|
158 : JSSVGElement(structure, globalObject, impl) |
|
159 { |
|
160 } |
|
161 |
|
162 JSObject* JSSVGFEImageElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
163 { |
|
164 return new (exec) JSSVGFEImageElementPrototype(globalObject, JSSVGFEImageElementPrototype::createStructure(JSSVGElementPrototype::self(exec, globalObject))); |
|
165 } |
|
166 |
|
167 bool JSSVGFEImageElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
168 { |
|
169 return getStaticValueSlot<JSSVGFEImageElement, Base>(exec, &JSSVGFEImageElementTable, this, propertyName, slot); |
|
170 } |
|
171 |
|
172 bool JSSVGFEImageElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
173 { |
|
174 return getStaticValueDescriptor<JSSVGFEImageElement, Base>(exec, &JSSVGFEImageElementTable, this, propertyName, descriptor); |
|
175 } |
|
176 |
|
177 JSValue jsSVGFEImageElementPreserveAspectRatio(ExecState* exec, JSValue slotBase, const Identifier&) |
|
178 { |
|
179 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
180 UNUSED_PARAM(exec); |
|
181 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
182 RefPtr<SVGAnimatedPreserveAspectRatio> obj = imp->preserveAspectRatioAnimated(); |
|
183 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
184 return result; |
|
185 } |
|
186 |
|
187 JSValue jsSVGFEImageElementHref(ExecState* exec, JSValue slotBase, const Identifier&) |
|
188 { |
|
189 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
190 UNUSED_PARAM(exec); |
|
191 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
192 RefPtr<SVGAnimatedString> obj = imp->hrefAnimated(); |
|
193 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
194 return result; |
|
195 } |
|
196 |
|
197 JSValue jsSVGFEImageElementXmllang(ExecState* exec, JSValue slotBase, const Identifier&) |
|
198 { |
|
199 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
200 UNUSED_PARAM(exec); |
|
201 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
202 JSValue result = jsString(exec, imp->xmllang()); |
|
203 return result; |
|
204 } |
|
205 |
|
206 JSValue jsSVGFEImageElementXmlspace(ExecState* exec, JSValue slotBase, const Identifier&) |
|
207 { |
|
208 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
209 UNUSED_PARAM(exec); |
|
210 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
211 JSValue result = jsString(exec, imp->xmlspace()); |
|
212 return result; |
|
213 } |
|
214 |
|
215 JSValue jsSVGFEImageElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&) |
|
216 { |
|
217 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
218 UNUSED_PARAM(exec); |
|
219 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
220 RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated(); |
|
221 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
222 return result; |
|
223 } |
|
224 |
|
225 JSValue jsSVGFEImageElementX(ExecState* exec, JSValue slotBase, const Identifier&) |
|
226 { |
|
227 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
228 UNUSED_PARAM(exec); |
|
229 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
230 RefPtr<SVGAnimatedLength> obj = imp->xAnimated(); |
|
231 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
232 return result; |
|
233 } |
|
234 |
|
235 JSValue jsSVGFEImageElementY(ExecState* exec, JSValue slotBase, const Identifier&) |
|
236 { |
|
237 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
238 UNUSED_PARAM(exec); |
|
239 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
240 RefPtr<SVGAnimatedLength> obj = imp->yAnimated(); |
|
241 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
242 return result; |
|
243 } |
|
244 |
|
245 JSValue jsSVGFEImageElementWidth(ExecState* exec, JSValue slotBase, const Identifier&) |
|
246 { |
|
247 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
248 UNUSED_PARAM(exec); |
|
249 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
250 RefPtr<SVGAnimatedLength> obj = imp->widthAnimated(); |
|
251 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
252 return result; |
|
253 } |
|
254 |
|
255 JSValue jsSVGFEImageElementHeight(ExecState* exec, JSValue slotBase, const Identifier&) |
|
256 { |
|
257 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
258 UNUSED_PARAM(exec); |
|
259 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
260 RefPtr<SVGAnimatedLength> obj = imp->heightAnimated(); |
|
261 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
262 return result; |
|
263 } |
|
264 |
|
265 JSValue jsSVGFEImageElementResult(ExecState* exec, JSValue slotBase, const Identifier&) |
|
266 { |
|
267 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
268 UNUSED_PARAM(exec); |
|
269 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
270 RefPtr<SVGAnimatedString> obj = imp->resultAnimated(); |
|
271 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
272 return result; |
|
273 } |
|
274 |
|
275 JSValue jsSVGFEImageElementClassName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
276 { |
|
277 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
278 UNUSED_PARAM(exec); |
|
279 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
280 RefPtr<SVGAnimatedString> obj = imp->classNameAnimated(); |
|
281 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
282 return result; |
|
283 } |
|
284 |
|
285 JSValue jsSVGFEImageElementStyle(ExecState* exec, JSValue slotBase, const Identifier&) |
|
286 { |
|
287 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
288 UNUSED_PARAM(exec); |
|
289 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
290 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style())); |
|
291 return result; |
|
292 } |
|
293 |
|
294 JSValue jsSVGFEImageElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
295 { |
|
296 JSSVGFEImageElement* domObject = static_cast<JSSVGFEImageElement*>(asObject(slotBase)); |
|
297 return JSSVGFEImageElement::getConstructor(exec, domObject->globalObject()); |
|
298 } |
|
299 void JSSVGFEImageElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
300 { |
|
301 lookupPut<JSSVGFEImageElement, Base>(exec, propertyName, value, &JSSVGFEImageElementTable, this, slot); |
|
302 } |
|
303 |
|
304 void setJSSVGFEImageElementXmllang(ExecState* exec, JSObject* thisObject, JSValue value) |
|
305 { |
|
306 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(thisObject); |
|
307 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
308 imp->setXmllang(ustringToString(value.toString(exec))); |
|
309 } |
|
310 |
|
311 void setJSSVGFEImageElementXmlspace(ExecState* exec, JSObject* thisObject, JSValue value) |
|
312 { |
|
313 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(thisObject); |
|
314 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
315 imp->setXmlspace(ustringToString(value.toString(exec))); |
|
316 } |
|
317 |
|
318 JSValue JSSVGFEImageElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
319 { |
|
320 return getDOMConstructor<JSSVGFEImageElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
321 } |
|
322 |
|
323 EncodedJSValue JSC_HOST_CALL jsSVGFEImageElementPrototypeFunctionGetPresentationAttribute(ExecState* exec) |
|
324 { |
|
325 JSValue thisValue = exec->hostThisValue(); |
|
326 if (!thisValue.inherits(&JSSVGFEImageElement::s_info)) |
|
327 return throwVMTypeError(exec); |
|
328 JSSVGFEImageElement* castedThis = static_cast<JSSVGFEImageElement*>(asObject(thisValue)); |
|
329 SVGFEImageElement* imp = static_cast<SVGFEImageElement*>(castedThis->impl()); |
|
330 const String& name = ustringToString(exec->argument(0).toString(exec)); |
|
331 |
|
332 |
|
333 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getPresentationAttribute(name))); |
|
334 return JSValue::encode(result); |
|
335 } |
|
336 |
|
337 |
|
338 } |
|
339 |
|
340 #endif // ENABLE(SVG) && ENABLE(FILTERS) |