/*
    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 "JSSVGZoomAndPan.h"

#include "SVGZoomAndPan.h"
#include <runtime/JSNumberCell.h>
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

ASSERT_CLASS_FITS_IN_CELL(JSSVGZoomAndPan);

/* Hash table */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
#else
#define THUNK_GENERATOR(generator)
#endif

static const HashTableValue JSSVGZoomAndPanTableValues[3] =
{
    { "zoomAndPan", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomAndPanZoomAndPan), (intptr_t)setJSSVGZoomAndPanZoomAndPan THUNK_GENERATOR(0) },
    { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomAndPanConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
};

#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSSVGZoomAndPanTable = { 4, 3, JSSVGZoomAndPanTableValues, 0 };
/* Hash table for constructor */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
#else
#define THUNK_GENERATOR(generator)
#endif

static const HashTableValue JSSVGZoomAndPanConstructorTableValues[4] =
{
    { "SVG_ZOOMANDPAN_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomAndPanSVG_ZOOMANDPAN_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) },
    { "SVG_ZOOMANDPAN_DISABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomAndPanSVG_ZOOMANDPAN_DISABLE), (intptr_t)0 THUNK_GENERATOR(0) },
    { "SVG_ZOOMANDPAN_MAGNIFY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomAndPanSVG_ZOOMANDPAN_MAGNIFY), (intptr_t)0 THUNK_GENERATOR(0) },
    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
};

#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSSVGZoomAndPanConstructorTable = { 9, 7, JSSVGZoomAndPanConstructorTableValues, 0 };

COMPILE_ASSERT(0 == SVGZoomAndPan::SVG_ZOOMANDPAN_UNKNOWN, SVGZoomAndPanEnumSVG_ZOOMANDPAN_UNKNOWNIsWrongUseDontCheckEnums);
COMPILE_ASSERT(1 == SVGZoomAndPan::SVG_ZOOMANDPAN_DISABLE, SVGZoomAndPanEnumSVG_ZOOMANDPAN_DISABLEIsWrongUseDontCheckEnums);
COMPILE_ASSERT(2 == SVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY, SVGZoomAndPanEnumSVG_ZOOMANDPAN_MAGNIFYIsWrongUseDontCheckEnums);

class JSSVGZoomAndPanConstructor : public DOMConstructorObject {
public:
    JSSVGZoomAndPanConstructor(JSC::ExecState*, JSDOMGlobalObject*);

    virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
    virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
    static const JSC::ClassInfo s_info;
    static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
    {
        return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
    }
protected:
    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
};

const ClassInfo JSSVGZoomAndPanConstructor::s_info = { "SVGZoomAndPanConstructor", &DOMConstructorObject::s_info, &JSSVGZoomAndPanConstructorTable, 0 };

JSSVGZoomAndPanConstructor::JSSVGZoomAndPanConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
    : DOMConstructorObject(JSSVGZoomAndPanConstructor::createStructure(globalObject->globalData(), globalObject->objectPrototype()), globalObject)
{
    ASSERT(inherits(&s_info));
    putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGZoomAndPanPrototype::self(exec, globalObject), DontDelete | ReadOnly);
}

bool JSSVGZoomAndPanConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSSVGZoomAndPanConstructor, DOMObject>(exec, &JSSVGZoomAndPanConstructorTable, this, propertyName, slot);
}

bool JSSVGZoomAndPanConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
    return getStaticValueDescriptor<JSSVGZoomAndPanConstructor, DOMObject>(exec, &JSSVGZoomAndPanConstructorTable, this, propertyName, descriptor);
}

/* Hash table for prototype */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
#else
#define THUNK_GENERATOR(generator)
#endif

static const HashTableValue JSSVGZoomAndPanPrototypeTableValues[4] =
{
    { "SVG_ZOOMANDPAN_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomAndPanSVG_ZOOMANDPAN_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) },
    { "SVG_ZOOMANDPAN_DISABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomAndPanSVG_ZOOMANDPAN_DISABLE), (intptr_t)0 THUNK_GENERATOR(0) },
    { "SVG_ZOOMANDPAN_MAGNIFY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomAndPanSVG_ZOOMANDPAN_MAGNIFY), (intptr_t)0 THUNK_GENERATOR(0) },
    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
};

#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSSVGZoomAndPanPrototypeTable = { 9, 7, JSSVGZoomAndPanPrototypeTableValues, 0 };
const ClassInfo JSSVGZoomAndPanPrototype::s_info = { "SVGZoomAndPanPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSSVGZoomAndPanPrototypeTable, 0 };

JSObject* JSSVGZoomAndPanPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
{
    return getDOMPrototype<JSSVGZoomAndPan>(exec, globalObject);
}

bool JSSVGZoomAndPanPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSSVGZoomAndPanPrototype, JSObject>(exec, &JSSVGZoomAndPanPrototypeTable, this, propertyName, slot);
}

bool JSSVGZoomAndPanPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
    return getStaticValueDescriptor<JSSVGZoomAndPanPrototype, JSObject>(exec, &JSSVGZoomAndPanPrototypeTable, this, propertyName, descriptor);
}

const ClassInfo JSSVGZoomAndPan::s_info = { "SVGZoomAndPan", &DOMObjectWithGlobalPointer::s_info, &JSSVGZoomAndPanTable, 0 };

JSSVGZoomAndPan::JSSVGZoomAndPan(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGZoomAndPan> impl)
    : DOMObjectWithGlobalPointer(structure, globalObject)
    , m_impl(impl)
{
    ASSERT(inherits(&s_info));
}

JSObject* JSSVGZoomAndPan::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
{
    return new (exec) JSSVGZoomAndPanPrototype(globalObject, JSSVGZoomAndPanPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype()));
}

bool JSSVGZoomAndPan::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSSVGZoomAndPan, Base>(exec, &JSSVGZoomAndPanTable, this, propertyName, slot);
}

bool JSSVGZoomAndPan::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
    return getStaticValueDescriptor<JSSVGZoomAndPan, Base>(exec, &JSSVGZoomAndPanTable, this, propertyName, descriptor);
}

JSValue jsSVGZoomAndPanZoomAndPan(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSSVGZoomAndPan* castedThis = static_cast<JSSVGZoomAndPan*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    SVGZoomAndPan* imp = static_cast<SVGZoomAndPan*>(castedThis->impl());
    JSValue result = jsNumber(imp->zoomAndPan());
    return result;
}

JSValue jsSVGZoomAndPanConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSSVGZoomAndPan* domObject = static_cast<JSSVGZoomAndPan*>(asObject(slotBase));
    return JSSVGZoomAndPan::getConstructor(exec, domObject->globalObject());
}

void JSSVGZoomAndPan::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
    lookupPut<JSSVGZoomAndPan, Base>(exec, propertyName, value, &JSSVGZoomAndPanTable, this, slot);
}

void setJSSVGZoomAndPanZoomAndPan(ExecState* exec, JSObject* thisObject, JSValue value)
{
    JSSVGZoomAndPan* castedThis = static_cast<JSSVGZoomAndPan*>(thisObject);
    SVGZoomAndPan* imp = static_cast<SVGZoomAndPan*>(castedThis->impl());
    imp->setZoomAndPan(value.toUInt32(exec));
}

JSValue JSSVGZoomAndPan::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
{
    return getDOMConstructor<JSSVGZoomAndPanConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
}

// Constant getters

JSValue jsSVGZoomAndPanSVG_ZOOMANDPAN_UNKNOWN(ExecState* exec, JSValue, const Identifier&)
{
    UNUSED_PARAM(exec);
    return jsNumber(static_cast<int>(0));
}

JSValue jsSVGZoomAndPanSVG_ZOOMANDPAN_DISABLE(ExecState* exec, JSValue, const Identifier&)
{
    UNUSED_PARAM(exec);
    return jsNumber(static_cast<int>(1));
}

JSValue jsSVGZoomAndPanSVG_ZOOMANDPAN_MAGNIFY(ExecState* exec, JSValue, const Identifier&)
{
    UNUSED_PARAM(exec);
    return jsNumber(static_cast<int>(2));
}

JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGZoomAndPan* object)
{
    return getDOMObjectWrapper<JSSVGZoomAndPan>(exec, globalObject, object);
}
SVGZoomAndPan* toSVGZoomAndPan(JSC::JSValue value)
{
    return value.inherits(&JSSVGZoomAndPan::s_info) ? static_cast<JSSVGZoomAndPan*>(asObject(value))->impl() : 0;
}

}

#endif // ENABLE(SVG)
