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