webengine/osswebengine/DerivedSources/WebCore/JSSVGMaskElement.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 "JSSVGMaskElement.h"
       
    32 
       
    33 #include <wtf/GetPtr.h>
       
    34 
       
    35 #include "CSSMutableStyleDeclaration.h"
       
    36 #include "CSSStyleDeclaration.h"
       
    37 #include "JSCSSStyleDeclaration.h"
       
    38 #include "JSSVGAnimatedBoolean.h"
       
    39 #include "JSSVGAnimatedLength.h"
       
    40 #include "JSSVGAnimatedString.h"
       
    41 #include "JSSVGStringList.h"
       
    42 #include "PlatformString.h"
       
    43 #include "SVGMaskElement.h"
       
    44 #include "SVGStringList.h"
       
    45 
       
    46 using namespace KJS;
       
    47 
       
    48 namespace WebCore {
       
    49 
       
    50 /* Hash table */
       
    51 
       
    52 static const HashEntry JSSVGMaskElementTableEntries[] =
       
    53 {
       
    54     { "systemLanguage", JSSVGMaskElement::SystemLanguageAttrNum, DontDelete|ReadOnly, 0, &JSSVGMaskElementTableEntries[14] },
       
    55     { 0, 0, 0, 0, 0 },
       
    56     { 0, 0, 0, 0, 0 },
       
    57     { "requiredFeatures", JSSVGMaskElement::RequiredFeaturesAttrNum, DontDelete|ReadOnly, 0, 0 },
       
    58     { "y", JSSVGMaskElement::YAttrNum, DontDelete|ReadOnly, 0, 0 },
       
    59     { "x", JSSVGMaskElement::XAttrNum, DontDelete|ReadOnly, 0, &JSSVGMaskElementTableEntries[12] },
       
    60     { "className", JSSVGMaskElement::ClassNameAttrNum, DontDelete|ReadOnly, 0, 0 },
       
    61     { "width", JSSVGMaskElement::WidthAttrNum, DontDelete|ReadOnly, 0, 0 },
       
    62     { "xmlspace", JSSVGMaskElement::XmlspaceAttrNum, DontDelete, 0, &JSSVGMaskElementTableEntries[16] },
       
    63     { 0, 0, 0, 0, 0 },
       
    64     { 0, 0, 0, 0, 0 },
       
    65     { 0, 0, 0, 0, 0 },
       
    66     { "height", JSSVGMaskElement::HeightAttrNum, DontDelete|ReadOnly, 0, &JSSVGMaskElementTableEntries[13] },
       
    67     { "requiredExtensions", JSSVGMaskElement::RequiredExtensionsAttrNum, DontDelete|ReadOnly, 0, &JSSVGMaskElementTableEntries[15] },
       
    68     { "xmllang", JSSVGMaskElement::XmllangAttrNum, DontDelete, 0, 0 },
       
    69     { "externalResourcesRequired", JSSVGMaskElement::ExternalResourcesRequiredAttrNum, DontDelete|ReadOnly, 0, 0 },
       
    70     { "style", JSSVGMaskElement::StyleAttrNum, DontDelete|ReadOnly, 0, 0 }
       
    71 };
       
    72 
       
    73 static const HashTable JSSVGMaskElementTable = 
       
    74 {
       
    75     2, 17, JSSVGMaskElementTableEntries, 12
       
    76 };
       
    77 
       
    78 /* Hash table for prototype */
       
    79 
       
    80 static const HashEntry JSSVGMaskElementPrototypeTableEntries[] =
       
    81 {
       
    82     { "hasExtension", JSSVGMaskElement::HasExtensionFuncNum, DontDelete|Function, 1, 0 }
       
    83 };
       
    84 
       
    85 static const HashTable JSSVGMaskElementPrototypeTable = 
       
    86 {
       
    87     2, 1, JSSVGMaskElementPrototypeTableEntries, 1
       
    88 };
       
    89 
       
    90 const ClassInfo JSSVGMaskElementPrototype::info = { "SVGMaskElementPrototype", 0, &JSSVGMaskElementPrototypeTable, 0 };
       
    91 
       
    92 JSObject* JSSVGMaskElementPrototype::self(ExecState* exec)
       
    93 {
       
    94     return KJS::cacheGlobalObject<JSSVGMaskElementPrototype>(exec, "[[JSSVGMaskElement.prototype]]");
       
    95 }
       
    96 
       
    97 bool JSSVGMaskElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    98 {
       
    99     return getStaticFunctionSlot<JSSVGMaskElementPrototypeFunction, JSObject>(exec, &JSSVGMaskElementPrototypeTable, this, propertyName, slot);
       
   100 }
       
   101 
       
   102 const ClassInfo JSSVGMaskElement::info = { "SVGMaskElement", &JSSVGElement::info, &JSSVGMaskElementTable, 0 };
       
   103 
       
   104 JSSVGMaskElement::JSSVGMaskElement(ExecState* exec, SVGMaskElement* impl)
       
   105     : JSSVGElement(exec, impl)
       
   106 {
       
   107     setPrototype(JSSVGMaskElementPrototype::self(exec));
       
   108 }
       
   109 
       
   110 bool JSSVGMaskElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   111 {
       
   112     return getStaticValueSlot<JSSVGMaskElement, JSSVGElement>(exec, &JSSVGMaskElementTable, this, propertyName, slot);
       
   113 }
       
   114 
       
   115 JSValue* JSSVGMaskElement::getValueProperty(ExecState* exec, int token) const
       
   116 {
       
   117     switch (token) {
       
   118     case XAttrNum: {
       
   119         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   120 
       
   121         ASSERT(exec && exec->dynamicInterpreter());
       
   122 
       
   123         RefPtr<SVGAnimatedLength> obj = imp->xAnimated();
       
   124         Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
       
   125         if (activeFrame) {
       
   126             SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
       
   127             if (extensions) {
       
   128                 if (extensions->hasGenericContext<SVGAnimatedLength>(obj.get()))
       
   129                     ASSERT(extensions->genericContext<SVGAnimatedLength>(obj.get()) == imp);
       
   130                 else
       
   131                     extensions->setGenericContext<SVGAnimatedLength>(obj.get(), imp);
       
   132             }
       
   133         }
       
   134 
       
   135         return toJS(exec, obj.get());
       
   136     }
       
   137     case YAttrNum: {
       
   138         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   139 
       
   140         ASSERT(exec && exec->dynamicInterpreter());
       
   141 
       
   142         RefPtr<SVGAnimatedLength> obj = imp->yAnimated();
       
   143         Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
       
   144         if (activeFrame) {
       
   145             SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
       
   146             if (extensions) {
       
   147                 if (extensions->hasGenericContext<SVGAnimatedLength>(obj.get()))
       
   148                     ASSERT(extensions->genericContext<SVGAnimatedLength>(obj.get()) == imp);
       
   149                 else
       
   150                     extensions->setGenericContext<SVGAnimatedLength>(obj.get(), imp);
       
   151             }
       
   152         }
       
   153 
       
   154         return toJS(exec, obj.get());
       
   155     }
       
   156     case WidthAttrNum: {
       
   157         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   158 
       
   159         ASSERT(exec && exec->dynamicInterpreter());
       
   160 
       
   161         RefPtr<SVGAnimatedLength> obj = imp->widthAnimated();
       
   162         Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
       
   163         if (activeFrame) {
       
   164             SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
       
   165             if (extensions) {
       
   166                 if (extensions->hasGenericContext<SVGAnimatedLength>(obj.get()))
       
   167                     ASSERT(extensions->genericContext<SVGAnimatedLength>(obj.get()) == imp);
       
   168                 else
       
   169                     extensions->setGenericContext<SVGAnimatedLength>(obj.get(), imp);
       
   170             }
       
   171         }
       
   172 
       
   173         return toJS(exec, obj.get());
       
   174     }
       
   175     case HeightAttrNum: {
       
   176         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   177 
       
   178         ASSERT(exec && exec->dynamicInterpreter());
       
   179 
       
   180         RefPtr<SVGAnimatedLength> obj = imp->heightAnimated();
       
   181         Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
       
   182         if (activeFrame) {
       
   183             SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
       
   184             if (extensions) {
       
   185                 if (extensions->hasGenericContext<SVGAnimatedLength>(obj.get()))
       
   186                     ASSERT(extensions->genericContext<SVGAnimatedLength>(obj.get()) == imp);
       
   187                 else
       
   188                     extensions->setGenericContext<SVGAnimatedLength>(obj.get(), imp);
       
   189             }
       
   190         }
       
   191 
       
   192         return toJS(exec, obj.get());
       
   193     }
       
   194     case RequiredFeaturesAttrNum: {
       
   195         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   196 
       
   197         return toJS(exec, WTF::getPtr(imp->requiredFeatures()));
       
   198     }
       
   199     case RequiredExtensionsAttrNum: {
       
   200         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   201 
       
   202         return toJS(exec, WTF::getPtr(imp->requiredExtensions()));
       
   203     }
       
   204     case SystemLanguageAttrNum: {
       
   205         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   206 
       
   207         return toJS(exec, WTF::getPtr(imp->systemLanguage()));
       
   208     }
       
   209     case XmllangAttrNum: {
       
   210         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   211 
       
   212         return jsString(imp->xmllang());
       
   213     }
       
   214     case XmlspaceAttrNum: {
       
   215         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   216 
       
   217         return jsString(imp->xmlspace());
       
   218     }
       
   219     case ExternalResourcesRequiredAttrNum: {
       
   220         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   221 
       
   222         ASSERT(exec && exec->dynamicInterpreter());
       
   223 
       
   224         RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated();
       
   225         Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
       
   226         if (activeFrame) {
       
   227             SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
       
   228             if (extensions) {
       
   229                 if (extensions->hasGenericContext<SVGAnimatedBoolean>(obj.get()))
       
   230                     ASSERT(extensions->genericContext<SVGAnimatedBoolean>(obj.get()) == imp);
       
   231                 else
       
   232                     extensions->setGenericContext<SVGAnimatedBoolean>(obj.get(), imp);
       
   233             }
       
   234         }
       
   235 
       
   236         return toJS(exec, obj.get());
       
   237     }
       
   238     case ClassNameAttrNum: {
       
   239         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   240 
       
   241         ASSERT(exec && exec->dynamicInterpreter());
       
   242 
       
   243         RefPtr<SVGAnimatedString> obj = imp->classNameAnimated();
       
   244         Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
       
   245         if (activeFrame) {
       
   246             SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
       
   247             if (extensions) {
       
   248                 if (extensions->hasGenericContext<SVGAnimatedString>(obj.get()))
       
   249                     ASSERT(extensions->genericContext<SVGAnimatedString>(obj.get()) == imp);
       
   250                 else
       
   251                     extensions->setGenericContext<SVGAnimatedString>(obj.get(), imp);
       
   252             }
       
   253         }
       
   254 
       
   255         return toJS(exec, obj.get());
       
   256     }
       
   257     case StyleAttrNum: {
       
   258         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   259 
       
   260         return toJS(exec, WTF::getPtr(imp->style()));
       
   261     }
       
   262     }
       
   263     return 0;
       
   264 }
       
   265 
       
   266 void JSSVGMaskElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
       
   267 {
       
   268     lookupPut<JSSVGMaskElement, JSSVGElement>(exec, propertyName, value, attr, &JSSVGMaskElementTable, this);
       
   269 }
       
   270 
       
   271 void JSSVGMaskElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
       
   272 {
       
   273     switch (token) {
       
   274     case XmllangAttrNum: {
       
   275         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   276 
       
   277         imp->setXmllang(value->toString(exec));
       
   278         break;
       
   279     }
       
   280     case XmlspaceAttrNum: {
       
   281         SVGMaskElement* imp = static_cast<SVGMaskElement*>(impl());
       
   282 
       
   283         imp->setXmlspace(value->toString(exec));
       
   284         break;
       
   285     }
       
   286     }
       
   287 }
       
   288 
       
   289 JSValue* JSSVGMaskElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
       
   290 {
       
   291     if (!thisObj->inherits(&JSSVGMaskElement::info))
       
   292       return throwError(exec, TypeError);
       
   293 
       
   294     SVGMaskElement* imp = static_cast<SVGMaskElement*>(static_cast<JSSVGMaskElement*>(thisObj)->impl());
       
   295 
       
   296     switch (id) {
       
   297     case JSSVGMaskElement::HasExtensionFuncNum: {
       
   298         String extension = args[0]->toString(exec);
       
   299 
       
   300 
       
   301         KJS::JSValue* result = jsBoolean(imp->hasExtension(extension));
       
   302         return result;
       
   303     }
       
   304     }
       
   305     return 0;
       
   306 }
       
   307 
       
   308 }
       
   309 
       
   310 #endif // ENABLE(SVG)