WebCore/generated/JSSVGViewElement.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 "JSSVGViewElement.h"
       
    26 
       
    27 #include "JSSVGAnimatedBoolean.h"
       
    28 #include "JSSVGAnimatedPreserveAspectRatio.h"
       
    29 #include "JSSVGAnimatedRect.h"
       
    30 #include "JSSVGStringList.h"
       
    31 #include "SVGStringList.h"
       
    32 #include "SVGViewElement.h"
       
    33 #include <runtime/JSNumberCell.h>
       
    34 #include <wtf/GetPtr.h>
       
    35 
       
    36 using namespace JSC;
       
    37 
       
    38 namespace WebCore {
       
    39 
       
    40 ASSERT_CLASS_FITS_IN_CELL(JSSVGViewElement);
       
    41 
       
    42 /* Hash table */
       
    43 #if ENABLE(JIT)
       
    44 #define THUNK_GENERATOR(generator) , generator
       
    45 #else
       
    46 #define THUNK_GENERATOR(generator)
       
    47 #endif
       
    48 
       
    49 static const HashTableValue JSSVGViewElementTableValues[7] =
       
    50 {
       
    51     { "viewTarget", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementViewTarget), (intptr_t)0 THUNK_GENERATOR(0) },
       
    52     { "externalResourcesRequired", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementExternalResourcesRequired), (intptr_t)0 THUNK_GENERATOR(0) },
       
    53     { "viewBox", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementViewBox), (intptr_t)0 THUNK_GENERATOR(0) },
       
    54     { "preserveAspectRatio", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementPreserveAspectRatio), (intptr_t)0 THUNK_GENERATOR(0) },
       
    55     { "zoomAndPan", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementZoomAndPan), (intptr_t)setJSSVGViewElementZoomAndPan THUNK_GENERATOR(0) },
       
    56     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    57     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    58 };
       
    59 
       
    60 #undef THUNK_GENERATOR
       
    61 static JSC_CONST_HASHTABLE HashTable JSSVGViewElementTable = { 16, 15, JSSVGViewElementTableValues, 0 };
       
    62 /* Hash table for constructor */
       
    63 #if ENABLE(JIT)
       
    64 #define THUNK_GENERATOR(generator) , generator
       
    65 #else
       
    66 #define THUNK_GENERATOR(generator)
       
    67 #endif
       
    68 
       
    69 static const HashTableValue JSSVGViewElementConstructorTableValues[4] =
       
    70 {
       
    71     { "SVG_ZOOMANDPAN_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) },
       
    72     { "SVG_ZOOMANDPAN_DISABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_DISABLE), (intptr_t)0 THUNK_GENERATOR(0) },
       
    73     { "SVG_ZOOMANDPAN_MAGNIFY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_MAGNIFY), (intptr_t)0 THUNK_GENERATOR(0) },
       
    74     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    75 };
       
    76 
       
    77 #undef THUNK_GENERATOR
       
    78 static JSC_CONST_HASHTABLE HashTable JSSVGViewElementConstructorTable = { 9, 7, JSSVGViewElementConstructorTableValues, 0 };
       
    79 
       
    80 COMPILE_ASSERT(0 == SVGViewElement::SVG_ZOOMANDPAN_UNKNOWN, SVGViewElementEnumSVG_ZOOMANDPAN_UNKNOWNIsWrongUseDontCheckEnums);
       
    81 COMPILE_ASSERT(1 == SVGViewElement::SVG_ZOOMANDPAN_DISABLE, SVGViewElementEnumSVG_ZOOMANDPAN_DISABLEIsWrongUseDontCheckEnums);
       
    82 COMPILE_ASSERT(2 == SVGViewElement::SVG_ZOOMANDPAN_MAGNIFY, SVGViewElementEnumSVG_ZOOMANDPAN_MAGNIFYIsWrongUseDontCheckEnums);
       
    83 
       
    84 class JSSVGViewElementConstructor : public DOMConstructorObject {
       
    85 public:
       
    86     JSSVGViewElementConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    87 
       
    88     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    89     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    90     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    91     static const JSC::ClassInfo s_info;
       
    92     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    93     {
       
    94         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    95     }
       
    96 protected:
       
    97     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    98 };
       
    99 
       
   100 const ClassInfo JSSVGViewElementConstructor::s_info = { "SVGViewElementConstructor", 0, &JSSVGViewElementConstructorTable, 0 };
       
   101 
       
   102 JSSVGViewElementConstructor::JSSVGViewElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
   103     : DOMConstructorObject(JSSVGViewElementConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
   104 {
       
   105     putDirect(exec->propertyNames().prototype, JSSVGViewElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
   106 }
       
   107 
       
   108 bool JSSVGViewElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   109 {
       
   110     return getStaticValueSlot<JSSVGViewElementConstructor, DOMObject>(exec, &JSSVGViewElementConstructorTable, this, propertyName, slot);
       
   111 }
       
   112 
       
   113 bool JSSVGViewElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   114 {
       
   115     return getStaticValueDescriptor<JSSVGViewElementConstructor, DOMObject>(exec, &JSSVGViewElementConstructorTable, this, propertyName, descriptor);
       
   116 }
       
   117 
       
   118 /* Hash table for prototype */
       
   119 #if ENABLE(JIT)
       
   120 #define THUNK_GENERATOR(generator) , generator
       
   121 #else
       
   122 #define THUNK_GENERATOR(generator)
       
   123 #endif
       
   124 
       
   125 static const HashTableValue JSSVGViewElementPrototypeTableValues[4] =
       
   126 {
       
   127     { "SVG_ZOOMANDPAN_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) },
       
   128     { "SVG_ZOOMANDPAN_DISABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_DISABLE), (intptr_t)0 THUNK_GENERATOR(0) },
       
   129     { "SVG_ZOOMANDPAN_MAGNIFY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGViewElementSVG_ZOOMANDPAN_MAGNIFY), (intptr_t)0 THUNK_GENERATOR(0) },
       
   130     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   131 };
       
   132 
       
   133 #undef THUNK_GENERATOR
       
   134 static JSC_CONST_HASHTABLE HashTable JSSVGViewElementPrototypeTable = { 9, 7, JSSVGViewElementPrototypeTableValues, 0 };
       
   135 const ClassInfo JSSVGViewElementPrototype::s_info = { "SVGViewElementPrototype", 0, &JSSVGViewElementPrototypeTable, 0 };
       
   136 
       
   137 JSObject* JSSVGViewElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   138 {
       
   139     return getDOMPrototype<JSSVGViewElement>(exec, globalObject);
       
   140 }
       
   141 
       
   142 bool JSSVGViewElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   143 {
       
   144     return getStaticValueSlot<JSSVGViewElementPrototype, JSObject>(exec, &JSSVGViewElementPrototypeTable, this, propertyName, slot);
       
   145 }
       
   146 
       
   147 bool JSSVGViewElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   148 {
       
   149     return getStaticValueDescriptor<JSSVGViewElementPrototype, JSObject>(exec, &JSSVGViewElementPrototypeTable, this, propertyName, descriptor);
       
   150 }
       
   151 
       
   152 const ClassInfo JSSVGViewElement::s_info = { "SVGViewElement", &JSSVGElement::s_info, &JSSVGViewElementTable, 0 };
       
   153 
       
   154 JSSVGViewElement::JSSVGViewElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGViewElement> impl)
       
   155     : JSSVGElement(structure, globalObject, impl)
       
   156 {
       
   157 }
       
   158 
       
   159 JSObject* JSSVGViewElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   160 {
       
   161     return new (exec) JSSVGViewElementPrototype(globalObject, JSSVGViewElementPrototype::createStructure(JSSVGElementPrototype::self(exec, globalObject)));
       
   162 }
       
   163 
       
   164 bool JSSVGViewElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   165 {
       
   166     return getStaticValueSlot<JSSVGViewElement, Base>(exec, &JSSVGViewElementTable, this, propertyName, slot);
       
   167 }
       
   168 
       
   169 bool JSSVGViewElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   170 {
       
   171     return getStaticValueDescriptor<JSSVGViewElement, Base>(exec, &JSSVGViewElementTable, this, propertyName, descriptor);
       
   172 }
       
   173 
       
   174 JSValue jsSVGViewElementViewTarget(ExecState* exec, JSValue slotBase, const Identifier&)
       
   175 {
       
   176     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(asObject(slotBase));
       
   177     UNUSED_PARAM(exec);
       
   178     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
       
   179     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->viewTarget()), imp);
       
   180     return result;
       
   181 }
       
   182 
       
   183 JSValue jsSVGViewElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&)
       
   184 {
       
   185     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(asObject(slotBase));
       
   186     UNUSED_PARAM(exec);
       
   187     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
       
   188     RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated();
       
   189     JSValue result =  toJS(exec, castedThis->globalObject(), obj.get(), imp);
       
   190     return result;
       
   191 }
       
   192 
       
   193 JSValue jsSVGViewElementViewBox(ExecState* exec, JSValue slotBase, const Identifier&)
       
   194 {
       
   195     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(asObject(slotBase));
       
   196     UNUSED_PARAM(exec);
       
   197     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
       
   198     RefPtr<SVGAnimatedRect> obj = imp->viewBoxAnimated();
       
   199     JSValue result =  toJS(exec, castedThis->globalObject(), obj.get(), imp);
       
   200     return result;
       
   201 }
       
   202 
       
   203 JSValue jsSVGViewElementPreserveAspectRatio(ExecState* exec, JSValue slotBase, const Identifier&)
       
   204 {
       
   205     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(asObject(slotBase));
       
   206     UNUSED_PARAM(exec);
       
   207     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
       
   208     RefPtr<SVGAnimatedPreserveAspectRatio> obj = imp->preserveAspectRatioAnimated();
       
   209     JSValue result =  toJS(exec, castedThis->globalObject(), obj.get(), imp);
       
   210     return result;
       
   211 }
       
   212 
       
   213 JSValue jsSVGViewElementZoomAndPan(ExecState* exec, JSValue slotBase, const Identifier&)
       
   214 {
       
   215     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(asObject(slotBase));
       
   216     UNUSED_PARAM(exec);
       
   217     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
       
   218     JSValue result = jsNumber(exec, imp->zoomAndPan());
       
   219     return result;
       
   220 }
       
   221 
       
   222 JSValue jsSVGViewElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   223 {
       
   224     JSSVGViewElement* domObject = static_cast<JSSVGViewElement*>(asObject(slotBase));
       
   225     return JSSVGViewElement::getConstructor(exec, domObject->globalObject());
       
   226 }
       
   227 void JSSVGViewElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
   228 {
       
   229     lookupPut<JSSVGViewElement, Base>(exec, propertyName, value, &JSSVGViewElementTable, this, slot);
       
   230 }
       
   231 
       
   232 void setJSSVGViewElementZoomAndPan(ExecState* exec, JSObject* thisObject, JSValue value)
       
   233 {
       
   234     JSSVGViewElement* castedThis = static_cast<JSSVGViewElement*>(thisObject);
       
   235     SVGViewElement* imp = static_cast<SVGViewElement*>(castedThis->impl());
       
   236     imp->setZoomAndPan(value.toInt32(exec));
       
   237 }
       
   238 
       
   239 JSValue JSSVGViewElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   240 {
       
   241     return getDOMConstructor<JSSVGViewElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   242 }
       
   243 
       
   244 // Constant getters
       
   245 
       
   246 JSValue jsSVGViewElementSVG_ZOOMANDPAN_UNKNOWN(ExecState* exec, JSValue, const Identifier&)
       
   247 {
       
   248     return jsNumber(exec, static_cast<int>(0));
       
   249 }
       
   250 
       
   251 JSValue jsSVGViewElementSVG_ZOOMANDPAN_DISABLE(ExecState* exec, JSValue, const Identifier&)
       
   252 {
       
   253     return jsNumber(exec, static_cast<int>(1));
       
   254 }
       
   255 
       
   256 JSValue jsSVGViewElementSVG_ZOOMANDPAN_MAGNIFY(ExecState* exec, JSValue, const Identifier&)
       
   257 {
       
   258     return jsNumber(exec, static_cast<int>(2));
       
   259 }
       
   260 
       
   261 
       
   262 }
       
   263 
       
   264 #endif // ENABLE(SVG)