|
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 |
|
24 #if ENABLE(SVG) |
|
25 |
|
26 #include "Document.h" |
|
27 #include "Frame.h" |
|
28 #include "SVGDocumentExtensions.h" |
|
29 #include "SVGElement.h" |
|
30 #include "SVGAnimatedTemplate.h" |
|
31 #include "JSSVGCursorElement.h" |
|
32 |
|
33 #include <wtf/GetPtr.h> |
|
34 |
|
35 #include "JSSVGAnimatedBoolean.h" |
|
36 #include "JSSVGAnimatedLength.h" |
|
37 #include "JSSVGAnimatedString.h" |
|
38 #include "JSSVGStringList.h" |
|
39 #include "SVGCursorElement.h" |
|
40 #include "SVGStringList.h" |
|
41 |
|
42 using namespace KJS; |
|
43 |
|
44 namespace WebCore { |
|
45 |
|
46 /* Hash table */ |
|
47 |
|
48 static const HashEntry JSSVGCursorElementTableEntries[] = |
|
49 { |
|
50 { 0, 0, 0, 0, 0 }, |
|
51 { "requiredFeatures", JSSVGCursorElement::RequiredFeaturesAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
52 { "x", JSSVGCursorElement::XAttrNum, DontDelete|ReadOnly, 0, &JSSVGCursorElementTableEntries[8] }, |
|
53 { 0, 0, 0, 0, 0 }, |
|
54 { "requiredExtensions", JSSVGCursorElement::RequiredExtensionsAttrNum, DontDelete|ReadOnly, 0, &JSSVGCursorElementTableEntries[7] }, |
|
55 { "y", JSSVGCursorElement::YAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
56 { "href", JSSVGCursorElement::HrefAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
57 { "systemLanguage", JSSVGCursorElement::SystemLanguageAttrNum, DontDelete|ReadOnly, 0, 0 }, |
|
58 { "externalResourcesRequired", JSSVGCursorElement::ExternalResourcesRequiredAttrNum, DontDelete|ReadOnly, 0, 0 } |
|
59 }; |
|
60 |
|
61 static const HashTable JSSVGCursorElementTable = |
|
62 { |
|
63 2, 9, JSSVGCursorElementTableEntries, 7 |
|
64 }; |
|
65 |
|
66 /* Hash table for prototype */ |
|
67 |
|
68 static const HashEntry JSSVGCursorElementPrototypeTableEntries[] = |
|
69 { |
|
70 { "hasExtension", JSSVGCursorElement::HasExtensionFuncNum, DontDelete|Function, 1, 0 } |
|
71 }; |
|
72 |
|
73 static const HashTable JSSVGCursorElementPrototypeTable = |
|
74 { |
|
75 2, 1, JSSVGCursorElementPrototypeTableEntries, 1 |
|
76 }; |
|
77 |
|
78 const ClassInfo JSSVGCursorElementPrototype::info = { "SVGCursorElementPrototype", 0, &JSSVGCursorElementPrototypeTable, 0 }; |
|
79 |
|
80 JSObject* JSSVGCursorElementPrototype::self(ExecState* exec) |
|
81 { |
|
82 return KJS::cacheGlobalObject<JSSVGCursorElementPrototype>(exec, "[[JSSVGCursorElement.prototype]]"); |
|
83 } |
|
84 |
|
85 bool JSSVGCursorElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
86 { |
|
87 return getStaticFunctionSlot<JSSVGCursorElementPrototypeFunction, JSObject>(exec, &JSSVGCursorElementPrototypeTable, this, propertyName, slot); |
|
88 } |
|
89 |
|
90 const ClassInfo JSSVGCursorElement::info = { "SVGCursorElement", &JSSVGElement::info, &JSSVGCursorElementTable, 0 }; |
|
91 |
|
92 JSSVGCursorElement::JSSVGCursorElement(ExecState* exec, SVGCursorElement* impl) |
|
93 : JSSVGElement(exec, impl) |
|
94 { |
|
95 setPrototype(JSSVGCursorElementPrototype::self(exec)); |
|
96 } |
|
97 |
|
98 bool JSSVGCursorElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
99 { |
|
100 return getStaticValueSlot<JSSVGCursorElement, JSSVGElement>(exec, &JSSVGCursorElementTable, this, propertyName, slot); |
|
101 } |
|
102 |
|
103 JSValue* JSSVGCursorElement::getValueProperty(ExecState* exec, int token) const |
|
104 { |
|
105 switch (token) { |
|
106 case XAttrNum: { |
|
107 SVGCursorElement* imp = static_cast<SVGCursorElement*>(impl()); |
|
108 |
|
109 ASSERT(exec && exec->dynamicInterpreter()); |
|
110 |
|
111 RefPtr<SVGAnimatedLength> obj = imp->xAnimated(); |
|
112 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
113 if (activeFrame) { |
|
114 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
115 if (extensions) { |
|
116 if (extensions->hasGenericContext<SVGAnimatedLength>(obj.get())) |
|
117 ASSERT(extensions->genericContext<SVGAnimatedLength>(obj.get()) == imp); |
|
118 else |
|
119 extensions->setGenericContext<SVGAnimatedLength>(obj.get(), imp); |
|
120 } |
|
121 } |
|
122 |
|
123 return toJS(exec, obj.get()); |
|
124 } |
|
125 case YAttrNum: { |
|
126 SVGCursorElement* imp = static_cast<SVGCursorElement*>(impl()); |
|
127 |
|
128 ASSERT(exec && exec->dynamicInterpreter()); |
|
129 |
|
130 RefPtr<SVGAnimatedLength> obj = imp->yAnimated(); |
|
131 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
132 if (activeFrame) { |
|
133 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
134 if (extensions) { |
|
135 if (extensions->hasGenericContext<SVGAnimatedLength>(obj.get())) |
|
136 ASSERT(extensions->genericContext<SVGAnimatedLength>(obj.get()) == imp); |
|
137 else |
|
138 extensions->setGenericContext<SVGAnimatedLength>(obj.get(), imp); |
|
139 } |
|
140 } |
|
141 |
|
142 return toJS(exec, obj.get()); |
|
143 } |
|
144 case HrefAttrNum: { |
|
145 SVGCursorElement* imp = static_cast<SVGCursorElement*>(impl()); |
|
146 |
|
147 ASSERT(exec && exec->dynamicInterpreter()); |
|
148 |
|
149 RefPtr<SVGAnimatedString> obj = imp->hrefAnimated(); |
|
150 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
151 if (activeFrame) { |
|
152 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
153 if (extensions) { |
|
154 if (extensions->hasGenericContext<SVGAnimatedString>(obj.get())) |
|
155 ASSERT(extensions->genericContext<SVGAnimatedString>(obj.get()) == imp); |
|
156 else |
|
157 extensions->setGenericContext<SVGAnimatedString>(obj.get(), imp); |
|
158 } |
|
159 } |
|
160 |
|
161 return toJS(exec, obj.get()); |
|
162 } |
|
163 case RequiredFeaturesAttrNum: { |
|
164 SVGCursorElement* imp = static_cast<SVGCursorElement*>(impl()); |
|
165 |
|
166 return toJS(exec, WTF::getPtr(imp->requiredFeatures())); |
|
167 } |
|
168 case RequiredExtensionsAttrNum: { |
|
169 SVGCursorElement* imp = static_cast<SVGCursorElement*>(impl()); |
|
170 |
|
171 return toJS(exec, WTF::getPtr(imp->requiredExtensions())); |
|
172 } |
|
173 case SystemLanguageAttrNum: { |
|
174 SVGCursorElement* imp = static_cast<SVGCursorElement*>(impl()); |
|
175 |
|
176 return toJS(exec, WTF::getPtr(imp->systemLanguage())); |
|
177 } |
|
178 case ExternalResourcesRequiredAttrNum: { |
|
179 SVGCursorElement* imp = static_cast<SVGCursorElement*>(impl()); |
|
180 |
|
181 ASSERT(exec && exec->dynamicInterpreter()); |
|
182 |
|
183 RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated(); |
|
184 Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame(); |
|
185 if (activeFrame) { |
|
186 SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0); |
|
187 if (extensions) { |
|
188 if (extensions->hasGenericContext<SVGAnimatedBoolean>(obj.get())) |
|
189 ASSERT(extensions->genericContext<SVGAnimatedBoolean>(obj.get()) == imp); |
|
190 else |
|
191 extensions->setGenericContext<SVGAnimatedBoolean>(obj.get(), imp); |
|
192 } |
|
193 } |
|
194 |
|
195 return toJS(exec, obj.get()); |
|
196 } |
|
197 } |
|
198 return 0; |
|
199 } |
|
200 |
|
201 JSValue* JSSVGCursorElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args) |
|
202 { |
|
203 if (!thisObj->inherits(&JSSVGCursorElement::info)) |
|
204 return throwError(exec, TypeError); |
|
205 |
|
206 SVGCursorElement* imp = static_cast<SVGCursorElement*>(static_cast<JSSVGCursorElement*>(thisObj)->impl()); |
|
207 |
|
208 switch (id) { |
|
209 case JSSVGCursorElement::HasExtensionFuncNum: { |
|
210 String extension = args[0]->toString(exec); |
|
211 |
|
212 |
|
213 KJS::JSValue* result = jsBoolean(imp->hasExtension(extension)); |
|
214 return result; |
|
215 } |
|
216 } |
|
217 return 0; |
|
218 } |
|
219 |
|
220 } |
|
221 |
|
222 #endif // ENABLE(SVG) |