webengine/osswebengine/DerivedSources/WebCore/JSSVGPathSegMovetoAbs.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 "JSSVGPathSegMovetoAbs.h"
       
    32 
       
    33 #include <wtf/GetPtr.h>
       
    34 
       
    35 #include "SVGPathSegMoveto.h"
       
    36 
       
    37 using namespace KJS;
       
    38 
       
    39 namespace WebCore {
       
    40 
       
    41 /* Hash table */
       
    42 
       
    43 static const HashEntry JSSVGPathSegMovetoAbsTableEntries[] =
       
    44 {
       
    45     { "y", JSSVGPathSegMovetoAbs::YAttrNum, DontDelete, 0, 0 },
       
    46     { "x", JSSVGPathSegMovetoAbs::XAttrNum, DontDelete, 0, 0 }
       
    47 };
       
    48 
       
    49 static const HashTable JSSVGPathSegMovetoAbsTable = 
       
    50 {
       
    51     2, 2, JSSVGPathSegMovetoAbsTableEntries, 2
       
    52 };
       
    53 
       
    54 /* Hash table for prototype */
       
    55 
       
    56 static const HashEntry JSSVGPathSegMovetoAbsPrototypeTableEntries[] =
       
    57 {
       
    58     { 0, 0, 0, 0, 0 }
       
    59 };
       
    60 
       
    61 static const HashTable JSSVGPathSegMovetoAbsPrototypeTable = 
       
    62 {
       
    63     2, 1, JSSVGPathSegMovetoAbsPrototypeTableEntries, 1
       
    64 };
       
    65 
       
    66 const ClassInfo JSSVGPathSegMovetoAbsPrototype::info = { "SVGPathSegMovetoAbsPrototype", 0, &JSSVGPathSegMovetoAbsPrototypeTable, 0 };
       
    67 
       
    68 JSObject* JSSVGPathSegMovetoAbsPrototype::self(ExecState* exec)
       
    69 {
       
    70     return KJS::cacheGlobalObject<JSSVGPathSegMovetoAbsPrototype>(exec, "[[JSSVGPathSegMovetoAbs.prototype]]");
       
    71 }
       
    72 
       
    73 const ClassInfo JSSVGPathSegMovetoAbs::info = { "SVGPathSegMovetoAbs", &JSSVGPathSeg::info, &JSSVGPathSegMovetoAbsTable, 0 };
       
    74 
       
    75 JSSVGPathSegMovetoAbs::JSSVGPathSegMovetoAbs(ExecState* exec, SVGPathSegMovetoAbs* impl)
       
    76     : JSSVGPathSeg(exec, impl)
       
    77 {
       
    78     setPrototype(JSSVGPathSegMovetoAbsPrototype::self(exec));
       
    79 }
       
    80 
       
    81 bool JSSVGPathSegMovetoAbs::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    82 {
       
    83     return getStaticValueSlot<JSSVGPathSegMovetoAbs, JSSVGPathSeg>(exec, &JSSVGPathSegMovetoAbsTable, this, propertyName, slot);
       
    84 }
       
    85 
       
    86 JSValue* JSSVGPathSegMovetoAbs::getValueProperty(ExecState* exec, int token) const
       
    87 {
       
    88     switch (token) {
       
    89     case XAttrNum: {
       
    90         SVGPathSegMovetoAbs* imp = static_cast<SVGPathSegMovetoAbs*>(impl());
       
    91 
       
    92         return jsNumber(imp->x());
       
    93     }
       
    94     case YAttrNum: {
       
    95         SVGPathSegMovetoAbs* imp = static_cast<SVGPathSegMovetoAbs*>(impl());
       
    96 
       
    97         return jsNumber(imp->y());
       
    98     }
       
    99     }
       
   100     return 0;
       
   101 }
       
   102 
       
   103 void JSSVGPathSegMovetoAbs::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
       
   104 {
       
   105     lookupPut<JSSVGPathSegMovetoAbs, JSSVGPathSeg>(exec, propertyName, value, attr, &JSSVGPathSegMovetoAbsTable, this);
       
   106 }
       
   107 
       
   108 void JSSVGPathSegMovetoAbs::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
       
   109 {
       
   110     switch (token) {
       
   111     case XAttrNum: {
       
   112         SVGPathSegMovetoAbs* imp = static_cast<SVGPathSegMovetoAbs*>(impl());
       
   113 
       
   114         imp->setX(value->toFloat(exec));
       
   115         break;
       
   116     }
       
   117     case YAttrNum: {
       
   118         SVGPathSegMovetoAbs* imp = static_cast<SVGPathSegMovetoAbs*>(impl());
       
   119 
       
   120         imp->setY(value->toFloat(exec));
       
   121         break;
       
   122     }
       
   123     }
       
   124     SVGPathSegMovetoAbs* imp = static_cast<SVGPathSegMovetoAbs*>(impl());
       
   125 
       
   126     ASSERT(exec && exec->dynamicInterpreter());
       
   127     Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
       
   128     if (!activeFrame)
       
   129         return;
       
   130 
       
   131     SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
       
   132     if (extensions && extensions->hasGenericContext<SVGPathSeg>(imp)) {
       
   133         const SVGElement* context = extensions->genericContext<SVGPathSeg>(imp);
       
   134         ASSERT(context);
       
   135 
       
   136         context->notifyAttributeChange();
       
   137     }
       
   138 
       
   139 }
       
   140 
       
   141 
       
   142 }
       
   143 
       
   144 #endif // ENABLE(SVG)