WebCore/generated/JSClientRect.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 "JSClientRect.h"
       
    23 
       
    24 #include "ClientRect.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(JSClientRect);
       
    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 JSClientRectTableValues[8] =
       
    42 {
       
    43     { "top", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectTop), (intptr_t)0 THUNK_GENERATOR(0) },
       
    44     { "right", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectRight), (intptr_t)0 THUNK_GENERATOR(0) },
       
    45     { "bottom", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectBottom), (intptr_t)0 THUNK_GENERATOR(0) },
       
    46     { "left", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectLeft), (intptr_t)0 THUNK_GENERATOR(0) },
       
    47     { "width", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectWidth), (intptr_t)0 THUNK_GENERATOR(0) },
       
    48     { "height", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectHeight), (intptr_t)0 THUNK_GENERATOR(0) },
       
    49     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    50     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    51 };
       
    52 
       
    53 #undef THUNK_GENERATOR
       
    54 static JSC_CONST_HASHTABLE HashTable JSClientRectTable = { 18, 15, JSClientRectTableValues, 0 };
       
    55 /* Hash table for constructor */
       
    56 #if ENABLE(JIT)
       
    57 #define THUNK_GENERATOR(generator) , generator
       
    58 #else
       
    59 #define THUNK_GENERATOR(generator)
       
    60 #endif
       
    61 
       
    62 static const HashTableValue JSClientRectConstructorTableValues[1] =
       
    63 {
       
    64     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    65 };
       
    66 
       
    67 #undef THUNK_GENERATOR
       
    68 static JSC_CONST_HASHTABLE HashTable JSClientRectConstructorTable = { 1, 0, JSClientRectConstructorTableValues, 0 };
       
    69 class JSClientRectConstructor : public DOMConstructorObject {
       
    70 public:
       
    71     JSClientRectConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    72 
       
    73     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    74     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    75     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    76     static const JSC::ClassInfo s_info;
       
    77     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    78     {
       
    79         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    80     }
       
    81 protected:
       
    82     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    83 };
       
    84 
       
    85 const ClassInfo JSClientRectConstructor::s_info = { "ClientRectConstructor", 0, &JSClientRectConstructorTable, 0 };
       
    86 
       
    87 JSClientRectConstructor::JSClientRectConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    88     : DOMConstructorObject(JSClientRectConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    89 {
       
    90     putDirect(exec->propertyNames().prototype, JSClientRectPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    91 }
       
    92 
       
    93 bool JSClientRectConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    94 {
       
    95     return getStaticValueSlot<JSClientRectConstructor, DOMObject>(exec, &JSClientRectConstructorTable, this, propertyName, slot);
       
    96 }
       
    97 
       
    98 bool JSClientRectConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
    99 {
       
   100     return getStaticValueDescriptor<JSClientRectConstructor, DOMObject>(exec, &JSClientRectConstructorTable, this, propertyName, descriptor);
       
   101 }
       
   102 
       
   103 /* Hash table for prototype */
       
   104 #if ENABLE(JIT)
       
   105 #define THUNK_GENERATOR(generator) , generator
       
   106 #else
       
   107 #define THUNK_GENERATOR(generator)
       
   108 #endif
       
   109 
       
   110 static const HashTableValue JSClientRectPrototypeTableValues[1] =
       
   111 {
       
   112     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   113 };
       
   114 
       
   115 #undef THUNK_GENERATOR
       
   116 static JSC_CONST_HASHTABLE HashTable JSClientRectPrototypeTable = { 1, 0, JSClientRectPrototypeTableValues, 0 };
       
   117 const ClassInfo JSClientRectPrototype::s_info = { "ClientRectPrototype", 0, &JSClientRectPrototypeTable, 0 };
       
   118 
       
   119 JSObject* JSClientRectPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   120 {
       
   121     return getDOMPrototype<JSClientRect>(exec, globalObject);
       
   122 }
       
   123 
       
   124 const ClassInfo JSClientRect::s_info = { "ClientRect", 0, &JSClientRectTable, 0 };
       
   125 
       
   126 JSClientRect::JSClientRect(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<ClientRect> impl)
       
   127     : DOMObjectWithGlobalPointer(structure, globalObject)
       
   128     , m_impl(impl)
       
   129 {
       
   130 }
       
   131 
       
   132 JSClientRect::~JSClientRect()
       
   133 {
       
   134     forgetDOMObject(this, impl());
       
   135 }
       
   136 
       
   137 JSObject* JSClientRect::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   138 {
       
   139     return new (exec) JSClientRectPrototype(globalObject, JSClientRectPrototype::createStructure(globalObject->objectPrototype()));
       
   140 }
       
   141 
       
   142 bool JSClientRect::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   143 {
       
   144     return getStaticValueSlot<JSClientRect, Base>(exec, &JSClientRectTable, this, propertyName, slot);
       
   145 }
       
   146 
       
   147 bool JSClientRect::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   148 {
       
   149     return getStaticValueDescriptor<JSClientRect, Base>(exec, &JSClientRectTable, this, propertyName, descriptor);
       
   150 }
       
   151 
       
   152 JSValue jsClientRectTop(ExecState* exec, JSValue slotBase, const Identifier&)
       
   153 {
       
   154     JSClientRect* castedThis = static_cast<JSClientRect*>(asObject(slotBase));
       
   155     UNUSED_PARAM(exec);
       
   156     ClientRect* imp = static_cast<ClientRect*>(castedThis->impl());
       
   157     JSValue result = jsNumber(exec, imp->top());
       
   158     return result;
       
   159 }
       
   160 
       
   161 JSValue jsClientRectRight(ExecState* exec, JSValue slotBase, const Identifier&)
       
   162 {
       
   163     JSClientRect* castedThis = static_cast<JSClientRect*>(asObject(slotBase));
       
   164     UNUSED_PARAM(exec);
       
   165     ClientRect* imp = static_cast<ClientRect*>(castedThis->impl());
       
   166     JSValue result = jsNumber(exec, imp->right());
       
   167     return result;
       
   168 }
       
   169 
       
   170 JSValue jsClientRectBottom(ExecState* exec, JSValue slotBase, const Identifier&)
       
   171 {
       
   172     JSClientRect* castedThis = static_cast<JSClientRect*>(asObject(slotBase));
       
   173     UNUSED_PARAM(exec);
       
   174     ClientRect* imp = static_cast<ClientRect*>(castedThis->impl());
       
   175     JSValue result = jsNumber(exec, imp->bottom());
       
   176     return result;
       
   177 }
       
   178 
       
   179 JSValue jsClientRectLeft(ExecState* exec, JSValue slotBase, const Identifier&)
       
   180 {
       
   181     JSClientRect* castedThis = static_cast<JSClientRect*>(asObject(slotBase));
       
   182     UNUSED_PARAM(exec);
       
   183     ClientRect* imp = static_cast<ClientRect*>(castedThis->impl());
       
   184     JSValue result = jsNumber(exec, imp->left());
       
   185     return result;
       
   186 }
       
   187 
       
   188 JSValue jsClientRectWidth(ExecState* exec, JSValue slotBase, const Identifier&)
       
   189 {
       
   190     JSClientRect* castedThis = static_cast<JSClientRect*>(asObject(slotBase));
       
   191     UNUSED_PARAM(exec);
       
   192     ClientRect* imp = static_cast<ClientRect*>(castedThis->impl());
       
   193     JSValue result = jsNumber(exec, imp->width());
       
   194     return result;
       
   195 }
       
   196 
       
   197 JSValue jsClientRectHeight(ExecState* exec, JSValue slotBase, const Identifier&)
       
   198 {
       
   199     JSClientRect* castedThis = static_cast<JSClientRect*>(asObject(slotBase));
       
   200     UNUSED_PARAM(exec);
       
   201     ClientRect* imp = static_cast<ClientRect*>(castedThis->impl());
       
   202     JSValue result = jsNumber(exec, imp->height());
       
   203     return result;
       
   204 }
       
   205 
       
   206 JSValue jsClientRectConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   207 {
       
   208     JSClientRect* domObject = static_cast<JSClientRect*>(asObject(slotBase));
       
   209     return JSClientRect::getConstructor(exec, domObject->globalObject());
       
   210 }
       
   211 JSValue JSClientRect::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   212 {
       
   213     return getDOMConstructor<JSClientRectConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   214 }
       
   215 
       
   216 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, ClientRect* object)
       
   217 {
       
   218     return getDOMObjectWrapper<JSClientRect>(exec, globalObject, object);
       
   219 }
       
   220 ClientRect* toClientRect(JSC::JSValue value)
       
   221 {
       
   222     return value.inherits(&JSClientRect::s_info) ? static_cast<JSClientRect*>(asObject(value))->impl() : 0;
       
   223 }
       
   224 
       
   225 }