|
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 "JSSVGScriptElement.h" |
|
26 |
|
27 #include "JSSVGAnimatedBoolean.h" |
|
28 #include "JSSVGAnimatedString.h" |
|
29 #include "KURL.h" |
|
30 #include "SVGScriptElement.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(JSSVGScriptElement); |
|
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 JSSVGScriptElementTableValues[5] = |
|
48 { |
|
49 { "type", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGScriptElementType), (intptr_t)setJSSVGScriptElementType THUNK_GENERATOR(0) }, |
|
50 { "href", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGScriptElementHref), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
51 { "externalResourcesRequired", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGScriptElementExternalResourcesRequired), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
52 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGScriptElementConstructor), (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 JSSVGScriptElementTable = { 9, 7, JSSVGScriptElementTableValues, 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 JSSVGScriptElementConstructorTableValues[1] = |
|
66 { |
|
67 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
68 }; |
|
69 |
|
70 #undef THUNK_GENERATOR |
|
71 static JSC_CONST_HASHTABLE HashTable JSSVGScriptElementConstructorTable = { 1, 0, JSSVGScriptElementConstructorTableValues, 0 }; |
|
72 class JSSVGScriptElementConstructor : public DOMConstructorObject { |
|
73 public: |
|
74 JSSVGScriptElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
75 |
|
76 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
77 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
78 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
79 static const JSC::ClassInfo s_info; |
|
80 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
81 { |
|
82 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
83 } |
|
84 protected: |
|
85 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
86 }; |
|
87 |
|
88 const ClassInfo JSSVGScriptElementConstructor::s_info = { "SVGScriptElementConstructor", 0, &JSSVGScriptElementConstructorTable, 0 }; |
|
89 |
|
90 JSSVGScriptElementConstructor::JSSVGScriptElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
91 : DOMConstructorObject(JSSVGScriptElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
92 { |
|
93 putDirect(exec->propertyNames().prototype, JSSVGScriptElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
94 } |
|
95 |
|
96 bool JSSVGScriptElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
97 { |
|
98 return getStaticValueSlot<JSSVGScriptElementConstructor, DOMObject>(exec, &JSSVGScriptElementConstructorTable, this, propertyName, slot); |
|
99 } |
|
100 |
|
101 bool JSSVGScriptElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
102 { |
|
103 return getStaticValueDescriptor<JSSVGScriptElementConstructor, DOMObject>(exec, &JSSVGScriptElementConstructorTable, this, propertyName, descriptor); |
|
104 } |
|
105 |
|
106 /* Hash table for prototype */ |
|
107 #if ENABLE(JIT) |
|
108 #define THUNK_GENERATOR(generator) , generator |
|
109 #else |
|
110 #define THUNK_GENERATOR(generator) |
|
111 #endif |
|
112 |
|
113 static const HashTableValue JSSVGScriptElementPrototypeTableValues[1] = |
|
114 { |
|
115 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
116 }; |
|
117 |
|
118 #undef THUNK_GENERATOR |
|
119 static JSC_CONST_HASHTABLE HashTable JSSVGScriptElementPrototypeTable = { 1, 0, JSSVGScriptElementPrototypeTableValues, 0 }; |
|
120 const ClassInfo JSSVGScriptElementPrototype::s_info = { "SVGScriptElementPrototype", 0, &JSSVGScriptElementPrototypeTable, 0 }; |
|
121 |
|
122 JSObject* JSSVGScriptElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
123 { |
|
124 return getDOMPrototype<JSSVGScriptElement>(exec, globalObject); |
|
125 } |
|
126 |
|
127 const ClassInfo JSSVGScriptElement::s_info = { "SVGScriptElement", &JSSVGElement::s_info, &JSSVGScriptElementTable, 0 }; |
|
128 |
|
129 JSSVGScriptElement::JSSVGScriptElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGScriptElement> impl) |
|
130 : JSSVGElement(structure, globalObject, impl) |
|
131 { |
|
132 } |
|
133 |
|
134 JSObject* JSSVGScriptElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
135 { |
|
136 return new (exec) JSSVGScriptElementPrototype(globalObject, JSSVGScriptElementPrototype::createStructure(JSSVGElementPrototype::self(exec, globalObject))); |
|
137 } |
|
138 |
|
139 bool JSSVGScriptElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
140 { |
|
141 return getStaticValueSlot<JSSVGScriptElement, Base>(exec, &JSSVGScriptElementTable, this, propertyName, slot); |
|
142 } |
|
143 |
|
144 bool JSSVGScriptElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
145 { |
|
146 return getStaticValueDescriptor<JSSVGScriptElement, Base>(exec, &JSSVGScriptElementTable, this, propertyName, descriptor); |
|
147 } |
|
148 |
|
149 JSValue jsSVGScriptElementType(ExecState* exec, JSValue slotBase, const Identifier&) |
|
150 { |
|
151 JSSVGScriptElement* castedThis = static_cast<JSSVGScriptElement*>(asObject(slotBase)); |
|
152 UNUSED_PARAM(exec); |
|
153 SVGScriptElement* imp = static_cast<SVGScriptElement*>(castedThis->impl()); |
|
154 JSValue result = jsString(exec, imp->type()); |
|
155 return result; |
|
156 } |
|
157 |
|
158 JSValue jsSVGScriptElementHref(ExecState* exec, JSValue slotBase, const Identifier&) |
|
159 { |
|
160 JSSVGScriptElement* castedThis = static_cast<JSSVGScriptElement*>(asObject(slotBase)); |
|
161 UNUSED_PARAM(exec); |
|
162 SVGScriptElement* imp = static_cast<SVGScriptElement*>(castedThis->impl()); |
|
163 RefPtr<SVGAnimatedString> obj = imp->hrefAnimated(); |
|
164 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
165 return result; |
|
166 } |
|
167 |
|
168 JSValue jsSVGScriptElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&) |
|
169 { |
|
170 JSSVGScriptElement* castedThis = static_cast<JSSVGScriptElement*>(asObject(slotBase)); |
|
171 UNUSED_PARAM(exec); |
|
172 SVGScriptElement* imp = static_cast<SVGScriptElement*>(castedThis->impl()); |
|
173 RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated(); |
|
174 JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); |
|
175 return result; |
|
176 } |
|
177 |
|
178 JSValue jsSVGScriptElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
179 { |
|
180 JSSVGScriptElement* domObject = static_cast<JSSVGScriptElement*>(asObject(slotBase)); |
|
181 return JSSVGScriptElement::getConstructor(exec, domObject->globalObject()); |
|
182 } |
|
183 void JSSVGScriptElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
184 { |
|
185 lookupPut<JSSVGScriptElement, Base>(exec, propertyName, value, &JSSVGScriptElementTable, this, slot); |
|
186 } |
|
187 |
|
188 void setJSSVGScriptElementType(ExecState* exec, JSObject* thisObject, JSValue value) |
|
189 { |
|
190 JSSVGScriptElement* castedThis = static_cast<JSSVGScriptElement*>(thisObject); |
|
191 SVGScriptElement* imp = static_cast<SVGScriptElement*>(castedThis->impl()); |
|
192 imp->setType(valueToStringWithNullCheck(exec, value)); |
|
193 } |
|
194 |
|
195 JSValue JSSVGScriptElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
196 { |
|
197 return getDOMConstructor<JSSVGScriptElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
198 } |
|
199 |
|
200 |
|
201 } |
|
202 |
|
203 #endif // ENABLE(SVG) |