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