WebCore/generated/JSWebKitPoint.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 "JSWebKitPoint.h"
       
    23 
       
    24 #include "WebKitPoint.h"
       
    25 #include <runtime/JSNumberCell.h>
       
    26 #include <wtf/GetPtr.h>
       
    27 
       
    28 using namespace JSC;
       
    29 
       
    30 namespace WebCore {
       
    31 
       
    32 ASSERT_CLASS_FITS_IN_CELL(JSWebKitPoint);
       
    33 
       
    34 /* Hash table */
       
    35 #if ENABLE(JIT)
       
    36 #define THUNK_GENERATOR(generator) , generator
       
    37 #else
       
    38 #define THUNK_GENERATOR(generator)
       
    39 #endif
       
    40 
       
    41 static const HashTableValue JSWebKitPointTableValues[4] =
       
    42 {
       
    43     { "x", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitPointX), (intptr_t)setJSWebKitPointX THUNK_GENERATOR(0) },
       
    44     { "y", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitPointY), (intptr_t)setJSWebKitPointY THUNK_GENERATOR(0) },
       
    45     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitPointConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    46     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    47 };
       
    48 
       
    49 #undef THUNK_GENERATOR
       
    50 static JSC_CONST_HASHTABLE HashTable JSWebKitPointTable = { 9, 7, JSWebKitPointTableValues, 0 };
       
    51 /* Hash table for constructor */
       
    52 #if ENABLE(JIT)
       
    53 #define THUNK_GENERATOR(generator) , generator
       
    54 #else
       
    55 #define THUNK_GENERATOR(generator)
       
    56 #endif
       
    57 
       
    58 static const HashTableValue JSWebKitPointConstructorTableValues[1] =
       
    59 {
       
    60     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    61 };
       
    62 
       
    63 #undef THUNK_GENERATOR
       
    64 static JSC_CONST_HASHTABLE HashTable JSWebKitPointConstructorTable = { 1, 0, JSWebKitPointConstructorTableValues, 0 };
       
    65 const ClassInfo JSWebKitPointConstructor::s_info = { "WebKitPointConstructor", 0, &JSWebKitPointConstructorTable, 0 };
       
    66 
       
    67 JSWebKitPointConstructor::JSWebKitPointConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    68     : DOMConstructorObject(JSWebKitPointConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    69 {
       
    70     putDirect(exec->propertyNames().prototype, JSWebKitPointPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    71     putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly | DontDelete | DontEnum);
       
    72 }
       
    73 
       
    74 bool JSWebKitPointConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    75 {
       
    76     return getStaticValueSlot<JSWebKitPointConstructor, DOMObject>(exec, &JSWebKitPointConstructorTable, this, propertyName, slot);
       
    77 }
       
    78 
       
    79 bool JSWebKitPointConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
    80 {
       
    81     return getStaticValueDescriptor<JSWebKitPointConstructor, DOMObject>(exec, &JSWebKitPointConstructorTable, this, propertyName, descriptor);
       
    82 }
       
    83 
       
    84 ConstructType JSWebKitPointConstructor::getConstructData(ConstructData& constructData)
       
    85 {
       
    86     constructData.native.function = constructJSWebKitPoint;
       
    87     return ConstructTypeHost;
       
    88 }
       
    89 
       
    90 /* Hash table for prototype */
       
    91 #if ENABLE(JIT)
       
    92 #define THUNK_GENERATOR(generator) , generator
       
    93 #else
       
    94 #define THUNK_GENERATOR(generator)
       
    95 #endif
       
    96 
       
    97 static const HashTableValue JSWebKitPointPrototypeTableValues[1] =
       
    98 {
       
    99     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   100 };
       
   101 
       
   102 #undef THUNK_GENERATOR
       
   103 static JSC_CONST_HASHTABLE HashTable JSWebKitPointPrototypeTable = { 1, 0, JSWebKitPointPrototypeTableValues, 0 };
       
   104 const ClassInfo JSWebKitPointPrototype::s_info = { "WebKitPointPrototype", 0, &JSWebKitPointPrototypeTable, 0 };
       
   105 
       
   106 JSObject* JSWebKitPointPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   107 {
       
   108     return getDOMPrototype<JSWebKitPoint>(exec, globalObject);
       
   109 }
       
   110 
       
   111 const ClassInfo JSWebKitPoint::s_info = { "WebKitPoint", 0, &JSWebKitPointTable, 0 };
       
   112 
       
   113 JSWebKitPoint::JSWebKitPoint(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebKitPoint> impl)
       
   114     : DOMObjectWithGlobalPointer(structure, globalObject)
       
   115     , m_impl(impl)
       
   116 {
       
   117 }
       
   118 
       
   119 JSWebKitPoint::~JSWebKitPoint()
       
   120 {
       
   121     forgetDOMObject(this, impl());
       
   122 }
       
   123 
       
   124 JSObject* JSWebKitPoint::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   125 {
       
   126     return new (exec) JSWebKitPointPrototype(globalObject, JSWebKitPointPrototype::createStructure(globalObject->objectPrototype()));
       
   127 }
       
   128 
       
   129 bool JSWebKitPoint::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   130 {
       
   131     return getStaticValueSlot<JSWebKitPoint, Base>(exec, &JSWebKitPointTable, this, propertyName, slot);
       
   132 }
       
   133 
       
   134 bool JSWebKitPoint::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   135 {
       
   136     return getStaticValueDescriptor<JSWebKitPoint, Base>(exec, &JSWebKitPointTable, this, propertyName, descriptor);
       
   137 }
       
   138 
       
   139 JSValue jsWebKitPointX(ExecState* exec, JSValue slotBase, const Identifier&)
       
   140 {
       
   141     JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(asObject(slotBase));
       
   142     UNUSED_PARAM(exec);
       
   143     WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
       
   144     JSValue result = jsNumber(exec, imp->x());
       
   145     return result;
       
   146 }
       
   147 
       
   148 JSValue jsWebKitPointY(ExecState* exec, JSValue slotBase, const Identifier&)
       
   149 {
       
   150     JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(asObject(slotBase));
       
   151     UNUSED_PARAM(exec);
       
   152     WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
       
   153     JSValue result = jsNumber(exec, imp->y());
       
   154     return result;
       
   155 }
       
   156 
       
   157 JSValue jsWebKitPointConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   158 {
       
   159     JSWebKitPoint* domObject = static_cast<JSWebKitPoint*>(asObject(slotBase));
       
   160     return JSWebKitPoint::getConstructor(exec, domObject->globalObject());
       
   161 }
       
   162 void JSWebKitPoint::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
   163 {
       
   164     lookupPut<JSWebKitPoint, Base>(exec, propertyName, value, &JSWebKitPointTable, this, slot);
       
   165 }
       
   166 
       
   167 void setJSWebKitPointX(ExecState* exec, JSObject* thisObject, JSValue value)
       
   168 {
       
   169     JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(thisObject);
       
   170     WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
       
   171     imp->setX(value.toFloat(exec));
       
   172 }
       
   173 
       
   174 void setJSWebKitPointY(ExecState* exec, JSObject* thisObject, JSValue value)
       
   175 {
       
   176     JSWebKitPoint* castedThis = static_cast<JSWebKitPoint*>(thisObject);
       
   177     WebKitPoint* imp = static_cast<WebKitPoint*>(castedThis->impl());
       
   178     imp->setY(value.toFloat(exec));
       
   179 }
       
   180 
       
   181 JSValue JSWebKitPoint::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   182 {
       
   183     return getDOMConstructor<JSWebKitPointConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   184 }
       
   185 
       
   186 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebKitPoint* object)
       
   187 {
       
   188     return getDOMObjectWrapper<JSWebKitPoint>(exec, globalObject, object);
       
   189 }
       
   190 WebKitPoint* toWebKitPoint(JSC::JSValue value)
       
   191 {
       
   192     return value.inherits(&JSWebKitPoint::s_info) ? static_cast<JSWebKitPoint*>(asObject(value))->impl() : 0;
       
   193 }
       
   194 
       
   195 }