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