static v8::Handle<v8::Value> getBBoxCallback(const v8::Arguments& args) { INC_STATS("DOM.SVGLineElement.getBBox"); SVGLineElement* imp = V8SVGLineElement::toNative(args.Holder()); FloatRect result = imp->getBBox(); RefPtr<V8SVGPODTypeWrapper<FloatRect> > wrapper = V8SVGStaticPODTypeWrapper<FloatRect>::create(result); SVGElement* context = imp; V8Proxy::setSVGContext(wrapper.get(), context); return toV8(wrapper.release()); }
JSValue* jsSVGLineElementPrototypeFunctionGetBBox(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<FloatRect>::create(imp->getBBox()).get(), imp); return result; }
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; }