|
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 "JSHTMLMarqueeElement.h" |
|
24 |
|
25 #include <wtf/GetPtr.h> |
|
26 |
|
27 #include "HTMLMarqueeElement.h" |
|
28 |
|
29 using namespace KJS; |
|
30 |
|
31 namespace WebCore { |
|
32 |
|
33 /* Hash table */ |
|
34 |
|
35 static const HashEntry JSHTMLMarqueeElementTableEntries[] = |
|
36 { |
|
37 { "constructor", JSHTMLMarqueeElement::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 } |
|
38 }; |
|
39 |
|
40 static const HashTable JSHTMLMarqueeElementTable = |
|
41 { |
|
42 2, 1, JSHTMLMarqueeElementTableEntries, 1 |
|
43 }; |
|
44 |
|
45 /* Hash table for constructor */ |
|
46 |
|
47 static const HashEntry JSHTMLMarqueeElementConstructorTableEntries[] = |
|
48 { |
|
49 { 0, 0, 0, 0, 0 } |
|
50 }; |
|
51 |
|
52 static const HashTable JSHTMLMarqueeElementConstructorTable = |
|
53 { |
|
54 2, 1, JSHTMLMarqueeElementConstructorTableEntries, 1 |
|
55 }; |
|
56 |
|
57 class JSHTMLMarqueeElementConstructor : public DOMObject { |
|
58 public: |
|
59 JSHTMLMarqueeElementConstructor(ExecState* exec) |
|
60 { |
|
61 setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype()); |
|
62 putDirect(exec->propertyNames().prototype, JSHTMLMarqueeElementPrototype::self(exec), None); |
|
63 } |
|
64 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); |
|
65 JSValue* getValueProperty(ExecState*, int token) const; |
|
66 virtual const ClassInfo* classInfo() const { return &info; } |
|
67 static const ClassInfo info; |
|
68 |
|
69 virtual bool implementsHasInstance() const { return true; } |
|
70 }; |
|
71 |
|
72 const ClassInfo JSHTMLMarqueeElementConstructor::info = { "HTMLMarqueeElementConstructor", 0, &JSHTMLMarqueeElementConstructorTable, 0 }; |
|
73 |
|
74 bool JSHTMLMarqueeElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
75 { |
|
76 return getStaticValueSlot<JSHTMLMarqueeElementConstructor, DOMObject>(exec, &JSHTMLMarqueeElementConstructorTable, this, propertyName, slot); |
|
77 } |
|
78 |
|
79 JSValue* JSHTMLMarqueeElementConstructor::getValueProperty(ExecState*, int token) const |
|
80 { |
|
81 // The token is the numeric value of its associated constant |
|
82 return jsNumber(token); |
|
83 } |
|
84 |
|
85 /* Hash table for prototype */ |
|
86 |
|
87 static const HashEntry JSHTMLMarqueeElementPrototypeTableEntries[] = |
|
88 { |
|
89 { "start", JSHTMLMarqueeElement::StartFuncNum, DontDelete|Function, 0, &JSHTMLMarqueeElementPrototypeTableEntries[2] }, |
|
90 { 0, 0, 0, 0, 0 }, |
|
91 { "stop", JSHTMLMarqueeElement::StopFuncNum, DontDelete|Function, 0, 0 } |
|
92 }; |
|
93 |
|
94 static const HashTable JSHTMLMarqueeElementPrototypeTable = |
|
95 { |
|
96 2, 3, JSHTMLMarqueeElementPrototypeTableEntries, 2 |
|
97 }; |
|
98 |
|
99 const ClassInfo JSHTMLMarqueeElementPrototype::info = { "HTMLMarqueeElementPrototype", 0, &JSHTMLMarqueeElementPrototypeTable, 0 }; |
|
100 |
|
101 JSObject* JSHTMLMarqueeElementPrototype::self(ExecState* exec) |
|
102 { |
|
103 return KJS::cacheGlobalObject<JSHTMLMarqueeElementPrototype>(exec, "[[JSHTMLMarqueeElement.prototype]]"); |
|
104 } |
|
105 |
|
106 bool JSHTMLMarqueeElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
107 { |
|
108 return getStaticFunctionSlot<JSHTMLMarqueeElementPrototypeFunction, JSObject>(exec, &JSHTMLMarqueeElementPrototypeTable, this, propertyName, slot); |
|
109 } |
|
110 |
|
111 const ClassInfo JSHTMLMarqueeElement::info = { "HTMLMarqueeElement", &JSHTMLElement::info, &JSHTMLMarqueeElementTable, 0 }; |
|
112 |
|
113 JSHTMLMarqueeElement::JSHTMLMarqueeElement(ExecState* exec, HTMLMarqueeElement* impl) |
|
114 : JSHTMLElement(exec, impl) |
|
115 { |
|
116 setPrototype(JSHTMLMarqueeElementPrototype::self(exec)); |
|
117 } |
|
118 |
|
119 bool JSHTMLMarqueeElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
120 { |
|
121 return getStaticValueSlot<JSHTMLMarqueeElement, JSHTMLElement>(exec, &JSHTMLMarqueeElementTable, this, propertyName, slot); |
|
122 } |
|
123 |
|
124 JSValue* JSHTMLMarqueeElement::getValueProperty(ExecState* exec, int token) const |
|
125 { |
|
126 switch (token) { |
|
127 case ConstructorAttrNum: |
|
128 return getConstructor(exec); |
|
129 } |
|
130 return 0; |
|
131 } |
|
132 |
|
133 JSValue* JSHTMLMarqueeElement::getConstructor(ExecState* exec) |
|
134 { |
|
135 return KJS::cacheGlobalObject<JSHTMLMarqueeElementConstructor>(exec, "[[HTMLMarqueeElement.constructor]]"); |
|
136 } |
|
137 JSValue* JSHTMLMarqueeElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args) |
|
138 { |
|
139 if (!thisObj->inherits(&JSHTMLMarqueeElement::info)) |
|
140 return throwError(exec, TypeError); |
|
141 |
|
142 HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(static_cast<JSHTMLMarqueeElement*>(thisObj)->impl()); |
|
143 |
|
144 switch (id) { |
|
145 case JSHTMLMarqueeElement::StartFuncNum: { |
|
146 |
|
147 imp->start(); |
|
148 return jsUndefined(); |
|
149 } |
|
150 case JSHTMLMarqueeElement::StopFuncNum: { |
|
151 |
|
152 imp->stop(); |
|
153 return jsUndefined(); |
|
154 } |
|
155 } |
|
156 return 0; |
|
157 } |
|
158 |
|
159 } |