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 "JSSVGPoint.h"
27 #include "ExceptionCode.h"
28 #include "JSDOMBinding.h"
29 #include "JSSVGMatrix.h"
30 #include "JSSVGPoint.h"
31 #include <runtime/Error.h>
32 #include <wtf/GetPtr.h>
38 ASSERT_CLASS_FITS_IN_CELL(JSSVGPoint);
42 #define THUNK_GENERATOR(generator) , generator
44 #define THUNK_GENERATOR(generator)
47 #define INTRINSIC(intrinsic) , intrinsic
49 #define INTRINSIC(intrinsic)
52 static const HashTableValue JSSVGPointTableValues[] =
54 { "x", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPointX), (intptr_t)setJSSVGPointX THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55 { "y", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPointY), (intptr_t)setJSSVGPointY THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPointConstructor), (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 JSSVGPointTable = { 9, 7, JSSVGPointTableValues, 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 JSSVGPointConstructorTableValues[] =
76 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
79 #undef THUNK_GENERATOR
80 static const HashTable JSSVGPointConstructorTable = { 1, 0, JSSVGPointConstructorTableValues, 0 };
81 const ClassInfo JSSVGPointConstructor::s_info = { "SVGPointConstructor", &DOMConstructorObject::s_info, &JSSVGPointConstructorTable, 0, CREATE_METHOD_TABLE(JSSVGPointConstructor) };
83 JSSVGPointConstructor::JSSVGPointConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
84 : DOMConstructorObject(structure, globalObject)
88 void JSSVGPointConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
90 Base::finishCreation(exec->globalData());
91 ASSERT(inherits(&s_info));
92 putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGPointPrototype::self(exec, globalObject), DontDelete | ReadOnly);
95 bool JSSVGPointConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
97 return getStaticValueSlot<JSSVGPointConstructor, JSDOMWrapper>(exec, &JSSVGPointConstructorTable, static_cast<JSSVGPointConstructor*>(cell), propertyName, slot);
100 bool JSSVGPointConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
102 return getStaticValueDescriptor<JSSVGPointConstructor, JSDOMWrapper>(exec, &JSSVGPointConstructorTable, static_cast<JSSVGPointConstructor*>(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 JSSVGPointPrototypeTableValues[] =
119 { "matrixTransform", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGPointPrototypeFunctionMatrixTransform), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
120 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
123 #undef THUNK_GENERATOR
124 static const HashTable JSSVGPointPrototypeTable = { 2, 1, JSSVGPointPrototypeTableValues, 0 };
125 const ClassInfo JSSVGPointPrototype::s_info = { "SVGPointPrototype", &JSC::JSNonFinalObject::s_info, &JSSVGPointPrototypeTable, 0, CREATE_METHOD_TABLE(JSSVGPointPrototype) };
127 JSObject* JSSVGPointPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
129 return getDOMPrototype<JSSVGPoint>(exec, globalObject);
132 bool JSSVGPointPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
134 JSSVGPointPrototype* thisObject = jsCast<JSSVGPointPrototype*>(cell);
135 return getStaticFunctionSlot<JSObject>(exec, &JSSVGPointPrototypeTable, thisObject, propertyName, slot);
138 bool JSSVGPointPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
140 JSSVGPointPrototype* thisObject = jsCast<JSSVGPointPrototype*>(object);
141 return getStaticFunctionDescriptor<JSObject>(exec, &JSSVGPointPrototypeTable, thisObject, propertyName, descriptor);
144 const ClassInfo JSSVGPoint::s_info = { "SVGPoint", &JSDOMWrapper::s_info, &JSSVGPointTable, 0 , CREATE_METHOD_TABLE(JSSVGPoint) };
146 JSSVGPoint::JSSVGPoint(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGPropertyTearOff<FloatPoint> > impl)
147 : JSDOMWrapper(structure, globalObject)
148 , m_impl(impl.leakRef())
152 void JSSVGPoint::finishCreation(JSGlobalData& globalData)
154 Base::finishCreation(globalData);
155 ASSERT(inherits(&s_info));
158 JSObject* JSSVGPoint::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
160 return JSSVGPointPrototype::create(exec->globalData(), globalObject, JSSVGPointPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
163 bool JSSVGPoint::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
165 JSSVGPoint* thisObject = jsCast<JSSVGPoint*>(cell);
166 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
167 return getStaticValueSlot<JSSVGPoint, Base>(exec, &JSSVGPointTable, thisObject, propertyName, slot);
170 bool JSSVGPoint::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
172 JSSVGPoint* thisObject = jsCast<JSSVGPoint*>(object);
173 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
174 return getStaticValueDescriptor<JSSVGPoint, Base>(exec, &JSSVGPointTable, thisObject, propertyName, descriptor);
177 JSValue jsSVGPointX(ExecState* exec, JSValue slotBase, const Identifier&)
179 JSSVGPoint* castedThis = static_cast<JSSVGPoint*>(asObject(slotBase));
181 FloatPoint& imp = castedThis->impl()->propertyReference();
182 JSValue result = jsNumber(imp.x());
187 JSValue jsSVGPointY(ExecState* exec, JSValue slotBase, const Identifier&)
189 JSSVGPoint* castedThis = static_cast<JSSVGPoint*>(asObject(slotBase));
191 FloatPoint& imp = castedThis->impl()->propertyReference();
192 JSValue result = jsNumber(imp.y());
197 JSValue jsSVGPointConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
199 JSSVGPoint* domObject = static_cast<JSSVGPoint*>(asObject(slotBase));
200 return JSSVGPoint::getConstructor(exec, domObject->globalObject());
203 void JSSVGPoint::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
205 JSSVGPoint* thisObject = jsCast<JSSVGPoint*>(cell);
206 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
207 lookupPut<JSSVGPoint, Base>(exec, propertyName, value, &JSSVGPointTable, thisObject, slot);
210 void setJSSVGPointX(ExecState* exec, JSObject* thisObject, JSValue value)
212 JSSVGPoint* castedThis = static_cast<JSSVGPoint*>(thisObject);
213 SVGPropertyTearOff<FloatPoint> * imp = static_cast<SVGPropertyTearOff<FloatPoint> *>(castedThis->impl());
214 if (imp->role() == AnimValRole) {
215 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
218 FloatPoint& podImp = imp->propertyReference();
219 podImp.setX(value.toFloat(exec));
224 void setJSSVGPointY(ExecState* exec, JSObject* thisObject, JSValue value)
226 JSSVGPoint* castedThis = static_cast<JSSVGPoint*>(thisObject);
227 SVGPropertyTearOff<FloatPoint> * imp = static_cast<SVGPropertyTearOff<FloatPoint> *>(castedThis->impl());
228 if (imp->role() == AnimValRole) {
229 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
232 FloatPoint& podImp = imp->propertyReference();
233 podImp.setY(value.toFloat(exec));
238 JSValue JSSVGPoint::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
240 return getDOMConstructor<JSSVGPointConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
243 EncodedJSValue JSC_HOST_CALL jsSVGPointPrototypeFunctionMatrixTransform(ExecState* exec)
245 JSValue thisValue = exec->hostThisValue();
246 if (!thisValue.inherits(&JSSVGPoint::s_info))
247 return throwVMTypeError(exec);
248 JSSVGPoint* castedThis = static_cast<JSSVGPoint*>(asObject(thisValue));
249 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGPoint::s_info);
250 SVGPropertyTearOff<FloatPoint> * imp = static_cast<SVGPropertyTearOff<FloatPoint> *>(castedThis->impl());
251 if (imp->role() == AnimValRole) {
252 setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
253 return JSValue::encode(jsUndefined());
255 FloatPoint& podImp = imp->propertyReference();
256 if (exec->argumentCount() < 1)
257 return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
258 if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(&JSSVGMatrix::s_info))
259 return throwVMTypeError(exec);
260 SVGPropertyTearOff<SVGMatrix>* matrix(toSVGMatrix(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)));
261 if (exec->hadException())
262 return JSValue::encode(jsUndefined());
264 setDOMException(exec, TYPE_MISMATCH_ERR);
265 return JSValue::encode(jsUndefined());
268 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(podImp.matrixTransform(matrix->propertyReference()))));
269 return JSValue::encode(result);
272 static inline bool isObservable(JSSVGPoint* jsSVGPoint)
274 if (jsSVGPoint->hasCustomProperties())
279 bool JSSVGPointOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
281 JSSVGPoint* jsSVGPoint = static_cast<JSSVGPoint*>(handle.get().asCell());
282 if (!isObservable(jsSVGPoint))
284 UNUSED_PARAM(visitor);
288 void JSSVGPointOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
290 JSSVGPoint* jsSVGPoint = static_cast<JSSVGPoint*>(handle.get().asCell());
291 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
292 uncacheWrapper(world, jsSVGPoint->impl(), jsSVGPoint);
293 jsSVGPoint->releaseImpl();
296 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGPropertyTearOff<FloatPoint> * impl)
298 return wrap<JSSVGPoint, SVGPropertyTearOff<FloatPoint> >(exec, globalObject, impl);
301 SVGPropertyTearOff<FloatPoint> * toSVGPoint(JSC::JSValue value)
303 return value.inherits(&JSSVGPoint::s_info) ? static_cast<JSSVGPoint*>(asObject(value))->impl() : 0;
308 #endif // ENABLE(SVG)