static v8::Handle<v8::Value> createSVGPathSegArcAbsCallback(const v8::Arguments& args)
{
    SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
    V8TRYCATCH(float, x, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)->NumberValue()));
    V8TRYCATCH(float, y, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->NumberValue()));
    V8TRYCATCH(float, r1, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)->NumberValue()));
    V8TRYCATCH(float, r2, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 3, DefaultIsUndefined)->NumberValue()));
    V8TRYCATCH(float, angle, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 4, DefaultIsUndefined)->NumberValue()));
    V8TRYCATCH(bool, largeArcFlag, MAYBE_MISSING_PARAMETER(args, 5, DefaultIsUndefined)->BooleanValue());
    V8TRYCATCH(bool, sweepFlag, MAYBE_MISSING_PARAMETER(args, 6, DefaultIsUndefined)->BooleanValue());
    return toV8Fast(imp->createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag), args, imp);
}
예제 #2
0
static v8::Handle<v8::Value> createSVGPathSegArcAbsCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGPathElement.createSVGPathSegArcAbs");
    SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
    EXCEPTION_BLOCK(float, x, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)->NumberValue()));
    EXCEPTION_BLOCK(float, y, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined)->NumberValue()));
    EXCEPTION_BLOCK(float, r1, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 2, MissingIsUndefined)->NumberValue()));
    EXCEPTION_BLOCK(float, r2, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 3, MissingIsUndefined)->NumberValue()));
    EXCEPTION_BLOCK(float, angle, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 4, MissingIsUndefined)->NumberValue()));
    EXCEPTION_BLOCK(bool, largeArcFlag, MAYBE_MISSING_PARAMETER(args, 5, MissingIsUndefined)->BooleanValue());
    EXCEPTION_BLOCK(bool, sweepFlag, MAYBE_MISSING_PARAMETER(args, 6, MissingIsUndefined)->BooleanValue());
    return toV8(imp->createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag));
}
예제 #3
0
JSValue* JSSVGPathElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
{
    if (!thisObj->inherits(&JSSVGPathElement::info))
      return throwError(exec, TypeError);

    SVGPathElement* imp = static_cast<SVGPathElement*>(static_cast<JSSVGPathElement*>(thisObj)->impl());

    switch (id) {
    case JSSVGPathElement::GetTotalLengthFuncNum: {


        KJS::JSValue* result = jsNumber(imp->getTotalLength());
        return result;
    }
    case JSSVGPathElement::GetPointAtLengthFuncNum: {
        float distance = args[0]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<FloatPoint>(imp->getPointAtLength(distance)));
        return result;
    }
    case JSSVGPathElement::GetPathSegAtLengthFuncNum: {
        float distance = args[0]->toFloat(exec);


        KJS::JSValue* result = jsNumber(imp->getPathSegAtLength(distance));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegClosePathFuncNum: {


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegClosePath()));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegMovetoAbsFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegMovetoAbs(x, y)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegMovetoRelFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegMovetoRel(x, y)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegLinetoAbsFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoAbs(x, y)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegLinetoRelFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoRel(x, y)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegCurvetoCubicAbsFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);
        float x1 = args[2]->toFloat(exec);
        float y1 = args[3]->toFloat(exec);
        float x2 = args[4]->toFloat(exec);
        float y2 = args[5]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegCurvetoCubicRelFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);
        float x1 = args[2]->toFloat(exec);
        float y1 = args[3]->toFloat(exec);
        float x2 = args[4]->toFloat(exec);
        float y2 = args[5]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticAbsFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);
        float x1 = args[2]->toFloat(exec);
        float y1 = args[3]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticRelFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);
        float x1 = args[2]->toFloat(exec);
        float y1 = args[3]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoQuadraticRel(x, y, x1, y1)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegArcAbsFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);
        float r1 = args[2]->toFloat(exec);
        float r2 = args[3]->toFloat(exec);
        float angle = args[4]->toFloat(exec);
        bool largeArcFlag = args[5]->toBoolean(exec);
        bool sweepFlag = args[6]->toBoolean(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegArcRelFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);
        float r1 = args[2]->toFloat(exec);
        float r2 = args[3]->toFloat(exec);
        float angle = args[4]->toFloat(exec);
        bool largeArcFlag = args[5]->toBoolean(exec);
        bool sweepFlag = args[6]->toBoolean(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegLinetoHorizontalAbsFuncNum: {
        float x = args[0]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoHorizontalAbs(x)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegLinetoHorizontalRelFuncNum: {
        float x = args[0]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoHorizontalRel(x)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegLinetoVerticalAbsFuncNum: {
        float y = args[0]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoVerticalAbs(y)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegLinetoVerticalRelFuncNum: {
        float y = args[0]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegLinetoVerticalRel(y)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbsFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);
        float x2 = args[2]->toFloat(exec);
        float y2 = args[3]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRelFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);
        float x2 = args[2]->toFloat(exec);
        float y2 = args[3]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbsFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoQuadraticSmoothAbs(x, y)));
        return result;
    }
    case JSSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRelFuncNum: {
        float x = args[0]->toFloat(exec);
        float y = args[1]->toFloat(exec);


        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->createSVGPathSegCurvetoQuadraticSmoothRel(x, y)));
        return result;
    }
    case JSSVGPathElement::HasExtensionFuncNum: {
        String extension = args[0]->toString(exec);


        KJS::JSValue* result = jsBoolean(imp->hasExtension(extension));
        return result;
    }
    case JSSVGPathElement::GetBBoxFuncNum: {


        KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<FloatRect>(imp->getBBox()));
        return result;
    }
    case JSSVGPathElement::GetCTMFuncNum: {


        KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<AffineTransform>(imp->getCTM()));
        return result;
    }
    case JSSVGPathElement::GetScreenCTMFuncNum: {


        KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapper<AffineTransform>(imp->getScreenCTM()));
        return result;
    }
    case JSSVGPathElement::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;
}