|
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 "JSSVGException.h" |
|
26 |
|
27 #include "KURL.h" |
|
28 #include "SVGException.h" |
|
29 #include <runtime/Error.h> |
|
30 #include <runtime/JSNumberCell.h> |
|
31 #include <runtime/JSString.h> |
|
32 #include <wtf/GetPtr.h> |
|
33 |
|
34 using namespace JSC; |
|
35 |
|
36 namespace WebCore { |
|
37 |
|
38 ASSERT_CLASS_FITS_IN_CELL(JSSVGException); |
|
39 |
|
40 /* Hash table */ |
|
41 #if ENABLE(JIT) |
|
42 #define THUNK_GENERATOR(generator) , generator |
|
43 #else |
|
44 #define THUNK_GENERATOR(generator) |
|
45 #endif |
|
46 |
|
47 static const HashTableValue JSSVGExceptionTableValues[5] = |
|
48 { |
|
49 { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGExceptionCode), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
50 { "name", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGExceptionName), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
51 { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGExceptionMessage), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
52 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGExceptionConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
53 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
54 }; |
|
55 |
|
56 #undef THUNK_GENERATOR |
|
57 static JSC_CONST_HASHTABLE HashTable JSSVGExceptionTable = { 10, 7, JSSVGExceptionTableValues, 0 }; |
|
58 /* Hash table for constructor */ |
|
59 #if ENABLE(JIT) |
|
60 #define THUNK_GENERATOR(generator) , generator |
|
61 #else |
|
62 #define THUNK_GENERATOR(generator) |
|
63 #endif |
|
64 |
|
65 static const HashTableValue JSSVGExceptionConstructorTableValues[4] = |
|
66 { |
|
67 { "SVG_WRONG_TYPE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGExceptionSVG_WRONG_TYPE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
68 { "SVG_INVALID_VALUE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGExceptionSVG_INVALID_VALUE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
69 { "SVG_MATRIX_NOT_INVERTABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGExceptionSVG_MATRIX_NOT_INVERTABLE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
70 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
71 }; |
|
72 |
|
73 #undef THUNK_GENERATOR |
|
74 static JSC_CONST_HASHTABLE HashTable JSSVGExceptionConstructorTable = { 9, 7, JSSVGExceptionConstructorTableValues, 0 }; |
|
75 class JSSVGExceptionConstructor : public DOMConstructorObject { |
|
76 public: |
|
77 JSSVGExceptionConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
78 |
|
79 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
80 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
81 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
82 static const JSC::ClassInfo s_info; |
|
83 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
84 { |
|
85 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
86 } |
|
87 protected: |
|
88 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
89 }; |
|
90 |
|
91 const ClassInfo JSSVGExceptionConstructor::s_info = { "SVGExceptionConstructor", 0, &JSSVGExceptionConstructorTable, 0 }; |
|
92 |
|
93 JSSVGExceptionConstructor::JSSVGExceptionConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
94 : DOMConstructorObject(JSSVGExceptionConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
95 { |
|
96 putDirect(exec->propertyNames().prototype, JSSVGExceptionPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
97 } |
|
98 |
|
99 bool JSSVGExceptionConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
100 { |
|
101 return getStaticValueSlot<JSSVGExceptionConstructor, DOMObject>(exec, &JSSVGExceptionConstructorTable, this, propertyName, slot); |
|
102 } |
|
103 |
|
104 bool JSSVGExceptionConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
105 { |
|
106 return getStaticValueDescriptor<JSSVGExceptionConstructor, DOMObject>(exec, &JSSVGExceptionConstructorTable, this, propertyName, descriptor); |
|
107 } |
|
108 |
|
109 /* Hash table for prototype */ |
|
110 #if ENABLE(JIT) |
|
111 #define THUNK_GENERATOR(generator) , generator |
|
112 #else |
|
113 #define THUNK_GENERATOR(generator) |
|
114 #endif |
|
115 |
|
116 static const HashTableValue JSSVGExceptionPrototypeTableValues[5] = |
|
117 { |
|
118 { "SVG_WRONG_TYPE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGExceptionSVG_WRONG_TYPE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
119 { "SVG_INVALID_VALUE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGExceptionSVG_INVALID_VALUE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
120 { "SVG_MATRIX_NOT_INVERTABLE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGExceptionSVG_MATRIX_NOT_INVERTABLE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
121 { "toString", DontDelete | DontEnum | Function, (intptr_t)static_cast<NativeFunction>(jsSVGExceptionPrototypeFunctionToString), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
122 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
123 }; |
|
124 |
|
125 #undef THUNK_GENERATOR |
|
126 static JSC_CONST_HASHTABLE HashTable JSSVGExceptionPrototypeTable = { 9, 7, JSSVGExceptionPrototypeTableValues, 0 }; |
|
127 const ClassInfo JSSVGExceptionPrototype::s_info = { "SVGExceptionPrototype", 0, &JSSVGExceptionPrototypeTable, 0 }; |
|
128 |
|
129 JSObject* JSSVGExceptionPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
130 { |
|
131 return getDOMPrototype<JSSVGException>(exec, globalObject); |
|
132 } |
|
133 |
|
134 bool JSSVGExceptionPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
135 { |
|
136 return getStaticPropertySlot<JSSVGExceptionPrototype, JSObject>(exec, &JSSVGExceptionPrototypeTable, this, propertyName, slot); |
|
137 } |
|
138 |
|
139 bool JSSVGExceptionPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
140 { |
|
141 return getStaticPropertyDescriptor<JSSVGExceptionPrototype, JSObject>(exec, &JSSVGExceptionPrototypeTable, this, propertyName, descriptor); |
|
142 } |
|
143 |
|
144 const ClassInfo JSSVGException::s_info = { "SVGException", 0, &JSSVGExceptionTable, 0 }; |
|
145 |
|
146 JSSVGException::JSSVGException(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGException> impl) |
|
147 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
148 , m_impl(impl) |
|
149 { |
|
150 } |
|
151 |
|
152 JSSVGException::~JSSVGException() |
|
153 { |
|
154 forgetDOMObject(this, impl()); |
|
155 JSSVGContextCache::forgetWrapper(this); |
|
156 } |
|
157 |
|
158 JSObject* JSSVGException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
159 { |
|
160 return new (exec) JSSVGExceptionPrototype(globalObject, JSSVGExceptionPrototype::createStructure(globalObject->objectPrototype())); |
|
161 } |
|
162 |
|
163 bool JSSVGException::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
164 { |
|
165 return getStaticValueSlot<JSSVGException, Base>(exec, &JSSVGExceptionTable, this, propertyName, slot); |
|
166 } |
|
167 |
|
168 bool JSSVGException::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
169 { |
|
170 return getStaticValueDescriptor<JSSVGException, Base>(exec, &JSSVGExceptionTable, this, propertyName, descriptor); |
|
171 } |
|
172 |
|
173 JSValue jsSVGExceptionCode(ExecState* exec, JSValue slotBase, const Identifier&) |
|
174 { |
|
175 JSSVGException* castedThis = static_cast<JSSVGException*>(asObject(slotBase)); |
|
176 UNUSED_PARAM(exec); |
|
177 SVGException* imp = static_cast<SVGException*>(castedThis->impl()); |
|
178 JSValue result = jsNumber(exec, imp->code()); |
|
179 return result; |
|
180 } |
|
181 |
|
182 JSValue jsSVGExceptionName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
183 { |
|
184 JSSVGException* castedThis = static_cast<JSSVGException*>(asObject(slotBase)); |
|
185 UNUSED_PARAM(exec); |
|
186 SVGException* imp = static_cast<SVGException*>(castedThis->impl()); |
|
187 JSValue result = jsString(exec, imp->name()); |
|
188 return result; |
|
189 } |
|
190 |
|
191 JSValue jsSVGExceptionMessage(ExecState* exec, JSValue slotBase, const Identifier&) |
|
192 { |
|
193 JSSVGException* castedThis = static_cast<JSSVGException*>(asObject(slotBase)); |
|
194 UNUSED_PARAM(exec); |
|
195 SVGException* imp = static_cast<SVGException*>(castedThis->impl()); |
|
196 JSValue result = jsString(exec, imp->message()); |
|
197 return result; |
|
198 } |
|
199 |
|
200 JSValue jsSVGExceptionConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
201 { |
|
202 JSSVGException* domObject = static_cast<JSSVGException*>(asObject(slotBase)); |
|
203 return JSSVGException::getConstructor(exec, domObject->globalObject()); |
|
204 } |
|
205 JSValue JSSVGException::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
206 { |
|
207 return getDOMConstructor<JSSVGExceptionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
208 } |
|
209 |
|
210 EncodedJSValue JSC_HOST_CALL jsSVGExceptionPrototypeFunctionToString(ExecState* exec) |
|
211 { |
|
212 JSValue thisValue = exec->hostThisValue(); |
|
213 if (!thisValue.inherits(&JSSVGException::s_info)) |
|
214 return throwVMTypeError(exec); |
|
215 JSSVGException* castedThis = static_cast<JSSVGException*>(asObject(thisValue)); |
|
216 SVGException* imp = static_cast<SVGException*>(castedThis->impl()); |
|
217 |
|
218 |
|
219 JSC::JSValue result = jsString(exec, imp->toString()); |
|
220 return JSValue::encode(result); |
|
221 } |
|
222 |
|
223 // Constant getters |
|
224 |
|
225 JSValue jsSVGExceptionSVG_WRONG_TYPE_ERR(ExecState* exec, JSValue, const Identifier&) |
|
226 { |
|
227 return jsNumber(exec, static_cast<int>(0)); |
|
228 } |
|
229 |
|
230 JSValue jsSVGExceptionSVG_INVALID_VALUE_ERR(ExecState* exec, JSValue, const Identifier&) |
|
231 { |
|
232 return jsNumber(exec, static_cast<int>(1)); |
|
233 } |
|
234 |
|
235 JSValue jsSVGExceptionSVG_MATRIX_NOT_INVERTABLE(ExecState* exec, JSValue, const Identifier&) |
|
236 { |
|
237 return jsNumber(exec, static_cast<int>(2)); |
|
238 } |
|
239 |
|
240 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGException* object, SVGElement* context) |
|
241 { |
|
242 return getDOMObjectWrapper<JSSVGException>(exec, globalObject, object, context); |
|
243 } |
|
244 SVGException* toSVGException(JSC::JSValue value) |
|
245 { |
|
246 return value.inherits(&JSSVGException::s_info) ? static_cast<JSSVGException*>(asObject(value))->impl() : 0; |
|
247 } |
|
248 |
|
249 } |
|
250 |
|
251 #endif // ENABLE(SVG) |