webengine/osswebengine/DerivedSources/WebCore/JSHTMLEmbedElement.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 #include "JSHTMLEmbedElement.h"
       
    24 
       
    25 #include <wtf/GetPtr.h>
       
    26 
       
    27 #include "AtomicString.h"
       
    28 #include "HTMLEmbedElement.h"
       
    29 #include "PlatformString.h"
       
    30 
       
    31 using namespace KJS;
       
    32 
       
    33 namespace WebCore {
       
    34 
       
    35 /* Hash table */
       
    36 
       
    37 static const HashEntry JSHTMLEmbedElementTableEntries[] =
       
    38 {
       
    39     { 0, 0, 0, 0, 0 },
       
    40     { "width", JSHTMLEmbedElement::WidthAttrNum, DontDelete, 0, 0 },
       
    41     { "height", JSHTMLEmbedElement::HeightAttrNum, DontDelete, 0, &JSHTMLEmbedElementTableEntries[7] },
       
    42     { 0, 0, 0, 0, 0 },
       
    43     { "type", JSHTMLEmbedElement::TypeAttrNum, DontDelete, 0, 0 },
       
    44     { "align", JSHTMLEmbedElement::AlignAttrNum, DontDelete, 0, 0 },
       
    45     { 0, 0, 0, 0, 0 },
       
    46     { "name", JSHTMLEmbedElement::NameAttrNum, DontDelete, 0, &JSHTMLEmbedElementTableEntries[8] },
       
    47     { "src", JSHTMLEmbedElement::SrcAttrNum, DontDelete, 0, &JSHTMLEmbedElementTableEntries[9] },
       
    48     { "constructor", JSHTMLEmbedElement::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 }
       
    49 };
       
    50 
       
    51 static const HashTable JSHTMLEmbedElementTable = 
       
    52 {
       
    53     2, 10, JSHTMLEmbedElementTableEntries, 7
       
    54 };
       
    55 
       
    56 /* Hash table for constructor */
       
    57 
       
    58 static const HashEntry JSHTMLEmbedElementConstructorTableEntries[] =
       
    59 {
       
    60     { 0, 0, 0, 0, 0 }
       
    61 };
       
    62 
       
    63 static const HashTable JSHTMLEmbedElementConstructorTable = 
       
    64 {
       
    65     2, 1, JSHTMLEmbedElementConstructorTableEntries, 1
       
    66 };
       
    67 
       
    68 class JSHTMLEmbedElementConstructor : public DOMObject {
       
    69 public:
       
    70     JSHTMLEmbedElementConstructor(ExecState* exec)
       
    71     {
       
    72         setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
       
    73         putDirect(exec->propertyNames().prototype, JSHTMLEmbedElementPrototype::self(exec), None);
       
    74     }
       
    75     virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
       
    76     JSValue* getValueProperty(ExecState*, int token) const;
       
    77     virtual const ClassInfo* classInfo() const { return &info; }
       
    78     static const ClassInfo info;
       
    79 
       
    80     virtual bool implementsHasInstance() const { return true; }
       
    81 };
       
    82 
       
    83 const ClassInfo JSHTMLEmbedElementConstructor::info = { "HTMLEmbedElementConstructor", 0, &JSHTMLEmbedElementConstructorTable, 0 };
       
    84 
       
    85 bool JSHTMLEmbedElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    86 {
       
    87     return getStaticValueSlot<JSHTMLEmbedElementConstructor, DOMObject>(exec, &JSHTMLEmbedElementConstructorTable, this, propertyName, slot);
       
    88 }
       
    89 
       
    90 JSValue* JSHTMLEmbedElementConstructor::getValueProperty(ExecState*, int token) const
       
    91 {
       
    92     // The token is the numeric value of its associated constant
       
    93     return jsNumber(token);
       
    94 }
       
    95 
       
    96 /* Hash table for prototype */
       
    97 
       
    98 static const HashEntry JSHTMLEmbedElementPrototypeTableEntries[] =
       
    99 {
       
   100     { 0, 0, 0, 0, 0 }
       
   101 };
       
   102 
       
   103 static const HashTable JSHTMLEmbedElementPrototypeTable = 
       
   104 {
       
   105     2, 1, JSHTMLEmbedElementPrototypeTableEntries, 1
       
   106 };
       
   107 
       
   108 const ClassInfo JSHTMLEmbedElementPrototype::info = { "HTMLEmbedElementPrototype", 0, &JSHTMLEmbedElementPrototypeTable, 0 };
       
   109 
       
   110 JSObject* JSHTMLEmbedElementPrototype::self(ExecState* exec)
       
   111 {
       
   112     return KJS::cacheGlobalObject<JSHTMLEmbedElementPrototype>(exec, "[[JSHTMLEmbedElement.prototype]]");
       
   113 }
       
   114 
       
   115 const ClassInfo JSHTMLEmbedElement::info = { "HTMLEmbedElement", &JSHTMLElement::info, &JSHTMLEmbedElementTable, 0 };
       
   116 
       
   117 JSHTMLEmbedElement::JSHTMLEmbedElement(ExecState* exec, HTMLEmbedElement* impl)
       
   118     : JSHTMLElement(exec, impl)
       
   119 {
       
   120     setPrototype(JSHTMLEmbedElementPrototype::self(exec));
       
   121 }
       
   122 
       
   123 bool JSHTMLEmbedElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   124 {
       
   125     if (canGetItemsForName(exec, static_cast<HTMLEmbedElement*>(impl()), propertyName)) {
       
   126         slot.setCustom(this, nameGetter);
       
   127         return true;
       
   128     }
       
   129     if (customGetOwnPropertySlot(exec, propertyName, slot))
       
   130         return true;
       
   131     return getStaticValueSlot<JSHTMLEmbedElement, JSHTMLElement>(exec, &JSHTMLEmbedElementTable, this, propertyName, slot);
       
   132 }
       
   133 
       
   134 JSValue* JSHTMLEmbedElement::getValueProperty(ExecState* exec, int token) const
       
   135 {
       
   136     switch (token) {
       
   137     case AlignAttrNum: {
       
   138         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   139 
       
   140         return jsString(imp->align());
       
   141     }
       
   142     case HeightAttrNum: {
       
   143         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   144 
       
   145         return jsString(imp->height());
       
   146     }
       
   147     case NameAttrNum: {
       
   148         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   149 
       
   150         return jsString(imp->name());
       
   151     }
       
   152     case SrcAttrNum: {
       
   153         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   154 
       
   155         return jsString(imp->src());
       
   156     }
       
   157     case TypeAttrNum: {
       
   158         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   159 
       
   160         return jsString(imp->type());
       
   161     }
       
   162     case WidthAttrNum: {
       
   163         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   164 
       
   165         return jsString(imp->width());
       
   166     }
       
   167     case ConstructorAttrNum:
       
   168         return getConstructor(exec);
       
   169     }
       
   170     return 0;
       
   171 }
       
   172 
       
   173 void JSHTMLEmbedElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
       
   174 {
       
   175     if (customPut(exec, propertyName, value, attr))
       
   176         return;
       
   177     lookupPut<JSHTMLEmbedElement, JSHTMLElement>(exec, propertyName, value, attr, &JSHTMLEmbedElementTable, this);
       
   178 }
       
   179 
       
   180 void JSHTMLEmbedElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
       
   181 {
       
   182     switch (token) {
       
   183     case AlignAttrNum: {
       
   184         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   185 
       
   186         imp->setAlign(valueToStringWithNullCheck(exec, value));
       
   187         break;
       
   188     }
       
   189     case HeightAttrNum: {
       
   190         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   191 
       
   192         imp->setHeight(valueToStringWithNullCheck(exec, value));
       
   193         break;
       
   194     }
       
   195     case NameAttrNum: {
       
   196         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   197 
       
   198         imp->setName(valueToStringWithNullCheck(exec, value));
       
   199         break;
       
   200     }
       
   201     case SrcAttrNum: {
       
   202         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   203 
       
   204         imp->setSrc(valueToStringWithNullCheck(exec, value));
       
   205         break;
       
   206     }
       
   207     case TypeAttrNum: {
       
   208         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   209 
       
   210         imp->setType(valueToStringWithNullCheck(exec, value));
       
   211         break;
       
   212     }
       
   213     case WidthAttrNum: {
       
   214         HTMLEmbedElement* imp = static_cast<HTMLEmbedElement*>(impl());
       
   215 
       
   216         imp->setWidth(valueToStringWithNullCheck(exec, value));
       
   217         break;
       
   218     }
       
   219     }
       
   220 }
       
   221 
       
   222 JSValue* JSHTMLEmbedElement::getConstructor(ExecState* exec)
       
   223 {
       
   224     return KJS::cacheGlobalObject<JSHTMLEmbedElementConstructor>(exec, "[[HTMLEmbedElement.constructor]]");
       
   225 }
       
   226 
       
   227 }