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