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

#include "JSWebKitCSSViewportRule.h"

#include "CSSStyleDeclaration.h"
#include "JSCSSStyleDeclaration.h"
#include "StyleProperties.h"
#include "WebKitCSSViewportRule.h"
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

/* Hash table */

static const HashTableValue JSWebKitCSSViewportRuleTableValues[] =
{
    { "style", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSViewportRuleStyle), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSViewportRuleConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSWebKitCSSViewportRuleTable = { 4, 3, true, JSWebKitCSSViewportRuleTableValues, 0 };
/* Hash table for constructor */

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

static const HashTable JSWebKitCSSViewportRuleConstructorTable = { 1, 0, false, JSWebKitCSSViewportRuleConstructorTableValues, 0 };
const ClassInfo JSWebKitCSSViewportRuleConstructor::s_info = { "WebKitCSSViewportRuleConstructor", &Base::s_info, &JSWebKitCSSViewportRuleConstructorTable, 0, CREATE_METHOD_TABLE(JSWebKitCSSViewportRuleConstructor) };

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

void JSWebKitCSSViewportRuleConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
    putDirect(vm, vm.propertyNames->prototype, JSWebKitCSSViewportRulePrototype::self(vm, globalObject), DontDelete | ReadOnly);
    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum);
}

bool JSWebKitCSSViewportRuleConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSWebKitCSSViewportRuleConstructor, JSDOMWrapper>(exec, JSWebKitCSSViewportRuleConstructorTable, jsCast<JSWebKitCSSViewportRuleConstructor*>(object), propertyName, slot);
}

/* Hash table for prototype */

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

static const HashTable JSWebKitCSSViewportRulePrototypeTable = { 1, 0, false, JSWebKitCSSViewportRulePrototypeTableValues, 0 };
const ClassInfo JSWebKitCSSViewportRulePrototype::s_info = { "WebKitCSSViewportRulePrototype", &Base::s_info, &JSWebKitCSSViewportRulePrototypeTable, 0, CREATE_METHOD_TABLE(JSWebKitCSSViewportRulePrototype) };

JSObject* JSWebKitCSSViewportRulePrototype::self(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMPrototype<JSWebKitCSSViewportRule>(vm, globalObject);
}

const ClassInfo JSWebKitCSSViewportRule::s_info = { "WebKitCSSViewportRule", &Base::s_info, &JSWebKitCSSViewportRuleTable, 0 , CREATE_METHOD_TABLE(JSWebKitCSSViewportRule) };

JSWebKitCSSViewportRule::JSWebKitCSSViewportRule(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebKitCSSViewportRule> impl)
    : JSCSSRule(structure, globalObject, impl)
{
}

void JSWebKitCSSViewportRule::finishCreation(VM& vm)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
}

JSObject* JSWebKitCSSViewportRule::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
    return JSWebKitCSSViewportRulePrototype::create(vm, globalObject, JSWebKitCSSViewportRulePrototype::createStructure(vm, globalObject, JSCSSRulePrototype::self(vm, globalObject)));
}

bool JSWebKitCSSViewportRule::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSWebKitCSSViewportRule* thisObject = jsCast<JSWebKitCSSViewportRule*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    return getStaticValueSlot<JSWebKitCSSViewportRule, Base>(exec, JSWebKitCSSViewportRuleTable, thisObject, propertyName, slot);
}

EncodedJSValue jsWebKitCSSViewportRuleStyle(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSViewportRule* castedThis = jsDynamicCast<JSWebKitCSSViewportRule*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSViewportRule& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.style()));
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSViewportRuleConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSWebKitCSSViewportRule* domObject = jsDynamicCast<JSWebKitCSSViewportRule*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSWebKitCSSViewportRule::getConstructor(exec->vm(), domObject->globalObject()));
}

JSValue JSWebKitCSSViewportRule::getConstructor(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMConstructor<JSWebKitCSSViewportRuleConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
}


}

#endif // ENABLE(CSS_DEVICE_ADAPTATION)
