/*
    This file is part of the WebKit open source project.
    This file has been generated by generate-bindings.pl. DO NOT MODIFY!

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/

#include "config.h"


#if ENABLE(SVG)

#include "Document.h"
#include "Frame.h"
#include "SVGDocumentExtensions.h"
#include "SVGElement.h"
#include "SVGAnimatedTemplate.h"
#include "JSSVGPathSegMovetoAbs.h"

#include <wtf/GetPtr.h>

#include "SVGPathSegMoveto.h"

using namespace KJS;

namespace WebCore {

/* Hash table */

static const HashEntry JSSVGPathSegMovetoAbsTableEntries[] =
{
    { "y", JSSVGPathSegMovetoAbs::YAttrNum, DontDelete, 0, 0 },
    { "x", JSSVGPathSegMovetoAbs::XAttrNum, DontDelete, 0, 0 }
};

static const HashTable JSSVGPathSegMovetoAbsTable = 
{
    2, 2, JSSVGPathSegMovetoAbsTableEntries, 2
};

/* Hash table for prototype */

static const HashEntry JSSVGPathSegMovetoAbsPrototypeTableEntries[] =
{
    { 0, 0, 0, 0, 0 }
};

static const HashTable JSSVGPathSegMovetoAbsPrototypeTable = 
{
    2, 1, JSSVGPathSegMovetoAbsPrototypeTableEntries, 1
};

const ClassInfo JSSVGPathSegMovetoAbsPrototype::info = { "SVGPathSegMovetoAbsPrototype", 0, &JSSVGPathSegMovetoAbsPrototypeTable, 0 };

JSObject* JSSVGPathSegMovetoAbsPrototype::self(ExecState* exec)
{
    return KJS::cacheGlobalObject<JSSVGPathSegMovetoAbsPrototype>(exec, "[[JSSVGPathSegMovetoAbs.prototype]]");
}

const ClassInfo JSSVGPathSegMovetoAbs::info = { "SVGPathSegMovetoAbs", &JSSVGPathSeg::info, &JSSVGPathSegMovetoAbsTable, 0 };

JSSVGPathSegMovetoAbs::JSSVGPathSegMovetoAbs(ExecState* exec, SVGPathSegMovetoAbs* impl)
    : JSSVGPathSeg(exec, impl)
{
    setPrototype(JSSVGPathSegMovetoAbsPrototype::self(exec));
}

bool JSSVGPathSegMovetoAbs::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSSVGPathSegMovetoAbs, JSSVGPathSeg>(exec, &JSSVGPathSegMovetoAbsTable, this, propertyName, slot);
}

JSValue* JSSVGPathSegMovetoAbs::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case XAttrNum: {
        SVGPathSegMovetoAbs* imp = static_cast<SVGPathSegMovetoAbs*>(impl());

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

        return jsNumber(imp->y());
    }
    }
    return 0;
}

void JSSVGPathSegMovetoAbs::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
{
    lookupPut<JSSVGPathSegMovetoAbs, JSSVGPathSeg>(exec, propertyName, value, attr, &JSSVGPathSegMovetoAbsTable, this);
}

void JSSVGPathSegMovetoAbs::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
{
    switch (token) {
    case XAttrNum: {
        SVGPathSegMovetoAbs* imp = static_cast<SVGPathSegMovetoAbs*>(impl());

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

        imp->setY(value->toFloat(exec));
        break;
    }
    }
    SVGPathSegMovetoAbs* imp = static_cast<SVGPathSegMovetoAbs*>(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();
    }

}


}

#endif // ENABLE(SVG)
