|
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 "JSSVGTextElement.h" |
|
26 |
|
27 #include "JSSVGAnimatedTransformList.h" |
|
28 #include "JSSVGElement.h" |
|
29 #include "JSSVGMatrix.h" |
|
30 #include "JSSVGRect.h" |
|
31 #include "SVGElement.h" |
|
32 #include "SVGTextElement.h" |
|
33 #include <runtime/Error.h> |
|
34 #include <wtf/GetPtr.h> |
|
35 |
|
36 using namespace JSC; |
|
37 |
|
38 namespace WebCore { |
|
39 |
|
40 ASSERT_CLASS_FITS_IN_CELL(JSSVGTextElement); |
|
41 |
|
42 /* Hash table */ |
|
43 #if ENABLE(JIT) |
|
44 #define THUNK_GENERATOR(generator) , generator |
|
45 #else |
|
46 #define THUNK_GENERATOR(generator) |
|
47 #endif |
|
48 |
|
49 static const HashTableValue JSSVGTextElementTableValues[5] = |
|
50 { |
|
51 { "transform", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextElementTransform), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
52 { "nearestViewportElement", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextElementNearestViewportElement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
53 { "farthestViewportElement", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextElementFarthestViewportElement), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
54 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
55 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
56 }; |
|
57 |
|
58 #undef THUNK_GENERATOR |
|
59 static JSC_CONST_HASHTABLE HashTable JSSVGTextElementTable = { 9, 7, JSSVGTextElementTableValues, 0 }; |
|
60 /* Hash table for constructor */ |
|
61 #if ENABLE(JIT) |
|
62 #define THUNK_GENERATOR(generator) , generator |
|
63 #else |
|
64 #define THUNK_GENERATOR(generator) |
|
65 #endif |
|
66 |
|
67 static const HashTableValue JSSVGTextElementConstructorTableValues[1] = |
|
68 { |
|
69 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
70 }; |
|
71 |
|
72 #undef THUNK_GENERATOR |
|
73 static JSC_CONST_HASHTABLE HashTable JSSVGTextElementConstructorTable = { 1, 0, JSSVGTextElementConstructorTableValues, 0 }; |
|
74 class JSSVGTextElementConstructor : public DOMConstructorObject { |
|
75 public: |
|
76 JSSVGTextElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
77 |
|
78 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
79 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
80 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
81 static const JSC::ClassInfo s_info; |
|
82 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
83 { |
|
84 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
85 } |
|
86 protected: |
|
87 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
88 }; |
|
89 |
|
90 const ClassInfo JSSVGTextElementConstructor::s_info = { "SVGTextElementConstructor", 0, &JSSVGTextElementConstructorTable, 0 }; |
|
91 |
|
92 JSSVGTextElementConstructor::JSSVGTextElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
93 : DOMConstructorObject(JSSVGTextElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
94 { |
|
95 putDirect(exec->propertyNames().prototype, JSSVGTextElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
96 } |
|
97 |
|
98 bool JSSVGTextElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
99 { |
|
100 return getStaticValueSlot<JSSVGTextElementConstructor, DOMObject>(exec, &JSSVGTextElementConstructorTable, this, propertyName, slot); |
|
101 } |
|
102 |
|
103 bool JSSVGTextElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
104 { |
|
105 return getStaticValueDescriptor<JSSVGTextElementConstructor, DOMObject>(exec, &JSSVGTextElementConstructorTable, this, propertyName, descriptor); |
|
106 } |
|
107 |
|
108 /* Hash table for prototype */ |
|
109 #if ENABLE(JIT) |
|
110 #define THUNK_GENERATOR(generator) , generator |
|
111 #else |
|
112 #define THUNK_GENERATOR(generator) |
|
113 #endif |
|
114 |
|
115 static const HashTableValue JSSVGTextElementPrototypeTableValues[5] = |
|
116 { |
|
117 { "getBBox", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextElementPrototypeFunctionGetBBox), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
118 { "getCTM", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextElementPrototypeFunctionGetCTM), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
119 { "getScreenCTM", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextElementPrototypeFunctionGetScreenCTM), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
120 { "getTransformToElement", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextElementPrototypeFunctionGetTransformToElement), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
121 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
122 }; |
|
123 |
|
124 #undef THUNK_GENERATOR |
|
125 static JSC_CONST_HASHTABLE HashTable JSSVGTextElementPrototypeTable = { 8, 7, JSSVGTextElementPrototypeTableValues, 0 }; |
|
126 const ClassInfo JSSVGTextElementPrototype::s_info = { "SVGTextElementPrototype", 0, &JSSVGTextElementPrototypeTable, 0 }; |
|
127 |
|
128 JSObject* JSSVGTextElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
129 { |
|
130 return getDOMPrototype<JSSVGTextElement>(exec, globalObject); |
|
131 } |
|
132 |
|
133 bool JSSVGTextElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
134 { |
|
135 return getStaticFunctionSlot<JSObject>(exec, &JSSVGTextElementPrototypeTable, this, propertyName, slot); |
|
136 } |
|
137 |
|
138 bool JSSVGTextElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
139 { |
|
140 return getStaticFunctionDescriptor<JSObject>(exec, &JSSVGTextElementPrototypeTable, this, propertyName, descriptor); |
|
141 } |
|
142 |
|
143 const ClassInfo JSSVGTextElement::s_info = { "SVGTextElement", &JSSVGTextPositioningElement::s_info, &JSSVGTextElementTable, 0 }; |
|
144 |
|
145 JSSVGTextElement::JSSVGTextElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGTextElement> impl) |
|
146 : JSSVGTextPositioningElement(structure, globalObject, impl) |
|
147 { |
|
148 } |
|
149 |
|
150 JSObject* JSSVGTextElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
151 { |
|
152 return new (exec) JSSVGTextElementPrototype(globalObject, JSSVGTextElementPrototype::createStructure(JSSVGTextPositioningElementPrototype::self(exec, globalObject))); |
|
153 } |
|
154 |
|
155 bool JSSVGTextElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
156 { |
|
157 return getStaticValueSlot<JSSVGTextElement, Base>(exec, &JSSVGTextElementTable, this, propertyName, slot); |
|
158 } |
|
159 |
|
160 bool JSSVGTextElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
161 { |
|
162 return getStaticValueDescriptor<JSSVGTextElement, Base>(exec, &JSSVGTextElementTable, this, propertyName, descriptor); |
|
163 } |
|
164 |
|
165 JSValue jsSVGTextElementTransform(ExecState* exec, JSValue slotBase, const Identifier&) |
|
166 { |
|
167 JSSVGTextElement* castedThis = static_cast<JSSVGTextElement*>(asObject(slotBase)); |
|
168 UNUSED_PARAM(exec); |
|
169 SVGTextElement* imp = static_cast<SVGTextElement*>(castedThis->impl()); |
|
170 RefPtr<SVGAnimatedTransformList> obj = imp->transformAnimated(); |
|
171 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
172 return result; |
|
173 } |
|
174 |
|
175 JSValue jsSVGTextElementNearestViewportElement(ExecState* exec, JSValue slotBase, const Identifier&) |
|
176 { |
|
177 JSSVGTextElement* castedThis = static_cast<JSSVGTextElement*>(asObject(slotBase)); |
|
178 UNUSED_PARAM(exec); |
|
179 SVGTextElement* imp = static_cast<SVGTextElement*>(castedThis->impl()); |
|
180 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->nearestViewportElement())); |
|
181 return result; |
|
182 } |
|
183 |
|
184 JSValue jsSVGTextElementFarthestViewportElement(ExecState* exec, JSValue slotBase, const Identifier&) |
|
185 { |
|
186 JSSVGTextElement* castedThis = static_cast<JSSVGTextElement*>(asObject(slotBase)); |
|
187 UNUSED_PARAM(exec); |
|
188 SVGTextElement* imp = static_cast<SVGTextElement*>(castedThis->impl()); |
|
189 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->farthestViewportElement())); |
|
190 return result; |
|
191 } |
|
192 |
|
193 JSValue jsSVGTextElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
194 { |
|
195 JSSVGTextElement* domObject = static_cast<JSSVGTextElement*>(asObject(slotBase)); |
|
196 return JSSVGTextElement::getConstructor(exec, domObject->globalObject()); |
|
197 } |
|
198 JSValue JSSVGTextElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
199 { |
|
200 return getDOMConstructor<JSSVGTextElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
201 } |
|
202 |
|
203 EncodedJSValue JSC_HOST_CALL jsSVGTextElementPrototypeFunctionGetBBox(ExecState* exec) |
|
204 { |
|
205 JSValue thisValue = exec->hostThisValue(); |
|
206 if (!thisValue.inherits(&JSSVGTextElement::s_info)) |
|
207 return throwVMTypeError(exec); |
|
208 JSSVGTextElement* castedThis = static_cast<JSSVGTextElement*>(asObject(thisValue)); |
|
209 SVGTextElement* imp = static_cast<SVGTextElement*>(castedThis->impl()); |
|
210 |
|
211 |
|
212 JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<FloatRect>::create(imp->getBBox()).get(), 0 /* no context on purpose */); |
|
213 return JSValue::encode(result); |
|
214 } |
|
215 |
|
216 EncodedJSValue JSC_HOST_CALL jsSVGTextElementPrototypeFunctionGetCTM(ExecState* exec) |
|
217 { |
|
218 JSValue thisValue = exec->hostThisValue(); |
|
219 if (!thisValue.inherits(&JSSVGTextElement::s_info)) |
|
220 return throwVMTypeError(exec); |
|
221 JSSVGTextElement* castedThis = static_cast<JSSVGTextElement*>(asObject(thisValue)); |
|
222 SVGTextElement* imp = static_cast<SVGTextElement*>(castedThis->impl()); |
|
223 |
|
224 |
|
225 JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp->getCTM()).get(), 0 /* no context on purpose */); |
|
226 return JSValue::encode(result); |
|
227 } |
|
228 |
|
229 EncodedJSValue JSC_HOST_CALL jsSVGTextElementPrototypeFunctionGetScreenCTM(ExecState* exec) |
|
230 { |
|
231 JSValue thisValue = exec->hostThisValue(); |
|
232 if (!thisValue.inherits(&JSSVGTextElement::s_info)) |
|
233 return throwVMTypeError(exec); |
|
234 JSSVGTextElement* castedThis = static_cast<JSSVGTextElement*>(asObject(thisValue)); |
|
235 SVGTextElement* imp = static_cast<SVGTextElement*>(castedThis->impl()); |
|
236 |
|
237 |
|
238 JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp->getScreenCTM()).get(), 0 /* no context on purpose */); |
|
239 return JSValue::encode(result); |
|
240 } |
|
241 |
|
242 EncodedJSValue JSC_HOST_CALL jsSVGTextElementPrototypeFunctionGetTransformToElement(ExecState* exec) |
|
243 { |
|
244 JSValue thisValue = exec->hostThisValue(); |
|
245 if (!thisValue.inherits(&JSSVGTextElement::s_info)) |
|
246 return throwVMTypeError(exec); |
|
247 JSSVGTextElement* castedThis = static_cast<JSSVGTextElement*>(asObject(thisValue)); |
|
248 SVGTextElement* imp = static_cast<SVGTextElement*>(castedThis->impl()); |
|
249 ExceptionCode ec = 0; |
|
250 SVGElement* element = toSVGElement(exec->argument(0)); |
|
251 |
|
252 |
|
253 JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp->getTransformToElement(element, ec)).get(), 0 /* no context on purpose */); |
|
254 setDOMException(exec, ec); |
|
255 return JSValue::encode(result); |
|
256 } |
|
257 |
|
258 |
|
259 } |
|
260 |
|
261 #endif // ENABLE(SVG) |