|
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 "JSSVGGradientElement.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 "JSSVGAnimatedEnumeration.h" |
|
34 #include "JSSVGAnimatedString.h" |
|
35 #include "JSSVGAnimatedTransformList.h" |
|
36 #include "SVGGradientElement.h" |
|
37 #include <runtime/Error.h> |
|
38 #include <wtf/GetPtr.h> |
|
39 |
|
40 using namespace JSC; |
|
41 |
|
42 namespace WebCore { |
|
43 |
|
44 ASSERT_CLASS_FITS_IN_CELL(JSSVGGradientElement); |
|
45 |
|
46 /* Hash table */ |
|
47 #if ENABLE(JIT) |
|
48 #define THUNK_GENERATOR(generator) , generator |
|
49 #else |
|
50 #define THUNK_GENERATOR(generator) |
|
51 #endif |
|
52 |
|
53 static const HashTableValue JSSVGGradientElementTableValues[9] = |
|
54 { |
|
55 { "gradientUnits", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementGradientUnits), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
56 { "gradientTransform", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementGradientTransform), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
57 { "spreadMethod", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementSpreadMethod), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
58 { "href", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementHref), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
59 { "externalResourcesRequired", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementExternalResourcesRequired), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
60 { "className", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementClassName), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
61 { "style", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementStyle), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
62 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
63 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
64 }; |
|
65 |
|
66 #undef THUNK_GENERATOR |
|
67 static JSC_CONST_HASHTABLE HashTable JSSVGGradientElementTable = { 16, 15, JSSVGGradientElementTableValues, 0 }; |
|
68 /* Hash table for constructor */ |
|
69 #if ENABLE(JIT) |
|
70 #define THUNK_GENERATOR(generator) , generator |
|
71 #else |
|
72 #define THUNK_GENERATOR(generator) |
|
73 #endif |
|
74 |
|
75 static const HashTableValue JSSVGGradientElementConstructorTableValues[5] = |
|
76 { |
|
77 { "SVG_SPREADMETHOD_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementSVG_SPREADMETHOD_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
78 { "SVG_SPREADMETHOD_PAD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementSVG_SPREADMETHOD_PAD), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
79 { "SVG_SPREADMETHOD_REFLECT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementSVG_SPREADMETHOD_REFLECT), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
80 { "SVG_SPREADMETHOD_REPEAT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementSVG_SPREADMETHOD_REPEAT), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
81 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
82 }; |
|
83 |
|
84 #undef THUNK_GENERATOR |
|
85 static JSC_CONST_HASHTABLE HashTable JSSVGGradientElementConstructorTable = { 8, 7, JSSVGGradientElementConstructorTableValues, 0 }; |
|
86 class JSSVGGradientElementConstructor : public DOMConstructorObject { |
|
87 public: |
|
88 JSSVGGradientElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
89 |
|
90 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
91 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
92 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
93 static const JSC::ClassInfo s_info; |
|
94 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
95 { |
|
96 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
97 } |
|
98 protected: |
|
99 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
100 }; |
|
101 |
|
102 const ClassInfo JSSVGGradientElementConstructor::s_info = { "SVGGradientElementConstructor", 0, &JSSVGGradientElementConstructorTable, 0 }; |
|
103 |
|
104 JSSVGGradientElementConstructor::JSSVGGradientElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
105 : DOMConstructorObject(JSSVGGradientElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
106 { |
|
107 putDirect(exec->propertyNames().prototype, JSSVGGradientElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
108 } |
|
109 |
|
110 bool JSSVGGradientElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
111 { |
|
112 return getStaticValueSlot<JSSVGGradientElementConstructor, DOMObject>(exec, &JSSVGGradientElementConstructorTable, this, propertyName, slot); |
|
113 } |
|
114 |
|
115 bool JSSVGGradientElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
116 { |
|
117 return getStaticValueDescriptor<JSSVGGradientElementConstructor, DOMObject>(exec, &JSSVGGradientElementConstructorTable, this, propertyName, descriptor); |
|
118 } |
|
119 |
|
120 /* Hash table for prototype */ |
|
121 #if ENABLE(JIT) |
|
122 #define THUNK_GENERATOR(generator) , generator |
|
123 #else |
|
124 #define THUNK_GENERATOR(generator) |
|
125 #endif |
|
126 |
|
127 static const HashTableValue JSSVGGradientElementPrototypeTableValues[6] = |
|
128 { |
|
129 { "SVG_SPREADMETHOD_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementSVG_SPREADMETHOD_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
130 { "SVG_SPREADMETHOD_PAD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementSVG_SPREADMETHOD_PAD), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
131 { "SVG_SPREADMETHOD_REFLECT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementSVG_SPREADMETHOD_REFLECT), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
132 { "SVG_SPREADMETHOD_REPEAT", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGGradientElementSVG_SPREADMETHOD_REPEAT), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
133 { "getPresentationAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGGradientElementPrototypeFunctionGetPresentationAttribute), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
134 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
135 }; |
|
136 |
|
137 #undef THUNK_GENERATOR |
|
138 static JSC_CONST_HASHTABLE HashTable JSSVGGradientElementPrototypeTable = { 17, 15, JSSVGGradientElementPrototypeTableValues, 0 }; |
|
139 const ClassInfo JSSVGGradientElementPrototype::s_info = { "SVGGradientElementPrototype", 0, &JSSVGGradientElementPrototypeTable, 0 }; |
|
140 |
|
141 JSObject* JSSVGGradientElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
142 { |
|
143 return getDOMPrototype<JSSVGGradientElement>(exec, globalObject); |
|
144 } |
|
145 |
|
146 bool JSSVGGradientElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
147 { |
|
148 return getStaticPropertySlot<JSSVGGradientElementPrototype, JSObject>(exec, &JSSVGGradientElementPrototypeTable, this, propertyName, slot); |
|
149 } |
|
150 |
|
151 bool JSSVGGradientElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
152 { |
|
153 return getStaticPropertyDescriptor<JSSVGGradientElementPrototype, JSObject>(exec, &JSSVGGradientElementPrototypeTable, this, propertyName, descriptor); |
|
154 } |
|
155 |
|
156 const ClassInfo JSSVGGradientElement::s_info = { "SVGGradientElement", &JSSVGElement::s_info, &JSSVGGradientElementTable, 0 }; |
|
157 |
|
158 JSSVGGradientElement::JSSVGGradientElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGGradientElement> impl) |
|
159 : JSSVGElement(structure, globalObject, impl) |
|
160 { |
|
161 } |
|
162 |
|
163 JSObject* JSSVGGradientElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
164 { |
|
165 return new (exec) JSSVGGradientElementPrototype(globalObject, JSSVGGradientElementPrototype::createStructure(JSSVGElementPrototype::self(exec, globalObject))); |
|
166 } |
|
167 |
|
168 bool JSSVGGradientElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
169 { |
|
170 return getStaticValueSlot<JSSVGGradientElement, Base>(exec, &JSSVGGradientElementTable, this, propertyName, slot); |
|
171 } |
|
172 |
|
173 bool JSSVGGradientElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
174 { |
|
175 return getStaticValueDescriptor<JSSVGGradientElement, Base>(exec, &JSSVGGradientElementTable, this, propertyName, descriptor); |
|
176 } |
|
177 |
|
178 JSValue jsSVGGradientElementGradientUnits(ExecState* exec, JSValue slotBase, const Identifier&) |
|
179 { |
|
180 JSSVGGradientElement* castedThis = static_cast<JSSVGGradientElement*>(asObject(slotBase)); |
|
181 UNUSED_PARAM(exec); |
|
182 SVGGradientElement* imp = static_cast<SVGGradientElement*>(castedThis->impl()); |
|
183 RefPtr<SVGAnimatedEnumeration> obj = imp->gradientUnitsAnimated(); |
|
184 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
185 return result; |
|
186 } |
|
187 |
|
188 JSValue jsSVGGradientElementGradientTransform(ExecState* exec, JSValue slotBase, const Identifier&) |
|
189 { |
|
190 JSSVGGradientElement* castedThis = static_cast<JSSVGGradientElement*>(asObject(slotBase)); |
|
191 UNUSED_PARAM(exec); |
|
192 SVGGradientElement* imp = static_cast<SVGGradientElement*>(castedThis->impl()); |
|
193 RefPtr<SVGAnimatedTransformList> obj = imp->gradientTransformAnimated(); |
|
194 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
195 return result; |
|
196 } |
|
197 |
|
198 JSValue jsSVGGradientElementSpreadMethod(ExecState* exec, JSValue slotBase, const Identifier&) |
|
199 { |
|
200 JSSVGGradientElement* castedThis = static_cast<JSSVGGradientElement*>(asObject(slotBase)); |
|
201 UNUSED_PARAM(exec); |
|
202 SVGGradientElement* imp = static_cast<SVGGradientElement*>(castedThis->impl()); |
|
203 RefPtr<SVGAnimatedEnumeration> obj = imp->spreadMethodAnimated(); |
|
204 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
205 return result; |
|
206 } |
|
207 |
|
208 JSValue jsSVGGradientElementHref(ExecState* exec, JSValue slotBase, const Identifier&) |
|
209 { |
|
210 JSSVGGradientElement* castedThis = static_cast<JSSVGGradientElement*>(asObject(slotBase)); |
|
211 UNUSED_PARAM(exec); |
|
212 SVGGradientElement* imp = static_cast<SVGGradientElement*>(castedThis->impl()); |
|
213 RefPtr<SVGAnimatedString> obj = imp->hrefAnimated(); |
|
214 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
215 return result; |
|
216 } |
|
217 |
|
218 JSValue jsSVGGradientElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&) |
|
219 { |
|
220 JSSVGGradientElement* castedThis = static_cast<JSSVGGradientElement*>(asObject(slotBase)); |
|
221 UNUSED_PARAM(exec); |
|
222 SVGGradientElement* imp = static_cast<SVGGradientElement*>(castedThis->impl()); |
|
223 RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated(); |
|
224 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
225 return result; |
|
226 } |
|
227 |
|
228 JSValue jsSVGGradientElementClassName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
229 { |
|
230 JSSVGGradientElement* castedThis = static_cast<JSSVGGradientElement*>(asObject(slotBase)); |
|
231 UNUSED_PARAM(exec); |
|
232 SVGGradientElement* imp = static_cast<SVGGradientElement*>(castedThis->impl()); |
|
233 RefPtr<SVGAnimatedString> obj = imp->classNameAnimated(); |
|
234 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
235 return result; |
|
236 } |
|
237 |
|
238 JSValue jsSVGGradientElementStyle(ExecState* exec, JSValue slotBase, const Identifier&) |
|
239 { |
|
240 JSSVGGradientElement* castedThis = static_cast<JSSVGGradientElement*>(asObject(slotBase)); |
|
241 UNUSED_PARAM(exec); |
|
242 SVGGradientElement* imp = static_cast<SVGGradientElement*>(castedThis->impl()); |
|
243 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style())); |
|
244 return result; |
|
245 } |
|
246 |
|
247 JSValue jsSVGGradientElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
248 { |
|
249 JSSVGGradientElement* domObject = static_cast<JSSVGGradientElement*>(asObject(slotBase)); |
|
250 return JSSVGGradientElement::getConstructor(exec, domObject->globalObject()); |
|
251 } |
|
252 JSValue JSSVGGradientElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
253 { |
|
254 return getDOMConstructor<JSSVGGradientElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
255 } |
|
256 |
|
257 EncodedJSValue JSC_HOST_CALL jsSVGGradientElementPrototypeFunctionGetPresentationAttribute(ExecState* exec) |
|
258 { |
|
259 JSValue thisValue = exec->hostThisValue(); |
|
260 if (!thisValue.inherits(&JSSVGGradientElement::s_info)) |
|
261 return throwVMTypeError(exec); |
|
262 JSSVGGradientElement* castedThis = static_cast<JSSVGGradientElement*>(asObject(thisValue)); |
|
263 SVGGradientElement* imp = static_cast<SVGGradientElement*>(castedThis->impl()); |
|
264 const String& name = ustringToString(exec->argument(0).toString(exec)); |
|
265 |
|
266 |
|
267 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getPresentationAttribute(name))); |
|
268 return JSValue::encode(result); |
|
269 } |
|
270 |
|
271 // Constant getters |
|
272 |
|
273 JSValue jsSVGGradientElementSVG_SPREADMETHOD_UNKNOWN(ExecState* exec, JSValue, const Identifier&) |
|
274 { |
|
275 return jsNumber(exec, static_cast<int>(0)); |
|
276 } |
|
277 |
|
278 JSValue jsSVGGradientElementSVG_SPREADMETHOD_PAD(ExecState* exec, JSValue, const Identifier&) |
|
279 { |
|
280 return jsNumber(exec, static_cast<int>(1)); |
|
281 } |
|
282 |
|
283 JSValue jsSVGGradientElementSVG_SPREADMETHOD_REFLECT(ExecState* exec, JSValue, const Identifier&) |
|
284 { |
|
285 return jsNumber(exec, static_cast<int>(2)); |
|
286 } |
|
287 |
|
288 JSValue jsSVGGradientElementSVG_SPREADMETHOD_REPEAT(ExecState* exec, JSValue, const Identifier&) |
|
289 { |
|
290 return jsNumber(exec, static_cast<int>(3)); |
|
291 } |
|
292 |
|
293 |
|
294 } |
|
295 |
|
296 #endif // ENABLE(SVG) |