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