tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSSVGElementInstanceList.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 "JSSVGElementInstanceList.h"
26
27 #include "ExceptionCode.h"
28 #include "JSDOMBinding.h"
29 #include "JSSVGElementInstance.h"
30 #include "SVGElementInstance.h"
31 #include "SVGElementInstanceList.h"
32 #include <runtime/Error.h>
33 #include <wtf/GetPtr.h>
34
35 using namespace JSC;
36
37 namespace WebCore {
38
39 ASSERT_CLASS_FITS_IN_CELL(JSSVGElementInstanceList);
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 JSSVGElementInstanceListTableValues[] =
54 {
55     { "length", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGElementInstanceListLength), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGElementInstanceListConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
58 };
59
60 #undef THUNK_GENERATOR
61 static const HashTable JSSVGElementInstanceListTable = { 5, 3, JSSVGElementInstanceListTableValues, 0 };
62 /* Hash table for constructor */
63 #if ENABLE(JIT)
64 #define THUNK_GENERATOR(generator) , generator
65 #else
66 #define THUNK_GENERATOR(generator)
67 #endif
68 #if ENABLE(DFG_JIT)
69 #define INTRINSIC(intrinsic) , intrinsic
70 #else
71 #define INTRINSIC(intrinsic)
72 #endif
73
74 static const HashTableValue JSSVGElementInstanceListConstructorTableValues[] =
75 {
76     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
77 };
78
79 #undef THUNK_GENERATOR
80 static const HashTable JSSVGElementInstanceListConstructorTable = { 1, 0, JSSVGElementInstanceListConstructorTableValues, 0 };
81 const ClassInfo JSSVGElementInstanceListConstructor::s_info = { "SVGElementInstanceListConstructor", &DOMConstructorObject::s_info, &JSSVGElementInstanceListConstructorTable, 0, CREATE_METHOD_TABLE(JSSVGElementInstanceListConstructor) };
82
83 JSSVGElementInstanceListConstructor::JSSVGElementInstanceListConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
84     : DOMConstructorObject(structure, globalObject)
85 {
86 }
87
88 void JSSVGElementInstanceListConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
89 {
90     Base::finishCreation(exec->globalData());
91     ASSERT(inherits(&s_info));
92     putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGElementInstanceListPrototype::self(exec, globalObject), DontDelete | ReadOnly);
93 }
94
95 bool JSSVGElementInstanceListConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
96 {
97     return getStaticValueSlot<JSSVGElementInstanceListConstructor, JSDOMWrapper>(exec, &JSSVGElementInstanceListConstructorTable, static_cast<JSSVGElementInstanceListConstructor*>(cell), propertyName, slot);
98 }
99
100 bool JSSVGElementInstanceListConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
101 {
102     return getStaticValueDescriptor<JSSVGElementInstanceListConstructor, JSDOMWrapper>(exec, &JSSVGElementInstanceListConstructorTable, static_cast<JSSVGElementInstanceListConstructor*>(object), propertyName, descriptor);
103 }
104
105 /* Hash table for prototype */
106 #if ENABLE(JIT)
107 #define THUNK_GENERATOR(generator) , generator
108 #else
109 #define THUNK_GENERATOR(generator)
110 #endif
111 #if ENABLE(DFG_JIT)
112 #define INTRINSIC(intrinsic) , intrinsic
113 #else
114 #define INTRINSIC(intrinsic)
115 #endif
116
117 static const HashTableValue JSSVGElementInstanceListPrototypeTableValues[] =
118 {
119     { "item", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGElementInstanceListPrototypeFunctionItem), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
120     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
121 };
122
123 #undef THUNK_GENERATOR
124 static const HashTable JSSVGElementInstanceListPrototypeTable = { 2, 1, JSSVGElementInstanceListPrototypeTableValues, 0 };
125 const ClassInfo JSSVGElementInstanceListPrototype::s_info = { "SVGElementInstanceListPrototype", &JSC::JSNonFinalObject::s_info, &JSSVGElementInstanceListPrototypeTable, 0, CREATE_METHOD_TABLE(JSSVGElementInstanceListPrototype) };
126
127 JSObject* JSSVGElementInstanceListPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
128 {
129     return getDOMPrototype<JSSVGElementInstanceList>(exec, globalObject);
130 }
131
132 bool JSSVGElementInstanceListPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
133 {
134     JSSVGElementInstanceListPrototype* thisObject = jsCast<JSSVGElementInstanceListPrototype*>(cell);
135     return getStaticFunctionSlot<JSObject>(exec, &JSSVGElementInstanceListPrototypeTable, thisObject, propertyName, slot);
136 }
137
138 bool JSSVGElementInstanceListPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
139 {
140     JSSVGElementInstanceListPrototype* thisObject = jsCast<JSSVGElementInstanceListPrototype*>(object);
141     return getStaticFunctionDescriptor<JSObject>(exec, &JSSVGElementInstanceListPrototypeTable, thisObject, propertyName, descriptor);
142 }
143
144 const ClassInfo JSSVGElementInstanceList::s_info = { "SVGElementInstanceList", &JSDOMWrapper::s_info, &JSSVGElementInstanceListTable, 0 , CREATE_METHOD_TABLE(JSSVGElementInstanceList) };
145
146 JSSVGElementInstanceList::JSSVGElementInstanceList(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGElementInstanceList> impl)
147     : JSDOMWrapper(structure, globalObject)
148     , m_impl(impl.leakRef())
149 {
150 }
151
152 void JSSVGElementInstanceList::finishCreation(JSGlobalData& globalData)
153 {
154     Base::finishCreation(globalData);
155     ASSERT(inherits(&s_info));
156 }
157
158 JSObject* JSSVGElementInstanceList::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
159 {
160     return JSSVGElementInstanceListPrototype::create(exec->globalData(), globalObject, JSSVGElementInstanceListPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
161 }
162
163 bool JSSVGElementInstanceList::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
164 {
165     JSSVGElementInstanceList* thisObject = jsCast<JSSVGElementInstanceList*>(cell);
166     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
167     return getStaticValueSlot<JSSVGElementInstanceList, Base>(exec, &JSSVGElementInstanceListTable, thisObject, propertyName, slot);
168 }
169
170 bool JSSVGElementInstanceList::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
171 {
172     JSSVGElementInstanceList* thisObject = jsCast<JSSVGElementInstanceList*>(object);
173     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
174     return getStaticValueDescriptor<JSSVGElementInstanceList, Base>(exec, &JSSVGElementInstanceListTable, thisObject, propertyName, descriptor);
175 }
176
177 JSValue jsSVGElementInstanceListLength(ExecState* exec, JSValue slotBase, const Identifier&)
178 {
179     JSSVGElementInstanceList* castedThis = static_cast<JSSVGElementInstanceList*>(asObject(slotBase));
180     UNUSED_PARAM(exec);
181     SVGElementInstanceList* imp = static_cast<SVGElementInstanceList*>(castedThis->impl());
182     JSValue result = jsNumber(imp->length());
183     return result;
184 }
185
186
187 JSValue jsSVGElementInstanceListConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
188 {
189     JSSVGElementInstanceList* domObject = static_cast<JSSVGElementInstanceList*>(asObject(slotBase));
190     return JSSVGElementInstanceList::getConstructor(exec, domObject->globalObject());
191 }
192
193 JSValue JSSVGElementInstanceList::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
194 {
195     return getDOMConstructor<JSSVGElementInstanceListConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
196 }
197
198 EncodedJSValue JSC_HOST_CALL jsSVGElementInstanceListPrototypeFunctionItem(ExecState* exec)
199 {
200     JSValue thisValue = exec->hostThisValue();
201     if (!thisValue.inherits(&JSSVGElementInstanceList::s_info))
202         return throwVMTypeError(exec);
203     JSSVGElementInstanceList* castedThis = static_cast<JSSVGElementInstanceList*>(asObject(thisValue));
204     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGElementInstanceList::s_info);
205     SVGElementInstanceList* imp = static_cast<SVGElementInstanceList*>(castedThis->impl());
206     unsigned index(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toUInt32(exec));
207     if (exec->hadException())
208         return JSValue::encode(jsUndefined());
209
210     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->item(index)));
211     return JSValue::encode(result);
212 }
213
214 static inline bool isObservable(JSSVGElementInstanceList* jsSVGElementInstanceList)
215 {
216     if (jsSVGElementInstanceList->hasCustomProperties())
217         return true;
218     return false;
219 }
220
221 bool JSSVGElementInstanceListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
222 {
223     JSSVGElementInstanceList* jsSVGElementInstanceList = static_cast<JSSVGElementInstanceList*>(handle.get().asCell());
224     if (!isObservable(jsSVGElementInstanceList))
225         return false;
226     UNUSED_PARAM(visitor);
227     return false;
228 }
229
230 void JSSVGElementInstanceListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
231 {
232     JSSVGElementInstanceList* jsSVGElementInstanceList = static_cast<JSSVGElementInstanceList*>(handle.get().asCell());
233     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
234     uncacheWrapper(world, jsSVGElementInstanceList->impl(), jsSVGElementInstanceList);
235     jsSVGElementInstanceList->releaseImpl();
236 }
237
238 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGElementInstanceList* impl)
239 {
240     return wrap<JSSVGElementInstanceList>(exec, globalObject, impl);
241 }
242
243 SVGElementInstanceList* toSVGElementInstanceList(JSC::JSValue value)
244 {
245     return value.inherits(&JSSVGElementInstanceList::s_info) ? static_cast<JSSVGElementInstanceList*>(asObject(value))->impl() : 0;
246 }
247
248 }
249
250 #endif // ENABLE(SVG)