WebCore/generated/JSBeforeProcessEvent.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 "JSBeforeProcessEvent.h"
       
    23 
       
    24 #include "BeforeProcessEvent.h"
       
    25 #include "KURL.h"
       
    26 #include <runtime/Error.h>
       
    27 #include <runtime/JSString.h>
       
    28 #include <wtf/GetPtr.h>
       
    29 
       
    30 using namespace JSC;
       
    31 
       
    32 namespace WebCore {
       
    33 
       
    34 ASSERT_CLASS_FITS_IN_CELL(JSBeforeProcessEvent);
       
    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 JSBeforeProcessEventTableValues[3] =
       
    44 {
       
    45     { "text", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsBeforeProcessEventText), (intptr_t)setJSBeforeProcessEventText THUNK_GENERATOR(0) },
       
    46     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsBeforeProcessEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    47     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    48 };
       
    49 
       
    50 #undef THUNK_GENERATOR
       
    51 static JSC_CONST_HASHTABLE HashTable JSBeforeProcessEventTable = { 4, 3, JSBeforeProcessEventTableValues, 0 };
       
    52 /* Hash table for constructor */
       
    53 #if ENABLE(JIT)
       
    54 #define THUNK_GENERATOR(generator) , generator
       
    55 #else
       
    56 #define THUNK_GENERATOR(generator)
       
    57 #endif
       
    58 
       
    59 static const HashTableValue JSBeforeProcessEventConstructorTableValues[1] =
       
    60 {
       
    61     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    62 };
       
    63 
       
    64 #undef THUNK_GENERATOR
       
    65 static JSC_CONST_HASHTABLE HashTable JSBeforeProcessEventConstructorTable = { 1, 0, JSBeforeProcessEventConstructorTableValues, 0 };
       
    66 class JSBeforeProcessEventConstructor : public DOMConstructorObject {
       
    67 public:
       
    68     JSBeforeProcessEventConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    69 
       
    70     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    71     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    72     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    73     static const JSC::ClassInfo s_info;
       
    74     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    75     {
       
    76         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    77     }
       
    78 protected:
       
    79     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    80 };
       
    81 
       
    82 const ClassInfo JSBeforeProcessEventConstructor::s_info = { "BeforeProcessEventConstructor", 0, &JSBeforeProcessEventConstructorTable, 0 };
       
    83 
       
    84 JSBeforeProcessEventConstructor::JSBeforeProcessEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    85     : DOMConstructorObject(JSBeforeProcessEventConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    86 {
       
    87     putDirect(exec->propertyNames().prototype, JSBeforeProcessEventPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    88 }
       
    89 
       
    90 bool JSBeforeProcessEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    91 {
       
    92     return getStaticValueSlot<JSBeforeProcessEventConstructor, DOMObject>(exec, &JSBeforeProcessEventConstructorTable, this, propertyName, slot);
       
    93 }
       
    94 
       
    95 bool JSBeforeProcessEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
    96 {
       
    97     return getStaticValueDescriptor<JSBeforeProcessEventConstructor, DOMObject>(exec, &JSBeforeProcessEventConstructorTable, this, propertyName, descriptor);
       
    98 }
       
    99 
       
   100 /* Hash table for prototype */
       
   101 #if ENABLE(JIT)
       
   102 #define THUNK_GENERATOR(generator) , generator
       
   103 #else
       
   104 #define THUNK_GENERATOR(generator)
       
   105 #endif
       
   106 
       
   107 static const HashTableValue JSBeforeProcessEventPrototypeTableValues[2] =
       
   108 {
       
   109     { "initBeforeProcessEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsBeforeProcessEventPrototypeFunctionInitBeforeProcessEvent), (intptr_t)3 THUNK_GENERATOR(0) },
       
   110     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   111 };
       
   112 
       
   113 #undef THUNK_GENERATOR
       
   114 static JSC_CONST_HASHTABLE HashTable JSBeforeProcessEventPrototypeTable = { 2, 1, JSBeforeProcessEventPrototypeTableValues, 0 };
       
   115 const ClassInfo JSBeforeProcessEventPrototype::s_info = { "BeforeProcessEventPrototype", 0, &JSBeforeProcessEventPrototypeTable, 0 };
       
   116 
       
   117 JSObject* JSBeforeProcessEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   118 {
       
   119     return getDOMPrototype<JSBeforeProcessEvent>(exec, globalObject);
       
   120 }
       
   121 
       
   122 bool JSBeforeProcessEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   123 {
       
   124     return getStaticFunctionSlot<JSObject>(exec, &JSBeforeProcessEventPrototypeTable, this, propertyName, slot);
       
   125 }
       
   126 
       
   127 bool JSBeforeProcessEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   128 {
       
   129     return getStaticFunctionDescriptor<JSObject>(exec, &JSBeforeProcessEventPrototypeTable, this, propertyName, descriptor);
       
   130 }
       
   131 
       
   132 const ClassInfo JSBeforeProcessEvent::s_info = { "BeforeProcessEvent", &JSEvent::s_info, &JSBeforeProcessEventTable, 0 };
       
   133 
       
   134 JSBeforeProcessEvent::JSBeforeProcessEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<BeforeProcessEvent> impl)
       
   135     : JSEvent(structure, globalObject, impl)
       
   136 {
       
   137 }
       
   138 
       
   139 JSObject* JSBeforeProcessEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   140 {
       
   141     return new (exec) JSBeforeProcessEventPrototype(globalObject, JSBeforeProcessEventPrototype::createStructure(JSEventPrototype::self(exec, globalObject)));
       
   142 }
       
   143 
       
   144 bool JSBeforeProcessEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   145 {
       
   146     return getStaticValueSlot<JSBeforeProcessEvent, Base>(exec, &JSBeforeProcessEventTable, this, propertyName, slot);
       
   147 }
       
   148 
       
   149 bool JSBeforeProcessEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   150 {
       
   151     return getStaticValueDescriptor<JSBeforeProcessEvent, Base>(exec, &JSBeforeProcessEventTable, this, propertyName, descriptor);
       
   152 }
       
   153 
       
   154 JSValue jsBeforeProcessEventText(ExecState* exec, JSValue slotBase, const Identifier&)
       
   155 {
       
   156     JSBeforeProcessEvent* castedThis = static_cast<JSBeforeProcessEvent*>(asObject(slotBase));
       
   157     UNUSED_PARAM(exec);
       
   158     BeforeProcessEvent* imp = static_cast<BeforeProcessEvent*>(castedThis->impl());
       
   159     JSValue result = jsString(exec, imp->text());
       
   160     return result;
       
   161 }
       
   162 
       
   163 JSValue jsBeforeProcessEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   164 {
       
   165     JSBeforeProcessEvent* domObject = static_cast<JSBeforeProcessEvent*>(asObject(slotBase));
       
   166     return JSBeforeProcessEvent::getConstructor(exec, domObject->globalObject());
       
   167 }
       
   168 void JSBeforeProcessEvent::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
   169 {
       
   170     lookupPut<JSBeforeProcessEvent, Base>(exec, propertyName, value, &JSBeforeProcessEventTable, this, slot);
       
   171 }
       
   172 
       
   173 void setJSBeforeProcessEventText(ExecState* exec, JSObject* thisObject, JSValue value)
       
   174 {
       
   175     JSBeforeProcessEvent* castedThis = static_cast<JSBeforeProcessEvent*>(thisObject);
       
   176     BeforeProcessEvent* imp = static_cast<BeforeProcessEvent*>(castedThis->impl());
       
   177     imp->setText(ustringToString(value.toString(exec)));
       
   178 }
       
   179 
       
   180 JSValue JSBeforeProcessEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   181 {
       
   182     return getDOMConstructor<JSBeforeProcessEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   183 }
       
   184 
       
   185 EncodedJSValue JSC_HOST_CALL jsBeforeProcessEventPrototypeFunctionInitBeforeProcessEvent(ExecState* exec)
       
   186 {
       
   187     JSValue thisValue = exec->hostThisValue();
       
   188     if (!thisValue.inherits(&JSBeforeProcessEvent::s_info))
       
   189         return throwVMTypeError(exec);
       
   190     JSBeforeProcessEvent* castedThis = static_cast<JSBeforeProcessEvent*>(asObject(thisValue));
       
   191     BeforeProcessEvent* imp = static_cast<BeforeProcessEvent*>(castedThis->impl());
       
   192     const String& type = ustringToString(exec->argument(0).toString(exec));
       
   193     bool canBubble = exec->argument(1).toBoolean(exec);
       
   194     bool cancelable = exec->argument(2).toBoolean(exec);
       
   195 
       
   196     imp->initBeforeProcessEvent(type, canBubble, cancelable);
       
   197     return JSValue::encode(jsUndefined());
       
   198 }
       
   199 
       
   200 
       
   201 }