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