WebCore/generated/JSWheelEvent.cpp
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     1 /*
       
     2     This file is part of the WebKit open source project.
       
     3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
       
     4 
       
     5     This library is free software; you can redistribute it and/or
       
     6     modify it under the terms of the GNU Library General Public
       
     7     License as published by the Free Software Foundation; either
       
     8     version 2 of the License, or (at your option) any later version.
       
     9 
       
    10     This library is distributed in the hope that it will be useful,
       
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13     Library General Public License for more details.
       
    14 
       
    15     You should have received a copy of the GNU Library General Public License
       
    16     along with this library; see the file COPYING.LIB.  If not, write to
       
    17     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
       
    18     Boston, MA 02110-1301, USA.
       
    19 */
       
    20 
       
    21 #include "config.h"
       
    22 #include "JSWheelEvent.h"
       
    23 
       
    24 #include "JSDOMWindow.h"
       
    25 #include "WheelEvent.h"
       
    26 #include <runtime/Error.h>
       
    27 #include <runtime/JSNumberCell.h>
       
    28 #include <wtf/GetPtr.h>
       
    29 
       
    30 using namespace JSC;
       
    31 
       
    32 namespace WebCore {
       
    33 
       
    34 ASSERT_CLASS_FITS_IN_CELL(JSWheelEvent);
       
    35 
       
    36 /* Hash table */
       
    37 #if ENABLE(JIT)
       
    38 #define THUNK_GENERATOR(generator) , generator
       
    39 #else
       
    40 #define THUNK_GENERATOR(generator)
       
    41 #endif
       
    42 
       
    43 static const HashTableValue JSWheelEventTableValues[17] =
       
    44 {
       
    45     { "screenX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventScreenX), (intptr_t)0 THUNK_GENERATOR(0) },
       
    46     { "screenY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventScreenY), (intptr_t)0 THUNK_GENERATOR(0) },
       
    47     { "clientX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventClientX), (intptr_t)0 THUNK_GENERATOR(0) },
       
    48     { "clientY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventClientY), (intptr_t)0 THUNK_GENERATOR(0) },
       
    49     { "ctrlKey", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventCtrlKey), (intptr_t)0 THUNK_GENERATOR(0) },
       
    50     { "shiftKey", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventShiftKey), (intptr_t)0 THUNK_GENERATOR(0) },
       
    51     { "altKey", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventAltKey), (intptr_t)0 THUNK_GENERATOR(0) },
       
    52     { "metaKey", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventMetaKey), (intptr_t)0 THUNK_GENERATOR(0) },
       
    53     { "wheelDelta", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventWheelDelta), (intptr_t)0 THUNK_GENERATOR(0) },
       
    54     { "wheelDeltaX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventWheelDeltaX), (intptr_t)0 THUNK_GENERATOR(0) },
       
    55     { "wheelDeltaY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventWheelDeltaY), (intptr_t)0 THUNK_GENERATOR(0) },
       
    56     { "offsetX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventOffsetX), (intptr_t)0 THUNK_GENERATOR(0) },
       
    57     { "offsetY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventOffsetY), (intptr_t)0 THUNK_GENERATOR(0) },
       
    58     { "x", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventX), (intptr_t)0 THUNK_GENERATOR(0) },
       
    59     { "y", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventY), (intptr_t)0 THUNK_GENERATOR(0) },
       
    60     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWheelEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    61     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    62 };
       
    63 
       
    64 #undef THUNK_GENERATOR
       
    65 static JSC_CONST_HASHTABLE HashTable JSWheelEventTable = { 33, 31, JSWheelEventTableValues, 0 };
       
    66 /* Hash table for constructor */
       
    67 #if ENABLE(JIT)
       
    68 #define THUNK_GENERATOR(generator) , generator
       
    69 #else
       
    70 #define THUNK_GENERATOR(generator)
       
    71 #endif
       
    72 
       
    73 static const HashTableValue JSWheelEventConstructorTableValues[1] =
       
    74 {
       
    75     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    76 };
       
    77 
       
    78 #undef THUNK_GENERATOR
       
    79 static JSC_CONST_HASHTABLE HashTable JSWheelEventConstructorTable = { 1, 0, JSWheelEventConstructorTableValues, 0 };
       
    80 class JSWheelEventConstructor : public DOMConstructorObject {
       
    81 public:
       
    82     JSWheelEventConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    83 
       
    84     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    85     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    86     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    87     static const JSC::ClassInfo s_info;
       
    88     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    89     {
       
    90         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    91     }
       
    92 protected:
       
    93     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    94 };
       
    95 
       
    96 const ClassInfo JSWheelEventConstructor::s_info = { "WheelEventConstructor", 0, &JSWheelEventConstructorTable, 0 };
       
    97 
       
    98 JSWheelEventConstructor::JSWheelEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    99     : DOMConstructorObject(JSWheelEventConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
   100 {
       
   101     putDirect(exec->propertyNames().prototype, JSWheelEventPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
   102 }
       
   103 
       
   104 bool JSWheelEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   105 {
       
   106     return getStaticValueSlot<JSWheelEventConstructor, DOMObject>(exec, &JSWheelEventConstructorTable, this, propertyName, slot);
       
   107 }
       
   108 
       
   109 bool JSWheelEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   110 {
       
   111     return getStaticValueDescriptor<JSWheelEventConstructor, DOMObject>(exec, &JSWheelEventConstructorTable, this, propertyName, descriptor);
       
   112 }
       
   113 
       
   114 /* Hash table for prototype */
       
   115 #if ENABLE(JIT)
       
   116 #define THUNK_GENERATOR(generator) , generator
       
   117 #else
       
   118 #define THUNK_GENERATOR(generator)
       
   119 #endif
       
   120 
       
   121 static const HashTableValue JSWheelEventPrototypeTableValues[2] =
       
   122 {
       
   123     { "initWebKitWheelEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsWheelEventPrototypeFunctionInitWebKitWheelEvent), (intptr_t)11 THUNK_GENERATOR(0) },
       
   124     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   125 };
       
   126 
       
   127 #undef THUNK_GENERATOR
       
   128 static JSC_CONST_HASHTABLE HashTable JSWheelEventPrototypeTable = { 2, 1, JSWheelEventPrototypeTableValues, 0 };
       
   129 const ClassInfo JSWheelEventPrototype::s_info = { "WheelEventPrototype", 0, &JSWheelEventPrototypeTable, 0 };
       
   130 
       
   131 JSObject* JSWheelEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   132 {
       
   133     return getDOMPrototype<JSWheelEvent>(exec, globalObject);
       
   134 }
       
   135 
       
   136 bool JSWheelEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   137 {
       
   138     return getStaticFunctionSlot<JSObject>(exec, &JSWheelEventPrototypeTable, this, propertyName, slot);
       
   139 }
       
   140 
       
   141 bool JSWheelEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   142 {
       
   143     return getStaticFunctionDescriptor<JSObject>(exec, &JSWheelEventPrototypeTable, this, propertyName, descriptor);
       
   144 }
       
   145 
       
   146 const ClassInfo JSWheelEvent::s_info = { "WheelEvent", &JSUIEvent::s_info, &JSWheelEventTable, 0 };
       
   147 
       
   148 JSWheelEvent::JSWheelEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<WheelEvent> impl)
       
   149     : JSUIEvent(structure, globalObject, impl)
       
   150 {
       
   151 }
       
   152 
       
   153 JSObject* JSWheelEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   154 {
       
   155     return new (exec) JSWheelEventPrototype(globalObject, JSWheelEventPrototype::createStructure(JSUIEventPrototype::self(exec, globalObject)));
       
   156 }
       
   157 
       
   158 bool JSWheelEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   159 {
       
   160     return getStaticValueSlot<JSWheelEvent, Base>(exec, &JSWheelEventTable, this, propertyName, slot);
       
   161 }
       
   162 
       
   163 bool JSWheelEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   164 {
       
   165     return getStaticValueDescriptor<JSWheelEvent, Base>(exec, &JSWheelEventTable, this, propertyName, descriptor);
       
   166 }
       
   167 
       
   168 JSValue jsWheelEventScreenX(ExecState* exec, JSValue slotBase, const Identifier&)
       
   169 {
       
   170     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   171     UNUSED_PARAM(exec);
       
   172     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   173     JSValue result = jsNumber(exec, imp->screenX());
       
   174     return result;
       
   175 }
       
   176 
       
   177 JSValue jsWheelEventScreenY(ExecState* exec, JSValue slotBase, const Identifier&)
       
   178 {
       
   179     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   180     UNUSED_PARAM(exec);
       
   181     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   182     JSValue result = jsNumber(exec, imp->screenY());
       
   183     return result;
       
   184 }
       
   185 
       
   186 JSValue jsWheelEventClientX(ExecState* exec, JSValue slotBase, const Identifier&)
       
   187 {
       
   188     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   189     UNUSED_PARAM(exec);
       
   190     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   191     JSValue result = jsNumber(exec, imp->clientX());
       
   192     return result;
       
   193 }
       
   194 
       
   195 JSValue jsWheelEventClientY(ExecState* exec, JSValue slotBase, const Identifier&)
       
   196 {
       
   197     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   198     UNUSED_PARAM(exec);
       
   199     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   200     JSValue result = jsNumber(exec, imp->clientY());
       
   201     return result;
       
   202 }
       
   203 
       
   204 JSValue jsWheelEventCtrlKey(ExecState* exec, JSValue slotBase, const Identifier&)
       
   205 {
       
   206     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   207     UNUSED_PARAM(exec);
       
   208     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   209     JSValue result = jsBoolean(imp->ctrlKey());
       
   210     return result;
       
   211 }
       
   212 
       
   213 JSValue jsWheelEventShiftKey(ExecState* exec, JSValue slotBase, const Identifier&)
       
   214 {
       
   215     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   216     UNUSED_PARAM(exec);
       
   217     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   218     JSValue result = jsBoolean(imp->shiftKey());
       
   219     return result;
       
   220 }
       
   221 
       
   222 JSValue jsWheelEventAltKey(ExecState* exec, JSValue slotBase, const Identifier&)
       
   223 {
       
   224     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   225     UNUSED_PARAM(exec);
       
   226     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   227     JSValue result = jsBoolean(imp->altKey());
       
   228     return result;
       
   229 }
       
   230 
       
   231 JSValue jsWheelEventMetaKey(ExecState* exec, JSValue slotBase, const Identifier&)
       
   232 {
       
   233     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   234     UNUSED_PARAM(exec);
       
   235     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   236     JSValue result = jsBoolean(imp->metaKey());
       
   237     return result;
       
   238 }
       
   239 
       
   240 JSValue jsWheelEventWheelDelta(ExecState* exec, JSValue slotBase, const Identifier&)
       
   241 {
       
   242     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   243     UNUSED_PARAM(exec);
       
   244     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   245     JSValue result = jsNumber(exec, imp->wheelDelta());
       
   246     return result;
       
   247 }
       
   248 
       
   249 JSValue jsWheelEventWheelDeltaX(ExecState* exec, JSValue slotBase, const Identifier&)
       
   250 {
       
   251     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   252     UNUSED_PARAM(exec);
       
   253     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   254     JSValue result = jsNumber(exec, imp->wheelDeltaX());
       
   255     return result;
       
   256 }
       
   257 
       
   258 JSValue jsWheelEventWheelDeltaY(ExecState* exec, JSValue slotBase, const Identifier&)
       
   259 {
       
   260     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   261     UNUSED_PARAM(exec);
       
   262     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   263     JSValue result = jsNumber(exec, imp->wheelDeltaY());
       
   264     return result;
       
   265 }
       
   266 
       
   267 JSValue jsWheelEventOffsetX(ExecState* exec, JSValue slotBase, const Identifier&)
       
   268 {
       
   269     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   270     UNUSED_PARAM(exec);
       
   271     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   272     JSValue result = jsNumber(exec, imp->offsetX());
       
   273     return result;
       
   274 }
       
   275 
       
   276 JSValue jsWheelEventOffsetY(ExecState* exec, JSValue slotBase, const Identifier&)
       
   277 {
       
   278     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   279     UNUSED_PARAM(exec);
       
   280     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   281     JSValue result = jsNumber(exec, imp->offsetY());
       
   282     return result;
       
   283 }
       
   284 
       
   285 JSValue jsWheelEventX(ExecState* exec, JSValue slotBase, const Identifier&)
       
   286 {
       
   287     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   288     UNUSED_PARAM(exec);
       
   289     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   290     JSValue result = jsNumber(exec, imp->x());
       
   291     return result;
       
   292 }
       
   293 
       
   294 JSValue jsWheelEventY(ExecState* exec, JSValue slotBase, const Identifier&)
       
   295 {
       
   296     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   297     UNUSED_PARAM(exec);
       
   298     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   299     JSValue result = jsNumber(exec, imp->y());
       
   300     return result;
       
   301 }
       
   302 
       
   303 JSValue jsWheelEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   304 {
       
   305     JSWheelEvent* domObject = static_cast<JSWheelEvent*>(asObject(slotBase));
       
   306     return JSWheelEvent::getConstructor(exec, domObject->globalObject());
       
   307 }
       
   308 JSValue JSWheelEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   309 {
       
   310     return getDOMConstructor<JSWheelEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   311 }
       
   312 
       
   313 EncodedJSValue JSC_HOST_CALL jsWheelEventPrototypeFunctionInitWebKitWheelEvent(ExecState* exec)
       
   314 {
       
   315     JSValue thisValue = exec->hostThisValue();
       
   316     if (!thisValue.inherits(&JSWheelEvent::s_info))
       
   317         return throwVMTypeError(exec);
       
   318     JSWheelEvent* castedThis = static_cast<JSWheelEvent*>(asObject(thisValue));
       
   319     WheelEvent* imp = static_cast<WheelEvent*>(castedThis->impl());
       
   320     int wheelDeltaX = exec->argument(0).toInt32(exec);
       
   321     int wheelDeltaY = exec->argument(1).toInt32(exec);
       
   322     DOMWindow* view = toDOMWindow(exec->argument(2));
       
   323     int screenX = exec->argument(3).toInt32(exec);
       
   324     int screenY = exec->argument(4).toInt32(exec);
       
   325     int clientX = exec->argument(5).toInt32(exec);
       
   326     int clientY = exec->argument(6).toInt32(exec);
       
   327     bool ctrlKey = exec->argument(7).toBoolean(exec);
       
   328     bool altKey = exec->argument(8).toBoolean(exec);
       
   329     bool shiftKey = exec->argument(9).toBoolean(exec);
       
   330     bool metaKey = exec->argument(10).toBoolean(exec);
       
   331 
       
   332     imp->initWebKitWheelEvent(wheelDeltaX, wheelDeltaY, view, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey);
       
   333     return JSValue::encode(jsUndefined());
       
   334 }
       
   335 
       
   336 
       
   337 }