WebCore/generated/JSSVGAnimatedEnumeration.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 
       
    23 #if ENABLE(SVG)
       
    24 
       
    25 #include "JSSVGAnimatedEnumeration.h"
       
    26 
       
    27 #include <runtime/JSNumberCell.h>
       
    28 #include <wtf/GetPtr.h>
       
    29 
       
    30 using namespace JSC;
       
    31 
       
    32 namespace WebCore {
       
    33 
       
    34 ASSERT_CLASS_FITS_IN_CELL(JSSVGAnimatedEnumeration);
       
    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 JSSVGAnimatedEnumerationTableValues[4] =
       
    44 {
       
    45     { "baseVal", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedEnumerationBaseVal), (intptr_t)setJSSVGAnimatedEnumerationBaseVal THUNK_GENERATOR(0) },
       
    46     { "animVal", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedEnumerationAnimVal), (intptr_t)0 THUNK_GENERATOR(0) },
       
    47     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedEnumerationConstructor), (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 JSSVGAnimatedEnumerationTable = { 8, 7, JSSVGAnimatedEnumerationTableValues, 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 JSSVGAnimatedEnumerationConstructorTableValues[1] =
       
    61 {
       
    62     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    63 };
       
    64 
       
    65 #undef THUNK_GENERATOR
       
    66 static JSC_CONST_HASHTABLE HashTable JSSVGAnimatedEnumerationConstructorTable = { 1, 0, JSSVGAnimatedEnumerationConstructorTableValues, 0 };
       
    67 class JSSVGAnimatedEnumerationConstructor : public DOMConstructorObject {
       
    68 public:
       
    69     JSSVGAnimatedEnumerationConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    70 
       
    71     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    72     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    73     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    74     static const JSC::ClassInfo s_info;
       
    75     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    76     {
       
    77         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    78     }
       
    79 protected:
       
    80     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    81 };
       
    82 
       
    83 const ClassInfo JSSVGAnimatedEnumerationConstructor::s_info = { "SVGAnimatedEnumerationConstructor", 0, &JSSVGAnimatedEnumerationConstructorTable, 0 };
       
    84 
       
    85 JSSVGAnimatedEnumerationConstructor::JSSVGAnimatedEnumerationConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    86     : DOMConstructorObject(JSSVGAnimatedEnumerationConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    87 {
       
    88     putDirect(exec->propertyNames().prototype, JSSVGAnimatedEnumerationPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    89 }
       
    90 
       
    91 bool JSSVGAnimatedEnumerationConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    92 {
       
    93     return getStaticValueSlot<JSSVGAnimatedEnumerationConstructor, DOMObject>(exec, &JSSVGAnimatedEnumerationConstructorTable, this, propertyName, slot);
       
    94 }
       
    95 
       
    96 bool JSSVGAnimatedEnumerationConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
    97 {
       
    98     return getStaticValueDescriptor<JSSVGAnimatedEnumerationConstructor, DOMObject>(exec, &JSSVGAnimatedEnumerationConstructorTable, this, propertyName, descriptor);
       
    99 }
       
   100 
       
   101 /* Hash table for prototype */
       
   102 #if ENABLE(JIT)
       
   103 #define THUNK_GENERATOR(generator) , generator
       
   104 #else
       
   105 #define THUNK_GENERATOR(generator)
       
   106 #endif
       
   107 
       
   108 static const HashTableValue JSSVGAnimatedEnumerationPrototypeTableValues[1] =
       
   109 {
       
   110     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   111 };
       
   112 
       
   113 #undef THUNK_GENERATOR
       
   114 static JSC_CONST_HASHTABLE HashTable JSSVGAnimatedEnumerationPrototypeTable = { 1, 0, JSSVGAnimatedEnumerationPrototypeTableValues, 0 };
       
   115 const ClassInfo JSSVGAnimatedEnumerationPrototype::s_info = { "SVGAnimatedEnumerationPrototype", 0, &JSSVGAnimatedEnumerationPrototypeTable, 0 };
       
   116 
       
   117 JSObject* JSSVGAnimatedEnumerationPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   118 {
       
   119     return getDOMPrototype<JSSVGAnimatedEnumeration>(exec, globalObject);
       
   120 }
       
   121 
       
   122 const ClassInfo JSSVGAnimatedEnumeration::s_info = { "SVGAnimatedEnumeration", 0, &JSSVGAnimatedEnumerationTable, 0 };
       
   123 
       
   124 JSSVGAnimatedEnumeration::JSSVGAnimatedEnumeration(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGAnimatedEnumeration> impl)
       
   125     : DOMObjectWithGlobalPointer(structure, globalObject)
       
   126     , m_impl(impl)
       
   127 {
       
   128 }
       
   129 
       
   130 JSSVGAnimatedEnumeration::~JSSVGAnimatedEnumeration()
       
   131 {
       
   132     forgetDOMObject(this, impl());
       
   133     JSSVGContextCache::forgetWrapper(this);
       
   134 }
       
   135 
       
   136 JSObject* JSSVGAnimatedEnumeration::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   137 {
       
   138     return new (exec) JSSVGAnimatedEnumerationPrototype(globalObject, JSSVGAnimatedEnumerationPrototype::createStructure(globalObject->objectPrototype()));
       
   139 }
       
   140 
       
   141 bool JSSVGAnimatedEnumeration::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   142 {
       
   143     return getStaticValueSlot<JSSVGAnimatedEnumeration, Base>(exec, &JSSVGAnimatedEnumerationTable, this, propertyName, slot);
       
   144 }
       
   145 
       
   146 bool JSSVGAnimatedEnumeration::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   147 {
       
   148     return getStaticValueDescriptor<JSSVGAnimatedEnumeration, Base>(exec, &JSSVGAnimatedEnumerationTable, this, propertyName, descriptor);
       
   149 }
       
   150 
       
   151 JSValue jsSVGAnimatedEnumerationBaseVal(ExecState* exec, JSValue slotBase, const Identifier&)
       
   152 {
       
   153     JSSVGAnimatedEnumeration* castedThis = static_cast<JSSVGAnimatedEnumeration*>(asObject(slotBase));
       
   154     UNUSED_PARAM(exec);
       
   155     SVGAnimatedEnumeration* imp = static_cast<SVGAnimatedEnumeration*>(castedThis->impl());
       
   156     JSValue result = jsNumber(exec, imp->baseVal());
       
   157     return result;
       
   158 }
       
   159 
       
   160 JSValue jsSVGAnimatedEnumerationAnimVal(ExecState* exec, JSValue slotBase, const Identifier&)
       
   161 {
       
   162     JSSVGAnimatedEnumeration* castedThis = static_cast<JSSVGAnimatedEnumeration*>(asObject(slotBase));
       
   163     UNUSED_PARAM(exec);
       
   164     SVGAnimatedEnumeration* imp = static_cast<SVGAnimatedEnumeration*>(castedThis->impl());
       
   165     JSValue result = jsNumber(exec, imp->animVal());
       
   166     return result;
       
   167 }
       
   168 
       
   169 JSValue jsSVGAnimatedEnumerationConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   170 {
       
   171     JSSVGAnimatedEnumeration* domObject = static_cast<JSSVGAnimatedEnumeration*>(asObject(slotBase));
       
   172     return JSSVGAnimatedEnumeration::getConstructor(exec, domObject->globalObject());
       
   173 }
       
   174 void JSSVGAnimatedEnumeration::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
   175 {
       
   176     lookupPut<JSSVGAnimatedEnumeration, Base>(exec, propertyName, value, &JSSVGAnimatedEnumerationTable, this, slot);
       
   177 }
       
   178 
       
   179 void setJSSVGAnimatedEnumerationBaseVal(ExecState* exec, JSObject* thisObject, JSValue value)
       
   180 {
       
   181     JSSVGAnimatedEnumeration* castedThis = static_cast<JSSVGAnimatedEnumeration*>(thisObject);
       
   182     SVGAnimatedEnumeration* imp = static_cast<SVGAnimatedEnumeration*>(castedThis->impl());
       
   183     imp->setBaseVal(value.toInt32(exec));
       
   184     JSSVGContextCache::propagateSVGDOMChange(castedThis, imp->associatedAttributeName());
       
   185 }
       
   186 
       
   187 JSValue JSSVGAnimatedEnumeration::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   188 {
       
   189     return getDOMConstructor<JSSVGAnimatedEnumerationConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   190 }
       
   191 
       
   192 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGAnimatedEnumeration* object, SVGElement* context)
       
   193 {
       
   194     return getDOMObjectWrapper<JSSVGAnimatedEnumeration>(exec, globalObject, object, context);
       
   195 }
       
   196 SVGAnimatedEnumeration* toSVGAnimatedEnumeration(JSC::JSValue value)
       
   197 {
       
   198     return value.inherits(&JSSVGAnimatedEnumeration::s_info) ? static_cast<JSSVGAnimatedEnumeration*>(asObject(value))->impl() : 0;
       
   199 }
       
   200 
       
   201 }
       
   202 
       
   203 #endif // ENABLE(SVG)