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

#include <wtf/GetPtr.h>

#include "SVGRenderingIntent.h"

using namespace KJS;

namespace WebCore {

/* Hash table */

static const HashEntry JSSVGRenderingIntentTableEntries[] =
{
    { "constructor", JSSVGRenderingIntent::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 }
};

static const HashTable JSSVGRenderingIntentTable = 
{
    2, 1, JSSVGRenderingIntentTableEntries, 1
};

/* Hash table for constructor */

static const HashEntry JSSVGRenderingIntentConstructorTableEntries[] =
{
    { 0, 0, 0, 0, 0 },
    { "RENDERING_INTENT_UNKNOWN", SVGRenderingIntent::RENDERING_INTENT_UNKNOWN, DontDelete|ReadOnly, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { "RENDERING_INTENT_SATURATION", SVGRenderingIntent::RENDERING_INTENT_SATURATION, DontDelete|ReadOnly, 0, 0 },
    { "RENDERING_INTENT_AUTO", SVGRenderingIntent::RENDERING_INTENT_AUTO, DontDelete|ReadOnly, 0, &JSSVGRenderingIntentConstructorTableEntries[6] },
    { "RENDERING_INTENT_PERCEPTUAL", SVGRenderingIntent::RENDERING_INTENT_PERCEPTUAL, DontDelete|ReadOnly, 0, &JSSVGRenderingIntentConstructorTableEntries[7] },
    { "RENDERING_INTENT_RELATIVE_COLORIMETRIC", SVGRenderingIntent::RENDERING_INTENT_RELATIVE_COLORIMETRIC, DontDelete|ReadOnly, 0, 0 },
    { "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", SVGRenderingIntent::RENDERING_INTENT_ABSOLUTE_COLORIMETRIC, DontDelete|ReadOnly, 0, 0 }
};

static const HashTable JSSVGRenderingIntentConstructorTable = 
{
    2, 8, JSSVGRenderingIntentConstructorTableEntries, 6
};

class JSSVGRenderingIntentConstructor : public DOMObject {
public:
    JSSVGRenderingIntentConstructor(ExecState* exec)
    {
        setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
        putDirect(exec->propertyNames().prototype, JSSVGRenderingIntentPrototype::self(exec), None);
    }
    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    JSValue* getValueProperty(ExecState*, int token) const;
    virtual const ClassInfo* classInfo() const { return &info; }
    static const ClassInfo info;

    virtual bool implementsHasInstance() const { return true; }
};

const ClassInfo JSSVGRenderingIntentConstructor::info = { "SVGRenderingIntentConstructor", 0, &JSSVGRenderingIntentConstructorTable, 0 };

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

JSValue* JSSVGRenderingIntentConstructor::getValueProperty(ExecState*, int token) const
{
    // The token is the numeric value of its associated constant
    return jsNumber(token);
}

/* Hash table for prototype */

static const HashEntry JSSVGRenderingIntentPrototypeTableEntries[] =
{
    { 0, 0, 0, 0, 0 },
    { "RENDERING_INTENT_UNKNOWN", SVGRenderingIntent::RENDERING_INTENT_UNKNOWN, DontDelete|ReadOnly, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { "RENDERING_INTENT_SATURATION", SVGRenderingIntent::RENDERING_INTENT_SATURATION, DontDelete|ReadOnly, 0, 0 },
    { "RENDERING_INTENT_AUTO", SVGRenderingIntent::RENDERING_INTENT_AUTO, DontDelete|ReadOnly, 0, &JSSVGRenderingIntentPrototypeTableEntries[6] },
    { "RENDERING_INTENT_PERCEPTUAL", SVGRenderingIntent::RENDERING_INTENT_PERCEPTUAL, DontDelete|ReadOnly, 0, &JSSVGRenderingIntentPrototypeTableEntries[7] },
    { "RENDERING_INTENT_RELATIVE_COLORIMETRIC", SVGRenderingIntent::RENDERING_INTENT_RELATIVE_COLORIMETRIC, DontDelete|ReadOnly, 0, 0 },
    { "RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", SVGRenderingIntent::RENDERING_INTENT_ABSOLUTE_COLORIMETRIC, DontDelete|ReadOnly, 0, 0 }
};

static const HashTable JSSVGRenderingIntentPrototypeTable = 
{
    2, 8, JSSVGRenderingIntentPrototypeTableEntries, 6
};

const ClassInfo JSSVGRenderingIntentPrototype::info = { "SVGRenderingIntentPrototype", 0, &JSSVGRenderingIntentPrototypeTable, 0 };

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

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

JSValue* JSSVGRenderingIntentPrototype::getValueProperty(ExecState*, int token) const
{
    // The token is the numeric value of its associated constant
    return jsNumber(token);
}

const ClassInfo JSSVGRenderingIntent::info = { "SVGRenderingIntent", 0, &JSSVGRenderingIntentTable, 0 };

JSSVGRenderingIntent::JSSVGRenderingIntent(ExecState* exec, SVGRenderingIntent* impl)
    : m_impl(impl)
{
    setPrototype(JSSVGRenderingIntentPrototype::self(exec));
}

JSSVGRenderingIntent::~JSSVGRenderingIntent()
{
    ScriptInterpreter::forgetDOMObject(m_impl.get());
}

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

JSValue* JSSVGRenderingIntent::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}

JSValue* JSSVGRenderingIntent::getConstructor(ExecState* exec)
{
    return KJS::cacheGlobalObject<JSSVGRenderingIntentConstructor>(exec, "[[SVGRenderingIntent.constructor]]");
}
KJS::JSValue* toJS(KJS::ExecState* exec, SVGRenderingIntent* obj)
{
    return KJS::cacheDOMObject<SVGRenderingIntent, JSSVGRenderingIntent>(exec, obj);
}
SVGRenderingIntent* toSVGRenderingIntent(KJS::JSValue* val)
{
    return val->isObject(&JSSVGRenderingIntent::info) ? static_cast<JSSVGRenderingIntent*>(val)->impl() : 0;
}

}

#endif // ENABLE(SVG)
