webengine/osswebengine/DerivedSources/WebCore/JSSVGAnimatedLength.cpp
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     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 
       
    24 #if ENABLE(SVG)
       
    25 
       
    26 #include "Document.h"
       
    27 #include "Frame.h"
       
    28 #include "SVGDocumentExtensions.h"
       
    29 #include "SVGElement.h"
       
    30 #include "SVGAnimatedTemplate.h"
       
    31 #include "JSSVGAnimatedLength.h"
       
    32 
       
    33 #include <wtf/GetPtr.h>
       
    34 
       
    35 #include "JSSVGLength.h"
       
    36 
       
    37 using namespace KJS;
       
    38 
       
    39 namespace WebCore {
       
    40 
       
    41 /* Hash table */
       
    42 
       
    43 static const HashEntry JSSVGAnimatedLengthTableEntries[] =
       
    44 {
       
    45     { "baseVal", JSSVGAnimatedLength::BaseValAttrNum, DontDelete|ReadOnly, 0, 0 },
       
    46     { "animVal", JSSVGAnimatedLength::AnimValAttrNum, DontDelete|ReadOnly, 0, 0 }
       
    47 };
       
    48 
       
    49 static const HashTable JSSVGAnimatedLengthTable = 
       
    50 {
       
    51     2, 2, JSSVGAnimatedLengthTableEntries, 2
       
    52 };
       
    53 
       
    54 /* Hash table for prototype */
       
    55 
       
    56 static const HashEntry JSSVGAnimatedLengthPrototypeTableEntries[] =
       
    57 {
       
    58     { 0, 0, 0, 0, 0 }
       
    59 };
       
    60 
       
    61 static const HashTable JSSVGAnimatedLengthPrototypeTable = 
       
    62 {
       
    63     2, 1, JSSVGAnimatedLengthPrototypeTableEntries, 1
       
    64 };
       
    65 
       
    66 const ClassInfo JSSVGAnimatedLengthPrototype::info = { "SVGAnimatedLengthPrototype", 0, &JSSVGAnimatedLengthPrototypeTable, 0 };
       
    67 
       
    68 JSObject* JSSVGAnimatedLengthPrototype::self(ExecState* exec)
       
    69 {
       
    70     return KJS::cacheGlobalObject<JSSVGAnimatedLengthPrototype>(exec, "[[JSSVGAnimatedLength.prototype]]");
       
    71 }
       
    72 
       
    73 const ClassInfo JSSVGAnimatedLength::info = { "SVGAnimatedLength", 0, &JSSVGAnimatedLengthTable, 0 };
       
    74 
       
    75 JSSVGAnimatedLength::JSSVGAnimatedLength(ExecState* exec, SVGAnimatedLength* impl)
       
    76     : m_impl(impl)
       
    77 {
       
    78     setPrototype(JSSVGAnimatedLengthPrototype::self(exec));
       
    79 }
       
    80 
       
    81 JSSVGAnimatedLength::~JSSVGAnimatedLength()
       
    82 {
       
    83     SVGDocumentExtensions::forgetGenericContext<SVGAnimatedLength>(m_impl.get());
       
    84     ScriptInterpreter::forgetDOMObject(m_impl.get());
       
    85 }
       
    86 
       
    87 bool JSSVGAnimatedLength::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    88 {
       
    89     return getStaticValueSlot<JSSVGAnimatedLength, KJS::DOMObject>(exec, &JSSVGAnimatedLengthTable, this, propertyName, slot);
       
    90 }
       
    91 
       
    92 JSValue* JSSVGAnimatedLength::getValueProperty(ExecState* exec, int token) const
       
    93 {
       
    94     switch (token) {
       
    95     case BaseValAttrNum: {
       
    96         SVGAnimatedLength* imp = static_cast<SVGAnimatedLength*>(impl());
       
    97 
       
    98         return toJS(exec, new JSSVGPODTypeWrapperCreator<SVGLength, SVGAnimatedLength>(imp, &SVGAnimatedLength::baseVal, &SVGAnimatedLength::setBaseVal));
       
    99     }
       
   100     case AnimValAttrNum: {
       
   101         SVGAnimatedLength* imp = static_cast<SVGAnimatedLength*>(impl());
       
   102 
       
   103         return toJS(exec, new JSSVGPODTypeWrapperCreator<SVGLength, SVGAnimatedLength>(imp, &SVGAnimatedLength::animVal, &SVGAnimatedLength::setAnimVal));
       
   104     }
       
   105     }
       
   106     return 0;
       
   107 }
       
   108 
       
   109 KJS::JSValue* toJS(KJS::ExecState* exec, SVGAnimatedLength* obj)
       
   110 {
       
   111     return KJS::cacheDOMObject<SVGAnimatedLength, JSSVGAnimatedLength>(exec, obj);
       
   112 }
       
   113 SVGAnimatedLength* toSVGAnimatedLength(KJS::JSValue* val)
       
   114 {
       
   115     return val->isObject(&JSSVGAnimatedLength::info) ? static_cast<JSSVGAnimatedLength*>(val)->impl() : 0;
       
   116 }
       
   117 
       
   118 }
       
   119 
       
   120 #endif // ENABLE(SVG)