static void r2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    SVGPathSegArcRel* imp = V8SVGPathSegArcRel::toNative(info.Holder());
    float v = static_cast<float>(value->NumberValue());
    imp->setR2(v);
    return;
}
static void sweepFlagAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    SVGPathSegArcRel* imp = V8SVGPathSegArcRel::toNative(info.Holder());
    bool v = value->BooleanValue();
    imp->setSweepFlag(v);
    return;
}
Exemplo n.º 3
0
JSValue* JSSVGPathSegArcRel::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case XAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        return jsNumber(imp->x());
    }
    case YAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        return jsNumber(imp->y());
    }
    case R1AttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        return jsNumber(imp->r1());
    }
    case R2AttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        return jsNumber(imp->r2());
    }
    case AngleAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        return jsNumber(imp->angle());
    }
    case LargeArcFlagAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        return jsBoolean(imp->largeArcFlag());
    }
    case SweepFlagAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        return jsBoolean(imp->sweepFlag());
    }
    }
    return 0;
}
Exemplo n.º 4
0
void JSSVGPathSegArcRel::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
{
    switch (token) {
    case XAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setX(value->toFloat(exec));
        break;
    }
    case YAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setY(value->toFloat(exec));
        break;
    }
    case R1AttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setR1(value->toFloat(exec));
        break;
    }
    case R2AttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setR2(value->toFloat(exec));
        break;
    }
    case AngleAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setAngle(value->toFloat(exec));
        break;
    }
    case LargeArcFlagAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setLargeArcFlag(value->toBoolean(exec));
        break;
    }
    case SweepFlagAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setSweepFlag(value->toBoolean(exec));
        break;
    }
    }
    SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

    ASSERT(exec && exec->dynamicInterpreter());
    Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
    if (!activeFrame)
        return;

    SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
    if (extensions && extensions->hasGenericContext<SVGPathSeg>(imp)) {
        const SVGElement* context = extensions->genericContext<SVGPathSeg>(imp);
        ASSERT(context);

        context->notifyAttributeChange();
    }

}
Exemplo n.º 5
0
void JSSVGPathSegArcRel::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
{
    switch (token) {
    case XAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setX(value->toFloat(exec));
        break;
    }
    case YAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setY(value->toFloat(exec));
        break;
    }
    case R1AttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setR1(value->toFloat(exec));
        break;
    }
    case R2AttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setR2(value->toFloat(exec));
        break;
    }
    case AngleAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setAngle(value->toFloat(exec));
        break;
    }
    case LargeArcFlagAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setLargeArcFlag(value->toBoolean(exec));
        break;
    }
    case SweepFlagAttrNum: {
        SVGPathSegArcRel* imp = static_cast<SVGPathSegArcRel*>(impl());

        imp->setSweepFlag(value->toBoolean(exec));
        break;
    }
    }
    if (context())
        context()->notifyAttributeChange();
}
static v8::Handle<v8::Value> angleAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    SVGPathSegArcRel* imp = V8SVGPathSegArcRel::toNative(info.Holder());
    return v8::Number::New(imp->angle());
}
static v8::Handle<v8::Value> sweepFlagAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    SVGPathSegArcRel* imp = V8SVGPathSegArcRel::toNative(info.Holder());
    return v8Boolean(imp->sweepFlag(), info.GetIsolate());
}