WebCore/generated/JSRect.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 "JSRect.h"
       
    23 
       
    24 #include "CSSPrimitiveValue.h"
       
    25 #include "JSCSSPrimitiveValue.h"
       
    26 #include "Rect.h"
       
    27 #include <wtf/GetPtr.h>
       
    28 
       
    29 using namespace JSC;
       
    30 
       
    31 namespace WebCore {
       
    32 
       
    33 ASSERT_CLASS_FITS_IN_CELL(JSRect);
       
    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 JSRectTableValues[6] =
       
    43 {
       
    44     { "top", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRectTop), (intptr_t)0 THUNK_GENERATOR(0) },
       
    45     { "right", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRectRight), (intptr_t)0 THUNK_GENERATOR(0) },
       
    46     { "bottom", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRectBottom), (intptr_t)0 THUNK_GENERATOR(0) },
       
    47     { "left", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRectLeft), (intptr_t)0 THUNK_GENERATOR(0) },
       
    48     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsRectConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    49     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    50 };
       
    51 
       
    52 #undef THUNK_GENERATOR
       
    53 static JSC_CONST_HASHTABLE HashTable JSRectTable = { 16, 15, JSRectTableValues, 0 };
       
    54 /* Hash table for constructor */
       
    55 #if ENABLE(JIT)
       
    56 #define THUNK_GENERATOR(generator) , generator
       
    57 #else
       
    58 #define THUNK_GENERATOR(generator)
       
    59 #endif
       
    60 
       
    61 static const HashTableValue JSRectConstructorTableValues[1] =
       
    62 {
       
    63     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    64 };
       
    65 
       
    66 #undef THUNK_GENERATOR
       
    67 static JSC_CONST_HASHTABLE HashTable JSRectConstructorTable = { 1, 0, JSRectConstructorTableValues, 0 };
       
    68 class JSRectConstructor : public DOMConstructorObject {
       
    69 public:
       
    70     JSRectConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    71 
       
    72     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    73     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    74     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    75     static const JSC::ClassInfo s_info;
       
    76     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    77     {
       
    78         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    79     }
       
    80 protected:
       
    81     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    82 };
       
    83 
       
    84 const ClassInfo JSRectConstructor::s_info = { "RectConstructor", 0, &JSRectConstructorTable, 0 };
       
    85 
       
    86 JSRectConstructor::JSRectConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    87     : DOMConstructorObject(JSRectConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    88 {
       
    89     putDirect(exec->propertyNames().prototype, JSRectPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    90 }
       
    91 
       
    92 bool JSRectConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    93 {
       
    94     return getStaticValueSlot<JSRectConstructor, DOMObject>(exec, &JSRectConstructorTable, this, propertyName, slot);
       
    95 }
       
    96 
       
    97 bool JSRectConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
    98 {
       
    99     return getStaticValueDescriptor<JSRectConstructor, DOMObject>(exec, &JSRectConstructorTable, this, propertyName, descriptor);
       
   100 }
       
   101 
       
   102 /* Hash table for prototype */
       
   103 #if ENABLE(JIT)
       
   104 #define THUNK_GENERATOR(generator) , generator
       
   105 #else
       
   106 #define THUNK_GENERATOR(generator)
       
   107 #endif
       
   108 
       
   109 static const HashTableValue JSRectPrototypeTableValues[1] =
       
   110 {
       
   111     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   112 };
       
   113 
       
   114 #undef THUNK_GENERATOR
       
   115 static JSC_CONST_HASHTABLE HashTable JSRectPrototypeTable = { 1, 0, JSRectPrototypeTableValues, 0 };
       
   116 const ClassInfo JSRectPrototype::s_info = { "RectPrototype", 0, &JSRectPrototypeTable, 0 };
       
   117 
       
   118 JSObject* JSRectPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   119 {
       
   120     return getDOMPrototype<JSRect>(exec, globalObject);
       
   121 }
       
   122 
       
   123 const ClassInfo JSRect::s_info = { "Rect", 0, &JSRectTable, 0 };
       
   124 
       
   125 JSRect::JSRect(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<Rect> impl)
       
   126     : DOMObjectWithGlobalPointer(structure, globalObject)
       
   127     , m_impl(impl)
       
   128 {
       
   129 }
       
   130 
       
   131 JSRect::~JSRect()
       
   132 {
       
   133     forgetDOMObject(this, impl());
       
   134 }
       
   135 
       
   136 JSObject* JSRect::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   137 {
       
   138     return new (exec) JSRectPrototype(globalObject, JSRectPrototype::createStructure(globalObject->objectPrototype()));
       
   139 }
       
   140 
       
   141 bool JSRect::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   142 {
       
   143     return getStaticValueSlot<JSRect, Base>(exec, &JSRectTable, this, propertyName, slot);
       
   144 }
       
   145 
       
   146 bool JSRect::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   147 {
       
   148     return getStaticValueDescriptor<JSRect, Base>(exec, &JSRectTable, this, propertyName, descriptor);
       
   149 }
       
   150 
       
   151 JSValue jsRectTop(ExecState* exec, JSValue slotBase, const Identifier&)
       
   152 {
       
   153     JSRect* castedThis = static_cast<JSRect*>(asObject(slotBase));
       
   154     UNUSED_PARAM(exec);
       
   155     Rect* imp = static_cast<Rect*>(castedThis->impl());
       
   156     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->top()));
       
   157     return result;
       
   158 }
       
   159 
       
   160 JSValue jsRectRight(ExecState* exec, JSValue slotBase, const Identifier&)
       
   161 {
       
   162     JSRect* castedThis = static_cast<JSRect*>(asObject(slotBase));
       
   163     UNUSED_PARAM(exec);
       
   164     Rect* imp = static_cast<Rect*>(castedThis->impl());
       
   165     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->right()));
       
   166     return result;
       
   167 }
       
   168 
       
   169 JSValue jsRectBottom(ExecState* exec, JSValue slotBase, const Identifier&)
       
   170 {
       
   171     JSRect* castedThis = static_cast<JSRect*>(asObject(slotBase));
       
   172     UNUSED_PARAM(exec);
       
   173     Rect* imp = static_cast<Rect*>(castedThis->impl());
       
   174     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->bottom()));
       
   175     return result;
       
   176 }
       
   177 
       
   178 JSValue jsRectLeft(ExecState* exec, JSValue slotBase, const Identifier&)
       
   179 {
       
   180     JSRect* castedThis = static_cast<JSRect*>(asObject(slotBase));
       
   181     UNUSED_PARAM(exec);
       
   182     Rect* imp = static_cast<Rect*>(castedThis->impl());
       
   183     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->left()));
       
   184     return result;
       
   185 }
       
   186 
       
   187 JSValue jsRectConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   188 {
       
   189     JSRect* domObject = static_cast<JSRect*>(asObject(slotBase));
       
   190     return JSRect::getConstructor(exec, domObject->globalObject());
       
   191 }
       
   192 JSValue JSRect::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   193 {
       
   194     return getDOMConstructor<JSRectConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   195 }
       
   196 
       
   197 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Rect* object)
       
   198 {
       
   199     return getDOMObjectWrapper<JSRect>(exec, globalObject, object);
       
   200 }
       
   201 Rect* toRect(JSC::JSValue value)
       
   202 {
       
   203     return value.inherits(&JSRect::s_info) ? static_cast<JSRect*>(asObject(value))->impl() : 0;
       
   204 }
       
   205 
       
   206 }