|
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 #if ENABLE(SVG) |
|
24 |
|
25 #include "JSSVGSymbolElement.h" |
|
26 |
|
27 #include "CSSMutableStyleDeclaration.h" |
|
28 #include "CSSStyleDeclaration.h" |
|
29 #include "CSSValue.h" |
|
30 #include "JSCSSStyleDeclaration.h" |
|
31 #include "JSCSSValue.h" |
|
32 #include "JSSVGAnimatedBoolean.h" |
|
33 #include "JSSVGAnimatedPreserveAspectRatio.h" |
|
34 #include "JSSVGAnimatedRect.h" |
|
35 #include "JSSVGAnimatedString.h" |
|
36 #include "KURL.h" |
|
37 #include "SVGSymbolElement.h" |
|
38 #include <runtime/Error.h> |
|
39 #include <runtime/JSString.h> |
|
40 #include <wtf/GetPtr.h> |
|
41 |
|
42 using namespace JSC; |
|
43 |
|
44 namespace WebCore { |
|
45 |
|
46 ASSERT_CLASS_FITS_IN_CELL(JSSVGSymbolElement); |
|
47 |
|
48 /* Hash table */ |
|
49 #if ENABLE(JIT) |
|
50 #define THUNK_GENERATOR(generator) , generator |
|
51 #else |
|
52 #define THUNK_GENERATOR(generator) |
|
53 #endif |
|
54 |
|
55 static const HashTableValue JSSVGSymbolElementTableValues[9] = |
|
56 { |
|
57 { "xmllang", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementXmllang), (intptr_t)setJSSVGSymbolElementXmllang THUNK_GENERATOR(0) }, |
|
58 { "xmlspace", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementXmlspace), (intptr_t)setJSSVGSymbolElementXmlspace THUNK_GENERATOR(0) }, |
|
59 { "externalResourcesRequired", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementExternalResourcesRequired), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
60 { "className", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementClassName), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
61 { "style", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementStyle), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
62 { "viewBox", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementViewBox), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
63 { "preserveAspectRatio", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementPreserveAspectRatio), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
64 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGSymbolElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
65 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
66 }; |
|
67 |
|
68 #undef THUNK_GENERATOR |
|
69 static JSC_CONST_HASHTABLE HashTable JSSVGSymbolElementTable = { 16, 15, JSSVGSymbolElementTableValues, 0 }; |
|
70 /* Hash table for constructor */ |
|
71 #if ENABLE(JIT) |
|
72 #define THUNK_GENERATOR(generator) , generator |
|
73 #else |
|
74 #define THUNK_GENERATOR(generator) |
|
75 #endif |
|
76 |
|
77 static const HashTableValue JSSVGSymbolElementConstructorTableValues[1] = |
|
78 { |
|
79 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
80 }; |
|
81 |
|
82 #undef THUNK_GENERATOR |
|
83 static JSC_CONST_HASHTABLE HashTable JSSVGSymbolElementConstructorTable = { 1, 0, JSSVGSymbolElementConstructorTableValues, 0 }; |
|
84 class JSSVGSymbolElementConstructor : public DOMConstructorObject { |
|
85 public: |
|
86 JSSVGSymbolElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
87 |
|
88 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
89 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
90 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
91 static const JSC::ClassInfo s_info; |
|
92 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
93 { |
|
94 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
95 } |
|
96 protected: |
|
97 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
98 }; |
|
99 |
|
100 const ClassInfo JSSVGSymbolElementConstructor::s_info = { "SVGSymbolElementConstructor", 0, &JSSVGSymbolElementConstructorTable, 0 }; |
|
101 |
|
102 JSSVGSymbolElementConstructor::JSSVGSymbolElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
103 : DOMConstructorObject(JSSVGSymbolElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
104 { |
|
105 putDirect(exec->propertyNames().prototype, JSSVGSymbolElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
106 } |
|
107 |
|
108 bool JSSVGSymbolElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
109 { |
|
110 return getStaticValueSlot<JSSVGSymbolElementConstructor, DOMObject>(exec, &JSSVGSymbolElementConstructorTable, this, propertyName, slot); |
|
111 } |
|
112 |
|
113 bool JSSVGSymbolElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
114 { |
|
115 return getStaticValueDescriptor<JSSVGSymbolElementConstructor, DOMObject>(exec, &JSSVGSymbolElementConstructorTable, this, propertyName, descriptor); |
|
116 } |
|
117 |
|
118 /* Hash table for prototype */ |
|
119 #if ENABLE(JIT) |
|
120 #define THUNK_GENERATOR(generator) , generator |
|
121 #else |
|
122 #define THUNK_GENERATOR(generator) |
|
123 #endif |
|
124 |
|
125 static const HashTableValue JSSVGSymbolElementPrototypeTableValues[2] = |
|
126 { |
|
127 { "getPresentationAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGSymbolElementPrototypeFunctionGetPresentationAttribute), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
128 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
129 }; |
|
130 |
|
131 #undef THUNK_GENERATOR |
|
132 static JSC_CONST_HASHTABLE HashTable JSSVGSymbolElementPrototypeTable = { 2, 1, JSSVGSymbolElementPrototypeTableValues, 0 }; |
|
133 const ClassInfo JSSVGSymbolElementPrototype::s_info = { "SVGSymbolElementPrototype", 0, &JSSVGSymbolElementPrototypeTable, 0 }; |
|
134 |
|
135 JSObject* JSSVGSymbolElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
136 { |
|
137 return getDOMPrototype<JSSVGSymbolElement>(exec, globalObject); |
|
138 } |
|
139 |
|
140 bool JSSVGSymbolElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
141 { |
|
142 return getStaticFunctionSlot<JSObject>(exec, &JSSVGSymbolElementPrototypeTable, this, propertyName, slot); |
|
143 } |
|
144 |
|
145 bool JSSVGSymbolElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
146 { |
|
147 return getStaticFunctionDescriptor<JSObject>(exec, &JSSVGSymbolElementPrototypeTable, this, propertyName, descriptor); |
|
148 } |
|
149 |
|
150 const ClassInfo JSSVGSymbolElement::s_info = { "SVGSymbolElement", &JSSVGElement::s_info, &JSSVGSymbolElementTable, 0 }; |
|
151 |
|
152 JSSVGSymbolElement::JSSVGSymbolElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGSymbolElement> impl) |
|
153 : JSSVGElement(structure, globalObject, impl) |
|
154 { |
|
155 } |
|
156 |
|
157 JSObject* JSSVGSymbolElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
158 { |
|
159 return new (exec) JSSVGSymbolElementPrototype(globalObject, JSSVGSymbolElementPrototype::createStructure(JSSVGElementPrototype::self(exec, globalObject))); |
|
160 } |
|
161 |
|
162 bool JSSVGSymbolElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
163 { |
|
164 return getStaticValueSlot<JSSVGSymbolElement, Base>(exec, &JSSVGSymbolElementTable, this, propertyName, slot); |
|
165 } |
|
166 |
|
167 bool JSSVGSymbolElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
168 { |
|
169 return getStaticValueDescriptor<JSSVGSymbolElement, Base>(exec, &JSSVGSymbolElementTable, this, propertyName, descriptor); |
|
170 } |
|
171 |
|
172 JSValue jsSVGSymbolElementXmllang(ExecState* exec, JSValue slotBase, const Identifier&) |
|
173 { |
|
174 JSSVGSymbolElement* castedThis = static_cast<JSSVGSymbolElement*>(asObject(slotBase)); |
|
175 UNUSED_PARAM(exec); |
|
176 SVGSymbolElement* imp = static_cast<SVGSymbolElement*>(castedThis->impl()); |
|
177 JSValue result = jsString(exec, imp->xmllang()); |
|
178 return result; |
|
179 } |
|
180 |
|
181 JSValue jsSVGSymbolElementXmlspace(ExecState* exec, JSValue slotBase, const Identifier&) |
|
182 { |
|
183 JSSVGSymbolElement* castedThis = static_cast<JSSVGSymbolElement*>(asObject(slotBase)); |
|
184 UNUSED_PARAM(exec); |
|
185 SVGSymbolElement* imp = static_cast<SVGSymbolElement*>(castedThis->impl()); |
|
186 JSValue result = jsString(exec, imp->xmlspace()); |
|
187 return result; |
|
188 } |
|
189 |
|
190 JSValue jsSVGSymbolElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&) |
|
191 { |
|
192 JSSVGSymbolElement* castedThis = static_cast<JSSVGSymbolElement*>(asObject(slotBase)); |
|
193 UNUSED_PARAM(exec); |
|
194 SVGSymbolElement* imp = static_cast<SVGSymbolElement*>(castedThis->impl()); |
|
195 RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated(); |
|
196 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
197 return result; |
|
198 } |
|
199 |
|
200 JSValue jsSVGSymbolElementClassName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
201 { |
|
202 JSSVGSymbolElement* castedThis = static_cast<JSSVGSymbolElement*>(asObject(slotBase)); |
|
203 UNUSED_PARAM(exec); |
|
204 SVGSymbolElement* imp = static_cast<SVGSymbolElement*>(castedThis->impl()); |
|
205 RefPtr<SVGAnimatedString> obj = imp->classNameAnimated(); |
|
206 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
207 return result; |
|
208 } |
|
209 |
|
210 JSValue jsSVGSymbolElementStyle(ExecState* exec, JSValue slotBase, const Identifier&) |
|
211 { |
|
212 JSSVGSymbolElement* castedThis = static_cast<JSSVGSymbolElement*>(asObject(slotBase)); |
|
213 UNUSED_PARAM(exec); |
|
214 SVGSymbolElement* imp = static_cast<SVGSymbolElement*>(castedThis->impl()); |
|
215 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style())); |
|
216 return result; |
|
217 } |
|
218 |
|
219 JSValue jsSVGSymbolElementViewBox(ExecState* exec, JSValue slotBase, const Identifier&) |
|
220 { |
|
221 JSSVGSymbolElement* castedThis = static_cast<JSSVGSymbolElement*>(asObject(slotBase)); |
|
222 UNUSED_PARAM(exec); |
|
223 SVGSymbolElement* imp = static_cast<SVGSymbolElement*>(castedThis->impl()); |
|
224 RefPtr<SVGAnimatedRect> obj = imp->viewBoxAnimated(); |
|
225 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
226 return result; |
|
227 } |
|
228 |
|
229 JSValue jsSVGSymbolElementPreserveAspectRatio(ExecState* exec, JSValue slotBase, const Identifier&) |
|
230 { |
|
231 JSSVGSymbolElement* castedThis = static_cast<JSSVGSymbolElement*>(asObject(slotBase)); |
|
232 UNUSED_PARAM(exec); |
|
233 SVGSymbolElement* imp = static_cast<SVGSymbolElement*>(castedThis->impl()); |
|
234 RefPtr<SVGAnimatedPreserveAspectRatio> obj = imp->preserveAspectRatioAnimated(); |
|
235 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
236 return result; |
|
237 } |
|
238 |
|
239 JSValue jsSVGSymbolElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
240 { |
|
241 JSSVGSymbolElement* domObject = static_cast<JSSVGSymbolElement*>(asObject(slotBase)); |
|
242 return JSSVGSymbolElement::getConstructor(exec, domObject->globalObject()); |
|
243 } |
|
244 void JSSVGSymbolElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
245 { |
|
246 lookupPut<JSSVGSymbolElement, Base>(exec, propertyName, value, &JSSVGSymbolElementTable, this, slot); |
|
247 } |
|
248 |
|
249 void setJSSVGSymbolElementXmllang(ExecState* exec, JSObject* thisObject, JSValue value) |
|
250 { |
|
251 JSSVGSymbolElement* castedThis = static_cast<JSSVGSymbolElement*>(thisObject); |
|
252 SVGSymbolElement* imp = static_cast<SVGSymbolElement*>(castedThis->impl()); |
|
253 imp->setXmllang(ustringToString(value.toString(exec))); |
|
254 } |
|
255 |
|
256 void setJSSVGSymbolElementXmlspace(ExecState* exec, JSObject* thisObject, JSValue value) |
|
257 { |
|
258 JSSVGSymbolElement* castedThis = static_cast<JSSVGSymbolElement*>(thisObject); |
|
259 SVGSymbolElement* imp = static_cast<SVGSymbolElement*>(castedThis->impl()); |
|
260 imp->setXmlspace(ustringToString(value.toString(exec))); |
|
261 } |
|
262 |
|
263 JSValue JSSVGSymbolElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
264 { |
|
265 return getDOMConstructor<JSSVGSymbolElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
266 } |
|
267 |
|
268 EncodedJSValue JSC_HOST_CALL jsSVGSymbolElementPrototypeFunctionGetPresentationAttribute(ExecState* exec) |
|
269 { |
|
270 JSValue thisValue = exec->hostThisValue(); |
|
271 if (!thisValue.inherits(&JSSVGSymbolElement::s_info)) |
|
272 return throwVMTypeError(exec); |
|
273 JSSVGSymbolElement* castedThis = static_cast<JSSVGSymbolElement*>(asObject(thisValue)); |
|
274 SVGSymbolElement* imp = static_cast<SVGSymbolElement*>(castedThis->impl()); |
|
275 const String& name = ustringToString(exec->argument(0).toString(exec)); |
|
276 |
|
277 |
|
278 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getPresentationAttribute(name))); |
|
279 return JSValue::encode(result); |
|
280 } |
|
281 |
|
282 |
|
283 } |
|
284 |
|
285 #endif // ENABLE(SVG) |