2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
25 #include "JSSVGRect.h"
27 #include "ExceptionCode.h"
29 #include <runtime/Error.h>
30 #include <wtf/GetPtr.h>
36 ASSERT_CLASS_FITS_IN_CELL(JSSVGRect);
40 #define THUNK_GENERATOR(generator) , generator
42 #define THUNK_GENERATOR(generator)
45 #define INTRINSIC(intrinsic) , intrinsic
47 #define INTRINSIC(intrinsic)
50 static const HashTableValue JSSVGRectTableValues[] =
52 { "x", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRectX), (intptr_t)setJSSVGRectX THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { "y", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRectY), (intptr_t)setJSSVGRectY THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54 { "width", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRectWidth), (intptr_t)setJSSVGRectWidth THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55 { "height", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRectHeight), (intptr_t)setJSSVGRectHeight THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGRectConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
60 #undef THUNK_GENERATOR
61 static const HashTable JSSVGRectTable = { 17, 15, JSSVGRectTableValues, 0 };
62 /* Hash table for constructor */
64 #define THUNK_GENERATOR(generator) , generator
66 #define THUNK_GENERATOR(generator)
69 #define INTRINSIC(intrinsic) , intrinsic
71 #define INTRINSIC(intrinsic)
74 static const HashTableValue JSSVGRectConstructorTableValues[] =
76 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
79 #undef THUNK_GENERATOR
80 static const HashTable JSSVGRectConstructorTable = { 1, 0, JSSVGRectConstructorTableValues, 0 };
81 const ClassInfo JSSVGRectConstructor::s_info = { "SVGRectConstructor", &DOMConstructorObject::s_info, &JSSVGRectConstructorTable, 0, CREATE_METHOD_TABLE(JSSVGRectConstructor) };
83 JSSVGRectConstructor::JSSVGRectConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
84 : DOMConstructorObject(structure, globalObject)
88 void JSSVGRectConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
90 Base::finishCreation(exec->globalData());
91 ASSERT(inherits(&s_info));
92 putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGRectPrototype::self(exec, globalObject), DontDelete | ReadOnly);
95 bool JSSVGRectConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
97 return getStaticValueSlot<JSSVGRectConstructor, JSDOMWrapper>(exec, &JSSVGRectConstructorTable, static_cast<JSSVGRectConstructor*>(cell), propertyName, slot);
100 bool JSSVGRectConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
102 return getStaticValueDescriptor<JSSVGRectConstructor, JSDOMWrapper>(exec, &JSSVGRectConstructorTable, static_cast<JSSVGRectConstructor*>(object), propertyName, descriptor);
105 /* Hash table for prototype */
107 #define THUNK_GENERATOR(generator) , generator
109 #define THUNK_GENERATOR(generator)
112 #define INTRINSIC(intrinsic) , intrinsic
114 #define INTRINSIC(intrinsic)
117 static const HashTableValue JSSVGRectPrototypeTableValues[] =
119 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
122 #undef THUNK_GENERATOR
123 static const HashTable JSSVGRectPrototypeTable = { 1, 0, JSSVGRectPrototypeTableValues, 0 };
124 const ClassInfo JSSVGRectPrototype::s_info = { "SVGRectPrototype", &JSC::JSNonFinalObject::s_info, &JSSVGRectPrototypeTable, 0, CREATE_METHOD_TABLE(JSSVGRectPrototype) };
126 JSObject* JSSVGRectPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
128 return getDOMPrototype<JSSVGRect>(exec, globalObject);
131 const ClassInfo JSSVGRect::s_info = { "SVGRect", &JSDOMWrapper::s_info, &JSSVGRectTable, 0 , CREATE_METHOD_TABLE(JSSVGRect) };
133 JSSVGRect::JSSVGRect(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGPropertyTearOff<FloatRect> > impl)
134 : JSDOMWrapper(structure, globalObject)
135 , m_impl(impl.leakRef())
139 void JSSVGRect::finishCreation(JSGlobalData& globalData)
141 Base::finishCreation(globalData);
142 ASSERT(inherits(&s_info));
145 JSObject* JSSVGRect::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
147 return JSSVGRectPrototype::create(exec->globalData(), globalObject, JSSVGRectPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
150 bool JSSVGRect::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
152 JSSVGRect* thisObject = jsCast<JSSVGRect*>(cell);
153 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
154 return getStaticValueSlot<JSSVGRect, Base>(exec, &JSSVGRectTable, thisObject, propertyName, slot);
157 bool JSSVGRect::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
159 JSSVGRect* thisObject = jsCast<JSSVGRect*>(object);
160 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
161 return getStaticValueDescriptor<JSSVGRect, Base>(exec, &JSSVGRectTable, thisObject, propertyName, descriptor);
164 JSValue jsSVGRectX(ExecState* exec, JSValue slotBase, const Identifier&)
166 JSSVGRect* castedThis = static_cast<JSSVGRect*>(asObject(slotBase));
168 FloatRect& imp = castedThis->impl()->propertyReference();
169 JSValue result = jsNumber(imp.x());
174 JSValue jsSVGRectY(ExecState* exec, JSValue slotBase, const Identifier&)
176 JSSVGRect* castedThis = static_cast<JSSVGRect*>(asObject(slotBase));
178 FloatRect& imp = castedThis->impl()->propertyReference();
179 JSValue result = jsNumber(imp.y());
184 JSValue jsSVGRectWidth(ExecState* exec, JSValue slotBase, const Identifier&)
186 JSSVGRect* castedThis = static_cast<JSSVGRect*>(asObject(slotBase));
188 FloatRect& imp = castedThis->impl()->propertyReference();
189 JSValue result = jsNumber(imp.width());
194 JSValue jsSVGRectHeight(ExecState* exec, JSValue slotBase, const Identifier&)
196 JSSVGRect* castedThis = static_cast<JSSVGRect*>(asObject(slotBase));
198 FloatRect& imp = castedThis->impl()->propertyReference();
199 JSValue result = jsNumber(imp.height());
204 JSValue jsSVGRectConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
206 JSSVGRect* domObject = static_cast<JSSVGRect*>(asObject(slotBase));
207 return JSSVGRect::getConstructor(exec, domObject->globalObject());
210 void JSSVGRect::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
212 JSSVGRect* thisObject = jsCast<JSSVGRect*>(cell);
213 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
214 lookupPut<JSSVGRect, Base>(exec, propertyName, value, &JSSVGRectTable, thisObject, slot);
217 void setJSSVGRectX(ExecState* exec, JSObject* thisObject, JSValue value)
219 JSSVGRect* castedThis = static_cast<JSSVGRect*>(thisObject);
220 SVGPropertyTearOff<FloatRect> * imp = static_cast<SVGPropertyTearOff<FloatRect> *>(castedThis->impl());
221 if (imp->role() == AnimValRole) {
222 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
225 FloatRect& podImp = imp->propertyReference();
226 podImp.setX(value.toFloat(exec));
231 void setJSSVGRectY(ExecState* exec, JSObject* thisObject, JSValue value)
233 JSSVGRect* castedThis = static_cast<JSSVGRect*>(thisObject);
234 SVGPropertyTearOff<FloatRect> * imp = static_cast<SVGPropertyTearOff<FloatRect> *>(castedThis->impl());
235 if (imp->role() == AnimValRole) {
236 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
239 FloatRect& podImp = imp->propertyReference();
240 podImp.setY(value.toFloat(exec));
245 void setJSSVGRectWidth(ExecState* exec, JSObject* thisObject, JSValue value)
247 JSSVGRect* castedThis = static_cast<JSSVGRect*>(thisObject);
248 SVGPropertyTearOff<FloatRect> * imp = static_cast<SVGPropertyTearOff<FloatRect> *>(castedThis->impl());
249 if (imp->role() == AnimValRole) {
250 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
253 FloatRect& podImp = imp->propertyReference();
254 podImp.setWidth(value.toFloat(exec));
259 void setJSSVGRectHeight(ExecState* exec, JSObject* thisObject, JSValue value)
261 JSSVGRect* castedThis = static_cast<JSSVGRect*>(thisObject);
262 SVGPropertyTearOff<FloatRect> * imp = static_cast<SVGPropertyTearOff<FloatRect> *>(castedThis->impl());
263 if (imp->role() == AnimValRole) {
264 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
267 FloatRect& podImp = imp->propertyReference();
268 podImp.setHeight(value.toFloat(exec));
273 JSValue JSSVGRect::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
275 return getDOMConstructor<JSSVGRectConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
278 static inline bool isObservable(JSSVGRect* jsSVGRect)
280 if (jsSVGRect->hasCustomProperties())
285 bool JSSVGRectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
287 JSSVGRect* jsSVGRect = static_cast<JSSVGRect*>(handle.get().asCell());
288 if (!isObservable(jsSVGRect))
290 UNUSED_PARAM(visitor);
294 void JSSVGRectOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
296 JSSVGRect* jsSVGRect = static_cast<JSSVGRect*>(handle.get().asCell());
297 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
298 uncacheWrapper(world, jsSVGRect->impl(), jsSVGRect);
299 jsSVGRect->releaseImpl();
302 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGPropertyTearOff<FloatRect> * impl)
304 return wrap<JSSVGRect, SVGPropertyTearOff<FloatRect> >(exec, globalObject, impl);
307 SVGPropertyTearOff<FloatRect> * toSVGRect(JSC::JSValue value)
309 return value.inherits(&JSSVGRect::s_info) ? static_cast<JSSVGRect*>(asObject(value))->impl() : 0;
314 #endif // ENABLE(SVG)