tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSSVGAnimatedInteger.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 "JSSVGAnimatedInteger.h"
26
27 #include <runtime/Error.h>
28 #include <wtf/GetPtr.h>
29
30 using namespace JSC;
31
32 namespace WebCore {
33
34 ASSERT_CLASS_FITS_IN_CELL(JSSVGAnimatedInteger);
35
36 /* Hash table */
37 #if ENABLE(JIT)
38 #define THUNK_GENERATOR(generator) , generator
39 #else
40 #define THUNK_GENERATOR(generator)
41 #endif
42 #if ENABLE(DFG_JIT)
43 #define INTRINSIC(intrinsic) , intrinsic
44 #else
45 #define INTRINSIC(intrinsic)
46 #endif
47
48 static const HashTableValue JSSVGAnimatedIntegerTableValues[] =
49 {
50     { "baseVal", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedIntegerBaseVal), (intptr_t)setJSSVGAnimatedIntegerBaseVal THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51     { "animVal", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedIntegerAnimVal), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedIntegerConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
54 };
55
56 #undef THUNK_GENERATOR
57 static const HashTable JSSVGAnimatedIntegerTable = { 8, 7, JSSVGAnimatedIntegerTableValues, 0 };
58 /* Hash table for constructor */
59 #if ENABLE(JIT)
60 #define THUNK_GENERATOR(generator) , generator
61 #else
62 #define THUNK_GENERATOR(generator)
63 #endif
64 #if ENABLE(DFG_JIT)
65 #define INTRINSIC(intrinsic) , intrinsic
66 #else
67 #define INTRINSIC(intrinsic)
68 #endif
69
70 static const HashTableValue JSSVGAnimatedIntegerConstructorTableValues[] =
71 {
72     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
73 };
74
75 #undef THUNK_GENERATOR
76 static const HashTable JSSVGAnimatedIntegerConstructorTable = { 1, 0, JSSVGAnimatedIntegerConstructorTableValues, 0 };
77 const ClassInfo JSSVGAnimatedIntegerConstructor::s_info = { "SVGAnimatedIntegerConstructor", &DOMConstructorObject::s_info, &JSSVGAnimatedIntegerConstructorTable, 0, CREATE_METHOD_TABLE(JSSVGAnimatedIntegerConstructor) };
78
79 JSSVGAnimatedIntegerConstructor::JSSVGAnimatedIntegerConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
80     : DOMConstructorObject(structure, globalObject)
81 {
82 }
83
84 void JSSVGAnimatedIntegerConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
85 {
86     Base::finishCreation(exec->globalData());
87     ASSERT(inherits(&s_info));
88     putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGAnimatedIntegerPrototype::self(exec, globalObject), DontDelete | ReadOnly);
89 }
90
91 bool JSSVGAnimatedIntegerConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
92 {
93     return getStaticValueSlot<JSSVGAnimatedIntegerConstructor, JSDOMWrapper>(exec, &JSSVGAnimatedIntegerConstructorTable, static_cast<JSSVGAnimatedIntegerConstructor*>(cell), propertyName, slot);
94 }
95
96 bool JSSVGAnimatedIntegerConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
97 {
98     return getStaticValueDescriptor<JSSVGAnimatedIntegerConstructor, JSDOMWrapper>(exec, &JSSVGAnimatedIntegerConstructorTable, static_cast<JSSVGAnimatedIntegerConstructor*>(object), propertyName, descriptor);
99 }
100
101 /* Hash table for prototype */
102 #if ENABLE(JIT)
103 #define THUNK_GENERATOR(generator) , generator
104 #else
105 #define THUNK_GENERATOR(generator)
106 #endif
107 #if ENABLE(DFG_JIT)
108 #define INTRINSIC(intrinsic) , intrinsic
109 #else
110 #define INTRINSIC(intrinsic)
111 #endif
112
113 static const HashTableValue JSSVGAnimatedIntegerPrototypeTableValues[] =
114 {
115     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
116 };
117
118 #undef THUNK_GENERATOR
119 static const HashTable JSSVGAnimatedIntegerPrototypeTable = { 1, 0, JSSVGAnimatedIntegerPrototypeTableValues, 0 };
120 const ClassInfo JSSVGAnimatedIntegerPrototype::s_info = { "SVGAnimatedIntegerPrototype", &JSC::JSNonFinalObject::s_info, &JSSVGAnimatedIntegerPrototypeTable, 0, CREATE_METHOD_TABLE(JSSVGAnimatedIntegerPrototype) };
121
122 JSObject* JSSVGAnimatedIntegerPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
123 {
124     return getDOMPrototype<JSSVGAnimatedInteger>(exec, globalObject);
125 }
126
127 const ClassInfo JSSVGAnimatedInteger::s_info = { "SVGAnimatedInteger", &JSDOMWrapper::s_info, &JSSVGAnimatedIntegerTable, 0 , CREATE_METHOD_TABLE(JSSVGAnimatedInteger) };
128
129 JSSVGAnimatedInteger::JSSVGAnimatedInteger(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGAnimatedInteger> impl)
130     : JSDOMWrapper(structure, globalObject)
131     , m_impl(impl.leakRef())
132 {
133 }
134
135 void JSSVGAnimatedInteger::finishCreation(JSGlobalData& globalData)
136 {
137     Base::finishCreation(globalData);
138     ASSERT(inherits(&s_info));
139 }
140
141 JSObject* JSSVGAnimatedInteger::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
142 {
143     return JSSVGAnimatedIntegerPrototype::create(exec->globalData(), globalObject, JSSVGAnimatedIntegerPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
144 }
145
146 bool JSSVGAnimatedInteger::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
147 {
148     JSSVGAnimatedInteger* thisObject = jsCast<JSSVGAnimatedInteger*>(cell);
149     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
150     return getStaticValueSlot<JSSVGAnimatedInteger, Base>(exec, &JSSVGAnimatedIntegerTable, thisObject, propertyName, slot);
151 }
152
153 bool JSSVGAnimatedInteger::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
154 {
155     JSSVGAnimatedInteger* thisObject = jsCast<JSSVGAnimatedInteger*>(object);
156     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
157     return getStaticValueDescriptor<JSSVGAnimatedInteger, Base>(exec, &JSSVGAnimatedIntegerTable, thisObject, propertyName, descriptor);
158 }
159
160 JSValue jsSVGAnimatedIntegerBaseVal(ExecState* exec, JSValue slotBase, const Identifier&)
161 {
162     JSSVGAnimatedInteger* castedThis = static_cast<JSSVGAnimatedInteger*>(asObject(slotBase));
163     UNUSED_PARAM(exec);
164     SVGAnimatedInteger* imp = static_cast<SVGAnimatedInteger*>(castedThis->impl());
165     JSValue result = jsNumber(imp->baseVal());
166     return result;
167 }
168
169
170 JSValue jsSVGAnimatedIntegerAnimVal(ExecState* exec, JSValue slotBase, const Identifier&)
171 {
172     JSSVGAnimatedInteger* castedThis = static_cast<JSSVGAnimatedInteger*>(asObject(slotBase));
173     UNUSED_PARAM(exec);
174     SVGAnimatedInteger* imp = static_cast<SVGAnimatedInteger*>(castedThis->impl());
175     JSValue result = jsNumber(imp->animVal());
176     return result;
177 }
178
179
180 JSValue jsSVGAnimatedIntegerConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
181 {
182     JSSVGAnimatedInteger* domObject = static_cast<JSSVGAnimatedInteger*>(asObject(slotBase));
183     return JSSVGAnimatedInteger::getConstructor(exec, domObject->globalObject());
184 }
185
186 void JSSVGAnimatedInteger::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
187 {
188     JSSVGAnimatedInteger* thisObject = jsCast<JSSVGAnimatedInteger*>(cell);
189     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
190     lookupPut<JSSVGAnimatedInteger, Base>(exec, propertyName, value, &JSSVGAnimatedIntegerTable, thisObject, slot);
191 }
192
193 void setJSSVGAnimatedIntegerBaseVal(ExecState* exec, JSObject* thisObject, JSValue value)
194 {
195     JSSVGAnimatedInteger* castedThis = static_cast<JSSVGAnimatedInteger*>(thisObject);
196     SVGAnimatedInteger* imp = static_cast<SVGAnimatedInteger*>(castedThis->impl());
197     ExceptionCode ec = 0;
198     imp->setBaseVal(value.toInt32(exec), ec);
199     setDOMException(exec, ec);
200 }
201
202
203 JSValue JSSVGAnimatedInteger::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
204 {
205     return getDOMConstructor<JSSVGAnimatedIntegerConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
206 }
207
208 static inline bool isObservable(JSSVGAnimatedInteger* jsSVGAnimatedInteger)
209 {
210     if (jsSVGAnimatedInteger->hasCustomProperties())
211         return true;
212     return false;
213 }
214
215 bool JSSVGAnimatedIntegerOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
216 {
217     JSSVGAnimatedInteger* jsSVGAnimatedInteger = static_cast<JSSVGAnimatedInteger*>(handle.get().asCell());
218     if (!isObservable(jsSVGAnimatedInteger))
219         return false;
220     UNUSED_PARAM(visitor);
221     return false;
222 }
223
224 void JSSVGAnimatedIntegerOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
225 {
226     JSSVGAnimatedInteger* jsSVGAnimatedInteger = static_cast<JSSVGAnimatedInteger*>(handle.get().asCell());
227     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
228     uncacheWrapper(world, jsSVGAnimatedInteger->impl(), jsSVGAnimatedInteger);
229     jsSVGAnimatedInteger->releaseImpl();
230 }
231
232 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGAnimatedInteger* impl)
233 {
234     return wrap<JSSVGAnimatedInteger>(exec, globalObject, impl);
235 }
236
237 SVGAnimatedInteger* toSVGAnimatedInteger(JSC::JSValue value)
238 {
239     return value.inherits(&JSSVGAnimatedInteger::s_info) ? static_cast<JSSVGAnimatedInteger*>(asObject(value))->impl() : 0;
240 }
241
242 }
243
244 #endif // ENABLE(SVG)