webengine/osswebengine/DerivedSources/WebCore/JSHTMLFontElement.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 "JSHTMLFontElement.h"
       
    24 
       
    25 #include <wtf/GetPtr.h>
       
    26 
       
    27 #include "HTMLFontElement.h"
       
    28 #include "PlatformString.h"
       
    29 
       
    30 using namespace KJS;
       
    31 
       
    32 namespace WebCore {
       
    33 
       
    34 /* Hash table */
       
    35 
       
    36 static const HashEntry JSHTMLFontElementTableEntries[] =
       
    37 {
       
    38     { "size", JSHTMLFontElement::SizeAttrNum, DontDelete, 0, 0 },
       
    39     { "color", JSHTMLFontElement::ColorAttrNum, DontDelete, 0, &JSHTMLFontElementTableEntries[4] },
       
    40     { 0, 0, 0, 0, 0 },
       
    41     { "face", JSHTMLFontElement::FaceAttrNum, DontDelete, 0, 0 },
       
    42     { "constructor", JSHTMLFontElement::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 }
       
    43 };
       
    44 
       
    45 static const HashTable JSHTMLFontElementTable = 
       
    46 {
       
    47     2, 5, JSHTMLFontElementTableEntries, 4
       
    48 };
       
    49 
       
    50 /* Hash table for constructor */
       
    51 
       
    52 static const HashEntry JSHTMLFontElementConstructorTableEntries[] =
       
    53 {
       
    54     { 0, 0, 0, 0, 0 }
       
    55 };
       
    56 
       
    57 static const HashTable JSHTMLFontElementConstructorTable = 
       
    58 {
       
    59     2, 1, JSHTMLFontElementConstructorTableEntries, 1
       
    60 };
       
    61 
       
    62 class JSHTMLFontElementConstructor : public DOMObject {
       
    63 public:
       
    64     JSHTMLFontElementConstructor(ExecState* exec)
       
    65     {
       
    66         setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
       
    67         putDirect(exec->propertyNames().prototype, JSHTMLFontElementPrototype::self(exec), None);
       
    68     }
       
    69     virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
       
    70     JSValue* getValueProperty(ExecState*, int token) const;
       
    71     virtual const ClassInfo* classInfo() const { return &info; }
       
    72     static const ClassInfo info;
       
    73 
       
    74     virtual bool implementsHasInstance() const { return true; }
       
    75 };
       
    76 
       
    77 const ClassInfo JSHTMLFontElementConstructor::info = { "HTMLFontElementConstructor", 0, &JSHTMLFontElementConstructorTable, 0 };
       
    78 
       
    79 bool JSHTMLFontElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
    80 {
       
    81     return getStaticValueSlot<JSHTMLFontElementConstructor, DOMObject>(exec, &JSHTMLFontElementConstructorTable, this, propertyName, slot);
       
    82 }
       
    83 
       
    84 JSValue* JSHTMLFontElementConstructor::getValueProperty(ExecState*, int token) const
       
    85 {
       
    86     // The token is the numeric value of its associated constant
       
    87     return jsNumber(token);
       
    88 }
       
    89 
       
    90 /* Hash table for prototype */
       
    91 
       
    92 static const HashEntry JSHTMLFontElementPrototypeTableEntries[] =
       
    93 {
       
    94     { 0, 0, 0, 0, 0 }
       
    95 };
       
    96 
       
    97 static const HashTable JSHTMLFontElementPrototypeTable = 
       
    98 {
       
    99     2, 1, JSHTMLFontElementPrototypeTableEntries, 1
       
   100 };
       
   101 
       
   102 const ClassInfo JSHTMLFontElementPrototype::info = { "HTMLFontElementPrototype", 0, &JSHTMLFontElementPrototypeTable, 0 };
       
   103 
       
   104 JSObject* JSHTMLFontElementPrototype::self(ExecState* exec)
       
   105 {
       
   106     return KJS::cacheGlobalObject<JSHTMLFontElementPrototype>(exec, "[[JSHTMLFontElement.prototype]]");
       
   107 }
       
   108 
       
   109 const ClassInfo JSHTMLFontElement::info = { "HTMLFontElement", &JSHTMLElement::info, &JSHTMLFontElementTable, 0 };
       
   110 
       
   111 JSHTMLFontElement::JSHTMLFontElement(ExecState* exec, HTMLFontElement* impl)
       
   112     : JSHTMLElement(exec, impl)
       
   113 {
       
   114     setPrototype(JSHTMLFontElementPrototype::self(exec));
       
   115 }
       
   116 
       
   117 bool JSHTMLFontElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   118 {
       
   119     return getStaticValueSlot<JSHTMLFontElement, JSHTMLElement>(exec, &JSHTMLFontElementTable, this, propertyName, slot);
       
   120 }
       
   121 
       
   122 JSValue* JSHTMLFontElement::getValueProperty(ExecState* exec, int token) const
       
   123 {
       
   124     switch (token) {
       
   125     case ColorAttrNum: {
       
   126         HTMLFontElement* imp = static_cast<HTMLFontElement*>(impl());
       
   127 
       
   128         return jsString(imp->color());
       
   129     }
       
   130     case FaceAttrNum: {
       
   131         HTMLFontElement* imp = static_cast<HTMLFontElement*>(impl());
       
   132 
       
   133         return jsString(imp->face());
       
   134     }
       
   135     case SizeAttrNum: {
       
   136         HTMLFontElement* imp = static_cast<HTMLFontElement*>(impl());
       
   137 
       
   138         return jsString(imp->size());
       
   139     }
       
   140     case ConstructorAttrNum:
       
   141         return getConstructor(exec);
       
   142     }
       
   143     return 0;
       
   144 }
       
   145 
       
   146 void JSHTMLFontElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
       
   147 {
       
   148     lookupPut<JSHTMLFontElement, JSHTMLElement>(exec, propertyName, value, attr, &JSHTMLFontElementTable, this);
       
   149 }
       
   150 
       
   151 void JSHTMLFontElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
       
   152 {
       
   153     switch (token) {
       
   154     case ColorAttrNum: {
       
   155         HTMLFontElement* imp = static_cast<HTMLFontElement*>(impl());
       
   156 
       
   157         imp->setColor(valueToStringWithNullCheck(exec, value));
       
   158         break;
       
   159     }
       
   160     case FaceAttrNum: {
       
   161         HTMLFontElement* imp = static_cast<HTMLFontElement*>(impl());
       
   162 
       
   163         imp->setFace(valueToStringWithNullCheck(exec, value));
       
   164         break;
       
   165     }
       
   166     case SizeAttrNum: {
       
   167         HTMLFontElement* imp = static_cast<HTMLFontElement*>(impl());
       
   168 
       
   169         imp->setSize(valueToStringWithNullCheck(exec, value));
       
   170         break;
       
   171     }
       
   172     }
       
   173 }
       
   174 
       
   175 JSValue* JSHTMLFontElement::getConstructor(ExecState* exec)
       
   176 {
       
   177     return KJS::cacheGlobalObject<JSHTMLFontElementConstructor>(exec, "[[HTMLFontElement.constructor]]");
       
   178 }
       
   179 
       
   180 }