/*
    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(WEBGL)

#include "JSWebGLVertexArrayObjectOES.h"

#include "WebGLVertexArrayObjectOES.h"
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

/* Hash table */

static const HashTableValue JSWebGLVertexArrayObjectOESTableValues[] =
{
    { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLVertexArrayObjectOESConstructor), (intptr_t)0, NoIntrinsic },
    { 0, 0, 0, 0, NoIntrinsic }
};

static const HashTable JSWebGLVertexArrayObjectOESTable = { 2, 1, JSWebGLVertexArrayObjectOESTableValues, 0 };
/* Hash table for constructor */

static const HashTableValue JSWebGLVertexArrayObjectOESConstructorTableValues[] =
{
    { 0, 0, 0, 0, NoIntrinsic }
};

static const HashTable JSWebGLVertexArrayObjectOESConstructorTable = { 1, 0, JSWebGLVertexArrayObjectOESConstructorTableValues, 0 };
const ClassInfo JSWebGLVertexArrayObjectOESConstructor::s_info = { "WebGLVertexArrayObjectOESConstructor", &Base::s_info, &JSWebGLVertexArrayObjectOESConstructorTable, 0, CREATE_METHOD_TABLE(JSWebGLVertexArrayObjectOESConstructor) };

JSWebGLVertexArrayObjectOESConstructor::JSWebGLVertexArrayObjectOESConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    : DOMConstructorObject(structure, globalObject)
{
}

void JSWebGLVertexArrayObjectOESConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
{
    Base::finishCreation(exec->globalData());
    ASSERT(inherits(&s_info));
    putDirect(exec->globalData(), exec->propertyNames().prototype, JSWebGLVertexArrayObjectOESPrototype::self(exec, globalObject), DontDelete | ReadOnly);
}

bool JSWebGLVertexArrayObjectOESConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSWebGLVertexArrayObjectOESConstructor, JSDOMWrapper>(exec, &JSWebGLVertexArrayObjectOESConstructorTable, jsCast<JSWebGLVertexArrayObjectOESConstructor*>(cell), propertyName, slot);
}

bool JSWebGLVertexArrayObjectOESConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
{
    return getStaticValueDescriptor<JSWebGLVertexArrayObjectOESConstructor, JSDOMWrapper>(exec, &JSWebGLVertexArrayObjectOESConstructorTable, jsCast<JSWebGLVertexArrayObjectOESConstructor*>(object), propertyName, descriptor);
}

/* Hash table for prototype */

static const HashTableValue JSWebGLVertexArrayObjectOESPrototypeTableValues[] =
{
    { 0, 0, 0, 0, NoIntrinsic }
};

static const HashTable JSWebGLVertexArrayObjectOESPrototypeTable = { 1, 0, JSWebGLVertexArrayObjectOESPrototypeTableValues, 0 };
const ClassInfo JSWebGLVertexArrayObjectOESPrototype::s_info = { "WebGLVertexArrayObjectOESPrototype", &Base::s_info, &JSWebGLVertexArrayObjectOESPrototypeTable, 0, CREATE_METHOD_TABLE(JSWebGLVertexArrayObjectOESPrototype) };

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

const ClassInfo JSWebGLVertexArrayObjectOES::s_info = { "WebGLVertexArrayObjectOES", &Base::s_info, &JSWebGLVertexArrayObjectOESTable, 0 , CREATE_METHOD_TABLE(JSWebGLVertexArrayObjectOES) };

JSWebGLVertexArrayObjectOES::JSWebGLVertexArrayObjectOES(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebGLVertexArrayObjectOES> impl)
    : JSDOMWrapper(structure, globalObject)
    , m_impl(impl.leakRef())
{
}

void JSWebGLVertexArrayObjectOES::finishCreation(JSGlobalData& globalData)
{
    Base::finishCreation(globalData);
    ASSERT(inherits(&s_info));
}

JSObject* JSWebGLVertexArrayObjectOES::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
{
    return JSWebGLVertexArrayObjectOESPrototype::create(exec->globalData(), globalObject, JSWebGLVertexArrayObjectOESPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
}

void JSWebGLVertexArrayObjectOES::destroy(JSC::JSCell* cell)
{
    JSWebGLVertexArrayObjectOES* thisObject = static_cast<JSWebGLVertexArrayObjectOES*>(cell);
    thisObject->JSWebGLVertexArrayObjectOES::~JSWebGLVertexArrayObjectOES();
}

JSWebGLVertexArrayObjectOES::~JSWebGLVertexArrayObjectOES()
{
    releaseImplIfNotNull();
}

bool JSWebGLVertexArrayObjectOES::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSWebGLVertexArrayObjectOES* thisObject = jsCast<JSWebGLVertexArrayObjectOES*>(cell);
    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
    return getStaticValueSlot<JSWebGLVertexArrayObjectOES, Base>(exec, &JSWebGLVertexArrayObjectOESTable, thisObject, propertyName, slot);
}

bool JSWebGLVertexArrayObjectOES::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
{
    JSWebGLVertexArrayObjectOES* thisObject = jsCast<JSWebGLVertexArrayObjectOES*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
    return getStaticValueDescriptor<JSWebGLVertexArrayObjectOES, Base>(exec, &JSWebGLVertexArrayObjectOESTable, thisObject, propertyName, descriptor);
}

JSValue jsWebGLVertexArrayObjectOESConstructor(ExecState* exec, JSValue slotBase, PropertyName)
{
    JSWebGLVertexArrayObjectOES* domObject = jsCast<JSWebGLVertexArrayObjectOES*>(asObject(slotBase));
    return JSWebGLVertexArrayObjectOES::getConstructor(exec, domObject->globalObject());
}

JSValue JSWebGLVertexArrayObjectOES::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
{
    return getDOMConstructor<JSWebGLVertexArrayObjectOESConstructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject));
}

static inline bool isObservable(JSWebGLVertexArrayObjectOES* jsWebGLVertexArrayObjectOES)
{
    if (jsWebGLVertexArrayObjectOES->hasCustomProperties())
        return true;
    return false;
}

bool JSWebGLVertexArrayObjectOESOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSWebGLVertexArrayObjectOES* jsWebGLVertexArrayObjectOES = jsCast<JSWebGLVertexArrayObjectOES*>(handle.get().asCell());
    if (!isObservable(jsWebGLVertexArrayObjectOES))
        return false;
    UNUSED_PARAM(visitor);
    return false;
}

void JSWebGLVertexArrayObjectOESOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSWebGLVertexArrayObjectOES* jsWebGLVertexArrayObjectOES = jsCast<JSWebGLVertexArrayObjectOES*>(handle.get().asCell());
    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, jsWebGLVertexArrayObjectOES->impl(), jsWebGLVertexArrayObjectOES);
    jsWebGLVertexArrayObjectOES->releaseImpl();
}

JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebGLVertexArrayObjectOES* impl)
{
    return wrap<JSWebGLVertexArrayObjectOES>(exec, globalObject, impl);
}

WebGLVertexArrayObjectOES* toWebGLVertexArrayObjectOES(JSC::JSValue value)
{
    return value.inherits(&JSWebGLVertexArrayObjectOES::s_info) ? jsCast<JSWebGLVertexArrayObjectOES*>(asObject(value))->impl() : 0;
}

}

#endif // ENABLE(WEBGL)
