/*
    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"

#include "JSWheelEvent.h"

#include <wtf/GetPtr.h>

#include "WheelEvent.h"

using namespace KJS;

namespace WebCore {

/* Hash table */

static const HashEntry JSWheelEventTableEntries[] =
{
    { 0, 0, 0, 0, 0 },
    { "wheelDeltaY", JSWheelEvent::WheelDeltaYAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[20] },
    { "clientY", JSWheelEvent::ClientYAttrNum, DontDelete|ReadOnly, 0, 0 },
    { "wheelDelta", JSWheelEvent::WheelDeltaAttrNum, DontDelete|ReadOnly, 0, 0 },
    { "shiftKey", JSWheelEvent::ShiftKeyAttrNum, DontDelete|ReadOnly, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { "screenX", JSWheelEvent::ScreenXAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[15] },
    { 0, 0, 0, 0, 0 },
    { "wheelDeltaX", JSWheelEvent::WheelDeltaXAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[19] },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { "altKey", JSWheelEvent::AltKeyAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[17] },
    { 0, 0, 0, 0, 0 },
    { "ctrlKey", JSWheelEvent::CtrlKeyAttrNum, DontDelete|ReadOnly, 0, 0 },
    { "screenY", JSWheelEvent::ScreenYAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[16] },
    { "clientX", JSWheelEvent::ClientXAttrNum, DontDelete|ReadOnly, 0, &JSWheelEventTableEntries[18] },
    { "metaKey", JSWheelEvent::MetaKeyAttrNum, DontDelete|ReadOnly, 0, 0 },
    { "offsetX", JSWheelEvent::OffsetXAttrNum, DontDelete|ReadOnly, 0, 0 },
    { "offsetY", JSWheelEvent::OffsetYAttrNum, DontDelete|ReadOnly, 0, 0 },
    { "x", JSWheelEvent::XAttrNum, DontDelete|ReadOnly, 0, 0 },
    { "y", JSWheelEvent::YAttrNum, DontDelete|ReadOnly, 0, 0 }
};

static const HashTable JSWheelEventTable = 
{
    2, 21, JSWheelEventTableEntries, 15
};

/* Hash table for prototype */

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

static const HashTable JSWheelEventPrototypeTable = 
{
    2, 1, JSWheelEventPrototypeTableEntries, 1
};

const ClassInfo JSWheelEventPrototype::info = { "WheelEventPrototype", 0, &JSWheelEventPrototypeTable, 0 };

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

const ClassInfo JSWheelEvent::info = { "WheelEvent", &JSUIEvent::info, &JSWheelEventTable, 0 };

JSWheelEvent::JSWheelEvent(ExecState* exec, WheelEvent* impl)
    : JSUIEvent(exec, impl)
{
    setPrototype(JSWheelEventPrototype::self(exec));
}

bool JSWheelEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSWheelEvent, JSUIEvent>(exec, &JSWheelEventTable, this, propertyName, slot);
}

JSValue* JSWheelEvent::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case ScreenXAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsNumber(imp->screenX());
    }
    case ScreenYAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsNumber(imp->screenY());
    }
    case ClientXAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsNumber(imp->clientX());
    }
    case ClientYAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsNumber(imp->clientY());
    }
    case CtrlKeyAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsBoolean(imp->ctrlKey());
    }
    case ShiftKeyAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsBoolean(imp->shiftKey());
    }
    case AltKeyAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsBoolean(imp->altKey());
    }
    case MetaKeyAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsBoolean(imp->metaKey());
    }
    case WheelDeltaAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsNumber(imp->wheelDelta());
    }
    case WheelDeltaXAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsNumber(imp->wheelDeltaX());
    }
    case WheelDeltaYAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsNumber(imp->wheelDeltaY());
    }
    case OffsetXAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsNumber(imp->offsetX());
    }
    case OffsetYAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

        return jsNumber(imp->offsetY());
    }
    case XAttrNum: {
        WheelEvent* imp = static_cast<WheelEvent*>(impl());

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

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


}
