WebCore/generated/JSOverflowEvent.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 "JSOverflowEvent.h"
       
    23 
       
    24 #include "OverflowEvent.h"
       
    25 #include <runtime/Error.h>
       
    26 #include <runtime/JSNumberCell.h>
       
    27 #include <wtf/GetPtr.h>
       
    28 
       
    29 using namespace JSC;
       
    30 
       
    31 namespace WebCore {
       
    32 
       
    33 ASSERT_CLASS_FITS_IN_CELL(JSOverflowEvent);
       
    34 
       
    35 /* Hash table */
       
    36 #if ENABLE(JIT)
       
    37 #define THUNK_GENERATOR(generator) , generator
       
    38 #else
       
    39 #define THUNK_GENERATOR(generator)
       
    40 #endif
       
    41 
       
    42 static const HashTableValue JSOverflowEventTableValues[5] =
       
    43 {
       
    44     { "orient", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventOrient), (intptr_t)0 THUNK_GENERATOR(0) },
       
    45     { "horizontalOverflow", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventHorizontalOverflow), (intptr_t)0 THUNK_GENERATOR(0) },
       
    46     { "verticalOverflow", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventVerticalOverflow), (intptr_t)0 THUNK_GENERATOR(0) },
       
    47     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    48     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    49 };
       
    50 
       
    51 #undef THUNK_GENERATOR
       
    52 static JSC_CONST_HASHTABLE HashTable JSOverflowEventTable = { 9, 7, JSOverflowEventTableValues, 0 };
       
    53 /* Hash table for constructor */
       
    54 #if ENABLE(JIT)
       
    55 #define THUNK_GENERATOR(generator) , generator
       
    56 #else
       
    57 #define THUNK_GENERATOR(generator)
       
    58 #endif
       
    59 
       
    60 static const HashTableValue JSOverflowEventConstructorTableValues[4] =
       
    61 {
       
    62     { "HORIZONTAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventHORIZONTAL), (intptr_t)0 THUNK_GENERATOR(0) },
       
    63     { "VERTICAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventVERTICAL), (intptr_t)0 THUNK_GENERATOR(0) },
       
    64     { "BOTH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventBOTH), (intptr_t)0 THUNK_GENERATOR(0) },
       
    65     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    66 };
       
    67 
       
    68 #undef THUNK_GENERATOR
       
    69 static JSC_CONST_HASHTABLE HashTable JSOverflowEventConstructorTable = { 9, 7, JSOverflowEventConstructorTableValues, 0 };
       
    70 class JSOverflowEventConstructor : public DOMConstructorObject {
       
    71 public:
       
    72     JSOverflowEventConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    73 
       
    74     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    75     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    76     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    77     static const JSC::ClassInfo s_info;
       
    78     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    79     {
       
    80         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    81     }
       
    82 protected:
       
    83     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    84 };
       
    85 
       
    86 const ClassInfo JSOverflowEventConstructor::s_info = { "OverflowEventConstructor", 0, &JSOverflowEventConstructorTable, 0 };
       
    87 
       
    88 JSOverflowEventConstructor::JSOverflowEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    89     : DOMConstructorObject(JSOverflowEventConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    90 {
       
    91     putDirect(exec->propertyNames().prototype, JSOverflowEventPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    92 }
       
    93 
       
    94 bool JSOverflowEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    95 {
       
    96     return getStaticValueSlot<JSOverflowEventConstructor, DOMObject>(exec, &JSOverflowEventConstructorTable, this, propertyName, slot);
       
    97 }
       
    98 
       
    99 bool JSOverflowEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   100 {
       
   101     return getStaticValueDescriptor<JSOverflowEventConstructor, DOMObject>(exec, &JSOverflowEventConstructorTable, this, propertyName, descriptor);
       
   102 }
       
   103 
       
   104 /* Hash table for prototype */
       
   105 #if ENABLE(JIT)
       
   106 #define THUNK_GENERATOR(generator) , generator
       
   107 #else
       
   108 #define THUNK_GENERATOR(generator)
       
   109 #endif
       
   110 
       
   111 static const HashTableValue JSOverflowEventPrototypeTableValues[5] =
       
   112 {
       
   113     { "HORIZONTAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventHORIZONTAL), (intptr_t)0 THUNK_GENERATOR(0) },
       
   114     { "VERTICAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventVERTICAL), (intptr_t)0 THUNK_GENERATOR(0) },
       
   115     { "BOTH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsOverflowEventBOTH), (intptr_t)0 THUNK_GENERATOR(0) },
       
   116     { "initOverflowEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsOverflowEventPrototypeFunctionInitOverflowEvent), (intptr_t)3 THUNK_GENERATOR(0) },
       
   117     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   118 };
       
   119 
       
   120 #undef THUNK_GENERATOR
       
   121 static JSC_CONST_HASHTABLE HashTable JSOverflowEventPrototypeTable = { 9, 7, JSOverflowEventPrototypeTableValues, 0 };
       
   122 const ClassInfo JSOverflowEventPrototype::s_info = { "OverflowEventPrototype", 0, &JSOverflowEventPrototypeTable, 0 };
       
   123 
       
   124 JSObject* JSOverflowEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   125 {
       
   126     return getDOMPrototype<JSOverflowEvent>(exec, globalObject);
       
   127 }
       
   128 
       
   129 bool JSOverflowEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   130 {
       
   131     return getStaticPropertySlot<JSOverflowEventPrototype, JSObject>(exec, &JSOverflowEventPrototypeTable, this, propertyName, slot);
       
   132 }
       
   133 
       
   134 bool JSOverflowEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   135 {
       
   136     return getStaticPropertyDescriptor<JSOverflowEventPrototype, JSObject>(exec, &JSOverflowEventPrototypeTable, this, propertyName, descriptor);
       
   137 }
       
   138 
       
   139 const ClassInfo JSOverflowEvent::s_info = { "OverflowEvent", &JSEvent::s_info, &JSOverflowEventTable, 0 };
       
   140 
       
   141 JSOverflowEvent::JSOverflowEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<OverflowEvent> impl)
       
   142     : JSEvent(structure, globalObject, impl)
       
   143 {
       
   144 }
       
   145 
       
   146 JSObject* JSOverflowEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   147 {
       
   148     return new (exec) JSOverflowEventPrototype(globalObject, JSOverflowEventPrototype::createStructure(JSEventPrototype::self(exec, globalObject)));
       
   149 }
       
   150 
       
   151 bool JSOverflowEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   152 {
       
   153     return getStaticValueSlot<JSOverflowEvent, Base>(exec, &JSOverflowEventTable, this, propertyName, slot);
       
   154 }
       
   155 
       
   156 bool JSOverflowEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   157 {
       
   158     return getStaticValueDescriptor<JSOverflowEvent, Base>(exec, &JSOverflowEventTable, this, propertyName, descriptor);
       
   159 }
       
   160 
       
   161 JSValue jsOverflowEventOrient(ExecState* exec, JSValue slotBase, const Identifier&)
       
   162 {
       
   163     JSOverflowEvent* castedThis = static_cast<JSOverflowEvent*>(asObject(slotBase));
       
   164     UNUSED_PARAM(exec);
       
   165     OverflowEvent* imp = static_cast<OverflowEvent*>(castedThis->impl());
       
   166     JSValue result = jsNumber(exec, imp->orient());
       
   167     return result;
       
   168 }
       
   169 
       
   170 JSValue jsOverflowEventHorizontalOverflow(ExecState* exec, JSValue slotBase, const Identifier&)
       
   171 {
       
   172     JSOverflowEvent* castedThis = static_cast<JSOverflowEvent*>(asObject(slotBase));
       
   173     UNUSED_PARAM(exec);
       
   174     OverflowEvent* imp = static_cast<OverflowEvent*>(castedThis->impl());
       
   175     JSValue result = jsBoolean(imp->horizontalOverflow());
       
   176     return result;
       
   177 }
       
   178 
       
   179 JSValue jsOverflowEventVerticalOverflow(ExecState* exec, JSValue slotBase, const Identifier&)
       
   180 {
       
   181     JSOverflowEvent* castedThis = static_cast<JSOverflowEvent*>(asObject(slotBase));
       
   182     UNUSED_PARAM(exec);
       
   183     OverflowEvent* imp = static_cast<OverflowEvent*>(castedThis->impl());
       
   184     JSValue result = jsBoolean(imp->verticalOverflow());
       
   185     return result;
       
   186 }
       
   187 
       
   188 JSValue jsOverflowEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   189 {
       
   190     JSOverflowEvent* domObject = static_cast<JSOverflowEvent*>(asObject(slotBase));
       
   191     return JSOverflowEvent::getConstructor(exec, domObject->globalObject());
       
   192 }
       
   193 JSValue JSOverflowEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   194 {
       
   195     return getDOMConstructor<JSOverflowEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   196 }
       
   197 
       
   198 EncodedJSValue JSC_HOST_CALL jsOverflowEventPrototypeFunctionInitOverflowEvent(ExecState* exec)
       
   199 {
       
   200     JSValue thisValue = exec->hostThisValue();
       
   201     if (!thisValue.inherits(&JSOverflowEvent::s_info))
       
   202         return throwVMTypeError(exec);
       
   203     JSOverflowEvent* castedThis = static_cast<JSOverflowEvent*>(asObject(thisValue));
       
   204     OverflowEvent* imp = static_cast<OverflowEvent*>(castedThis->impl());
       
   205     unsigned short orient = exec->argument(0).toInt32(exec);
       
   206     bool horizontalOverflow = exec->argument(1).toBoolean(exec);
       
   207     bool verticalOverflow = exec->argument(2).toBoolean(exec);
       
   208 
       
   209     imp->initOverflowEvent(orient, horizontalOverflow, verticalOverflow);
       
   210     return JSValue::encode(jsUndefined());
       
   211 }
       
   212 
       
   213 // Constant getters
       
   214 
       
   215 JSValue jsOverflowEventHORIZONTAL(ExecState* exec, JSValue, const Identifier&)
       
   216 {
       
   217     return jsNumber(exec, static_cast<int>(0));
       
   218 }
       
   219 
       
   220 JSValue jsOverflowEventVERTICAL(ExecState* exec, JSValue, const Identifier&)
       
   221 {
       
   222     return jsNumber(exec, static_cast<int>(1));
       
   223 }
       
   224 
       
   225 JSValue jsOverflowEventBOTH(ExecState* exec, JSValue, const Identifier&)
       
   226 {
       
   227     return jsNumber(exec, static_cast<int>(2));
       
   228 }
       
   229 
       
   230 
       
   231 }