static v8::Handle<v8::Value> getCTMCallback(const v8::Arguments& args) { INC_STATS("DOM.SVGLineElement.getCTM"); SVGLineElement* imp = V8SVGLineElement::toNative(args.Holder()); AffineTransform result = imp->getCTM(); RefPtr<V8SVGPODTypeWrapper<AffineTransform> > wrapper = V8SVGStaticPODTypeWrapper<AffineTransform>::create(result); SVGElement* context = imp; V8Proxy::setSVGContext(wrapper.get(), context); return toV8(wrapper.release()); }
JSValue* JSSVGLineElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args) { if (!thisObj->inherits(&JSSVGLineElement::info)) return throwError(exec, TypeError); SVGLineElement* imp = static_cast<SVGLineElement*>(static_cast<JSSVGLineElement*>(thisObj)->impl()); switch (id) { case JSSVGLineElement::HasExtensionFuncNum: { String extension = args[0]->toString(exec); KJS::JSValue* result = jsBoolean(imp->hasExtension(extension)); return result; } case JSSVGLineElement::GetBBoxFuncNum: { KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<FloatRect>(imp->getBBox())); return result; } case JSSVGLineElement::GetCTMFuncNum: { KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<AffineTransform>(imp->getCTM())); return result; } case JSSVGLineElement::GetScreenCTMFuncNum: { KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<AffineTransform>(imp->getScreenCTM())); return result; } case JSSVGLineElement::GetTransformToElementFuncNum: { ExceptionCode ec = 0; SVGElement* element = toSVGElement(args[0]); KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<AffineTransform>(imp->getTransformToElement(element, ec))); setDOMException(exec, ec); return result; } } return 0; }
JSValue JSC_HOST_CALL jsSVGLineElementPrototypeFunctionGetCTM(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.isObject(&JSSVGLineElement::s_info)) return throwError(exec, TypeError); JSSVGLineElement* castedThisObj = static_cast<JSSVGLineElement*>(asObject(thisValue)); SVGLineElement* imp = static_cast<SVGLineElement*>(castedThisObj->impl()); JSC::JSValue result = toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp->getCTM()).get(), imp); return result; }
JSValue* jsSVGLineElementPrototypeFunctionGetCTM(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args) { if (!thisValue->isObject(&JSSVGLineElement::s_info)) return throwError(exec, TypeError); JSSVGLineElement* castedThisObj = static_cast<JSSVGLineElement*>(thisValue); SVGLineElement* imp = static_cast<SVGLineElement*>(castedThisObj->impl()); JSC::JSValue* result = toJS(exec, JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp->getCTM()).get(), imp); return result; }