tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSSVGViewElement.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(SVG)
24
25 #include "JSSVGViewElement.h"
26
27 #include "JSSVGAnimatedBoolean.h"
28 #include "JSSVGAnimatedPreserveAspectRatio.h"
29 #include "JSSVGAnimatedRect.h"
30 #include "JSSVGStringList.h"
31 #include "SVGStringList.h"
32 #include "SVGViewElement.h"
33 #include <wtf/GetPtr.h>
34
35 using namespace JSC;
36
37 namespace WebCore {
38
39 ASSERT_CLASS_FITS_IN_CELL(JSSVGViewElement);
40
41 /* Hash table */
42 #if ENABLE(JIT)
43 #define THUNK_GENERATOR(generator) , generator
44 #else
45 #define THUNK_GENERATOR(generator)
46 #endif
47 #if ENABLE(DFG_JIT)
48 #define INTRINSIC(intrinsic) , intrinsic
49 #else
50 #define INTRINSIC(intrinsic)
51 #endif
52
53 static const HashTableValue JSSVGViewElementTableValues[] =
54 {
55     { "viewTarget", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementViewTarget), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56     { "externalResourcesRequired", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementExternalResourcesRequired), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57     { "viewBox", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementViewBox), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58     { "preserveAspectRatio", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementPreserveAspectRatio), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59     { "zoomAndPan", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementZoomAndPan), (intptr_t)setJSSVGViewElementZoomAndPan THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
62 };
63
64 #undef THUNK_GENERATOR
65 static const HashTable JSSVGViewElementTable = { 16, 15, JSSVGViewElementTableValues, 0 };
66 /* Hash table for constructor */
67 #if ENABLE(JIT)
68 #define THUNK_GENERATOR(generator) , generator
69 #else
70 #define THUNK_GENERATOR(generator)
71 #endif
72 #if ENABLE(DFG_JIT)
73 #define INTRINSIC(intrinsic) , intrinsic
74 #else
75 #define INTRINSIC(intrinsic)
76 #endif
77
78 static const HashTableValue JSSVGViewElementConstructorTableValues[] =
79 {
80     { "SVG_ZOOMANDPAN_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
81     { "SVG_ZOOMANDPAN_DISABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_DISABLE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
82     { "SVG_ZOOMANDPAN_MAGNIFY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_MAGNIFY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
83     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
84 };
85
86 #undef THUNK_GENERATOR
87 static const HashTable JSSVGViewElementConstructorTable = { 9, 7, JSSVGViewElementConstructorTableValues, 0 };
88
89 COMPILE_ASSERT(0 == SVGViewElement::SVG_ZOOMANDPAN_UNKNOWN, SVGViewElementEnumSVG_ZOOMANDPAN_UNKNOWNIsWrongUseDontCheckEnums);
90 COMPILE_ASSERT(1 == SVGViewElement::SVG_ZOOMANDPAN_DISABLE, SVGViewElementEnumSVG_ZOOMANDPAN_DISABLEIsWrongUseDontCheckEnums);
91 COMPILE_ASSERT(2 == SVGViewElement::SVG_ZOOMANDPAN_MAGNIFY, SVGViewElementEnumSVG_ZOOMANDPAN_MAGNIFYIsWrongUseDontCheckEnums);
92
93 const ClassInfo JSSVGViewElementConstructor::s_info = { "SVGViewElementConstructor", &DOMConstructorObject::s_info, &JSSVGViewElementConstructorTable, 0, CREATE_METHOD_TABLE(JSSVGViewElementConstructor) };
94
95 JSSVGViewElementConstructor::JSSVGViewElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
96     : DOMConstructorObject(structure, globalObject)
97 {
98 }
99
100 void JSSVGViewElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
101 {
102     Base::finishCreation(exec->globalData());
103     ASSERT(inherits(&s_info));
104     putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGViewElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
105 }
106
107 bool JSSVGViewElementConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
108 {
109     return getStaticValueSlot<JSSVGViewElementConstructor, JSDOMWrapper>(exec, &JSSVGViewElementConstructorTable, static_cast<JSSVGViewElementConstructor*>(cell), propertyName, slot);
110 }
111
112 bool JSSVGViewElementConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
113 {
114     return getStaticValueDescriptor<JSSVGViewElementConstructor, JSDOMWrapper>(exec, &JSSVGViewElementConstructorTable, static_cast<JSSVGViewElementConstructor*>(object), propertyName, descriptor);
115 }
116
117 /* Hash table for prototype */
118 #if ENABLE(JIT)
119 #define THUNK_GENERATOR(generator) , generator
120 #else
121 #define THUNK_GENERATOR(generator)
122 #endif
123 #if ENABLE(DFG_JIT)
124 #define INTRINSIC(intrinsic) , intrinsic
125 #else
126 #define INTRINSIC(intrinsic)
127 #endif
128
129 static const HashTableValue JSSVGViewElementPrototypeTableValues[] =
130 {
131     { "SVG_ZOOMANDPAN_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
132     { "SVG_ZOOMANDPAN_DISABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_DISABLE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
133     { "SVG_ZOOMANDPAN_MAGNIFY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_MAGNIFY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
134     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
135 };
136
137 #undef THUNK_GENERATOR
138 static const HashTable JSSVGViewElementPrototypeTable = { 9, 7, JSSVGViewElementPrototypeTableValues, 0 };
139 const ClassInfo JSSVGViewElementPrototype::s_info = { "SVGViewElementPrototype", &JSC::JSNonFinalObject::s_info, &JSSVGViewElementPrototypeTable, 0, CREATE_METHOD_TABLE(JSSVGViewElementPrototype) };
140
141 JSObject* JSSVGViewElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
142 {
143     return getDOMPrototype<JSSVGViewElement>(exec, globalObject);
144 }
145
146 bool JSSVGViewElementPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
147 {
148     JSSVGViewElementPrototype* thisObject = jsCast<JSSVGViewElementPrototype*>(cell);
149     return getStaticValueSlot<JSSVGViewElementPrototype, JSObject>(exec, &JSSVGViewElementPrototypeTable, thisObject, propertyName, slot);
150 }
151
152 bool JSSVGViewElementPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
153 {
154     JSSVGViewElementPrototype* thisObject = jsCast<JSSVGViewElementPrototype*>(object);
155     return getStaticValueDescriptor<JSSVGViewElementPrototype, JSObject>(exec, &JSSVGViewElementPrototypeTable, thisObject, propertyName, descriptor);
156 }
157
158 const ClassInfo JSSVGViewElement::s_info = { "SVGViewElement", &JSSVGElement::s_info, &JSSVGViewElementTable, 0 , CREATE_METHOD_TABLE(JSSVGViewElement) };
159
160 JSSVGViewElement::JSSVGViewElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGViewElement> impl)
161     : JSSVGElement(structure, globalObject, impl)
162 {
163 }
164
165 void JSSVGViewElement::finishCreation(JSGlobalData& globalData)
166 {
167     Base::finishCreation(globalData);
168     ASSERT(inherits(&s_info));
169 }
170
171 JSObject* JSSVGViewElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
172 {
173     return JSSVGViewElementPrototype::create(exec->globalData(), globalObject, JSSVGViewElementPrototype::createStructure(exec->globalData(), globalObject, JSSVGElementPrototype::self(exec, globalObject)));
174 }
175
176 bool JSSVGViewElement::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
177 {
178     JSSVGViewElement* thisObject = jsCast<JSSVGViewElement*>(cell);
179     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
180     return getStaticValueSlot<JSSVGViewElement, Base>(exec, &JSSVGViewElementTable, thisObject, propertyName, slot);
181 }
182
183 bool JSSVGViewElement::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
184 {
185     JSSVGViewElement* thisObject = jsCast<JSSVGViewElement*>(object);
186     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
187     return getStaticValueDescriptor<JSSVGViewElement, Base>(exec, &JSSVGViewElementTable, thisObject, propertyName, descriptor);
188 }
189
190 JSValue jsSVGViewElementViewTarget(ExecState* exec, JSValue slotBase, const Identifier&)
191 {
192     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(asObject(slotBase));
193     UNUSED_PARAM(exec);
194     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
195     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGStaticListPropertyTearOff<SVGStringList>::create(imp, imp->viewTarget())));
196     return result;
197 }
198
199
200 JSValue jsSVGViewElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&)
201 {
202     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(asObject(slotBase));
203     UNUSED_PARAM(exec);
204     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
205     RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated();
206     JSValue result =  toJS(exec, castedThis->globalObject(), obj.get());
207     return result;
208 }
209
210
211 JSValue jsSVGViewElementViewBox(ExecState* exec, JSValue slotBase, const Identifier&)
212 {
213     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(asObject(slotBase));
214     UNUSED_PARAM(exec);
215     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
216     RefPtr<SVGAnimatedRect> obj = imp->viewBoxAnimated();
217     JSValue result =  toJS(exec, castedThis->globalObject(), obj.get());
218     return result;
219 }
220
221
222 JSValue jsSVGViewElementPreserveAspectRatio(ExecState* exec, JSValue slotBase, const Identifier&)
223 {
224     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(asObject(slotBase));
225     UNUSED_PARAM(exec);
226     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
227     RefPtr<SVGAnimatedPreserveAspectRatio> obj = imp->preserveAspectRatioAnimated();
228     JSValue result =  toJS(exec, castedThis->globalObject(), obj.get());
229     return result;
230 }
231
232
233 JSValue jsSVGViewElementZoomAndPan(ExecState* exec, JSValue slotBase, const Identifier&)
234 {
235     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(asObject(slotBase));
236     UNUSED_PARAM(exec);
237     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
238     JSValue result = jsNumber(imp->zoomAndPan());
239     return result;
240 }
241
242
243 JSValue jsSVGViewElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
244 {
245     JSSVGViewElement* domObject = static_cast<JSSVGViewElement*>(asObject(slotBase));
246     return JSSVGViewElement::getConstructor(exec, domObject->globalObject());
247 }
248
249 void JSSVGViewElement::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
250 {
251     JSSVGViewElement* thisObject = jsCast<JSSVGViewElement*>(cell);
252     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
253     lookupPut<JSSVGViewElement, Base>(exec, propertyName, value, &JSSVGViewElementTable, thisObject, slot);
254 }
255
256 void setJSSVGViewElementZoomAndPan(ExecState* exec, JSObject* thisObject, JSValue value)
257 {
258     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(thisObject);
259     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
260     imp->setZoomAndPan(value.toUInt32(exec));
261 }
262
263
264 JSValue JSSVGViewElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
265 {
266     return getDOMConstructor<JSSVGViewElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
267 }
268
269 // Constant getters
270
271 JSValue jsSVGViewElementSVG_ZOOMANDPAN_UNKNOWN(ExecState* exec, JSValue, const Identifier&)
272 {
273     UNUSED_PARAM(exec);
274     return jsNumber(static_cast<int>(0));
275 }
276
277 JSValue jsSVGViewElementSVG_ZOOMANDPAN_DISABLE(ExecState* exec, JSValue, const Identifier&)
278 {
279     UNUSED_PARAM(exec);
280     return jsNumber(static_cast<int>(1));
281 }
282
283 JSValue jsSVGViewElementSVG_ZOOMANDPAN_MAGNIFY(ExecState* exec, JSValue, const Identifier&)
284 {
285     UNUSED_PARAM(exec);
286     return jsNumber(static_cast<int>(2));
287 }
288
289
290 }
291
292 #endif // ENABLE(SVG)