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