|
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 "JSBarInfo.h" |
|
24 |
|
25 #include <wtf/GetPtr.h> |
|
26 |
|
27 #include "BarInfo.h" |
|
28 |
|
29 using namespace KJS; |
|
30 |
|
31 namespace WebCore { |
|
32 |
|
33 /* Hash table */ |
|
34 |
|
35 static const HashEntry JSBarInfoTableEntries[] = |
|
36 { |
|
37 { "visible", JSBarInfo::VisibleAttrNum, DontDelete|ReadOnly, 0, 0 } |
|
38 }; |
|
39 |
|
40 static const HashTable JSBarInfoTable = |
|
41 { |
|
42 2, 1, JSBarInfoTableEntries, 1 |
|
43 }; |
|
44 |
|
45 /* Hash table for prototype */ |
|
46 |
|
47 static const HashEntry JSBarInfoPrototypeTableEntries[] = |
|
48 { |
|
49 { 0, 0, 0, 0, 0 } |
|
50 }; |
|
51 |
|
52 static const HashTable JSBarInfoPrototypeTable = |
|
53 { |
|
54 2, 1, JSBarInfoPrototypeTableEntries, 1 |
|
55 }; |
|
56 |
|
57 const ClassInfo JSBarInfoPrototype::info = { "BarInfoPrototype", 0, &JSBarInfoPrototypeTable, 0 }; |
|
58 |
|
59 JSObject* JSBarInfoPrototype::self(ExecState* exec) |
|
60 { |
|
61 return KJS::cacheGlobalObject<JSBarInfoPrototype>(exec, "[[JSBarInfo.prototype]]"); |
|
62 } |
|
63 |
|
64 const ClassInfo JSBarInfo::info = { "BarInfo", 0, &JSBarInfoTable, 0 }; |
|
65 |
|
66 JSBarInfo::JSBarInfo(ExecState* exec, BarInfo* impl) |
|
67 : m_impl(impl) |
|
68 { |
|
69 setPrototype(JSBarInfoPrototype::self(exec)); |
|
70 } |
|
71 |
|
72 JSBarInfo::~JSBarInfo() |
|
73 { |
|
74 ScriptInterpreter::forgetDOMObject(m_impl.get()); |
|
75 } |
|
76 |
|
77 bool JSBarInfo::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
78 { |
|
79 return getStaticValueSlot<JSBarInfo, KJS::DOMObject>(exec, &JSBarInfoTable, this, propertyName, slot); |
|
80 } |
|
81 |
|
82 JSValue* JSBarInfo::getValueProperty(ExecState* exec, int token) const |
|
83 { |
|
84 switch (token) { |
|
85 case VisibleAttrNum: { |
|
86 BarInfo* imp = static_cast<BarInfo*>(impl()); |
|
87 |
|
88 return jsBoolean(imp->visible()); |
|
89 } |
|
90 } |
|
91 return 0; |
|
92 } |
|
93 |
|
94 KJS::JSValue* toJS(KJS::ExecState* exec, BarInfo* obj) |
|
95 { |
|
96 return KJS::cacheDOMObject<BarInfo, JSBarInfo>(exec, obj); |
|
97 } |
|
98 BarInfo* toBarInfo(KJS::JSValue* val) |
|
99 { |
|
100 return val->isObject(&JSBarInfo::info) ? static_cast<JSBarInfo*>(val)->impl() : 0; |
|
101 } |
|
102 |
|
103 } |