|
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 "JSSVGAnimatedString.h" |
|
26 |
|
27 #include "KURL.h" |
|
28 #include "PlatformString.h" |
|
29 #include <runtime/JSString.h> |
|
30 #include <wtf/GetPtr.h> |
|
31 |
|
32 using namespace JSC; |
|
33 |
|
34 namespace WebCore { |
|
35 |
|
36 ASSERT_CLASS_FITS_IN_CELL(JSSVGAnimatedString); |
|
37 |
|
38 /* Hash table */ |
|
39 #if ENABLE(JIT) |
|
40 #define THUNK_GENERATOR(generator) , generator |
|
41 #else |
|
42 #define THUNK_GENERATOR(generator) |
|
43 #endif |
|
44 |
|
45 static const HashTableValue JSSVGAnimatedStringTableValues[4] = |
|
46 { |
|
47 { "baseVal", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedStringBaseVal), (intptr_t)setJSSVGAnimatedStringBaseVal THUNK_GENERATOR(0) }, |
|
48 { "animVal", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedStringAnimVal), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
49 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedStringConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
50 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
51 }; |
|
52 |
|
53 #undef THUNK_GENERATOR |
|
54 static JSC_CONST_HASHTABLE HashTable JSSVGAnimatedStringTable = { 8, 7, JSSVGAnimatedStringTableValues, 0 }; |
|
55 /* Hash table for constructor */ |
|
56 #if ENABLE(JIT) |
|
57 #define THUNK_GENERATOR(generator) , generator |
|
58 #else |
|
59 #define THUNK_GENERATOR(generator) |
|
60 #endif |
|
61 |
|
62 static const HashTableValue JSSVGAnimatedStringConstructorTableValues[1] = |
|
63 { |
|
64 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
65 }; |
|
66 |
|
67 #undef THUNK_GENERATOR |
|
68 static JSC_CONST_HASHTABLE HashTable JSSVGAnimatedStringConstructorTable = { 1, 0, JSSVGAnimatedStringConstructorTableValues, 0 }; |
|
69 class JSSVGAnimatedStringConstructor : public DOMConstructorObject { |
|
70 public: |
|
71 JSSVGAnimatedStringConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
72 |
|
73 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
74 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
75 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
76 static const JSC::ClassInfo s_info; |
|
77 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
78 { |
|
79 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
80 } |
|
81 protected: |
|
82 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
83 }; |
|
84 |
|
85 const ClassInfo JSSVGAnimatedStringConstructor::s_info = { "SVGAnimatedStringConstructor", 0, &JSSVGAnimatedStringConstructorTable, 0 }; |
|
86 |
|
87 JSSVGAnimatedStringConstructor::JSSVGAnimatedStringConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
88 : DOMConstructorObject(JSSVGAnimatedStringConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
89 { |
|
90 putDirect(exec->propertyNames().prototype, JSSVGAnimatedStringPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
91 } |
|
92 |
|
93 bool JSSVGAnimatedStringConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
94 { |
|
95 return getStaticValueSlot<JSSVGAnimatedStringConstructor, DOMObject>(exec, &JSSVGAnimatedStringConstructorTable, this, propertyName, slot); |
|
96 } |
|
97 |
|
98 bool JSSVGAnimatedStringConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
99 { |
|
100 return getStaticValueDescriptor<JSSVGAnimatedStringConstructor, DOMObject>(exec, &JSSVGAnimatedStringConstructorTable, this, propertyName, descriptor); |
|
101 } |
|
102 |
|
103 /* Hash table for prototype */ |
|
104 #if ENABLE(JIT) |
|
105 #define THUNK_GENERATOR(generator) , generator |
|
106 #else |
|
107 #define THUNK_GENERATOR(generator) |
|
108 #endif |
|
109 |
|
110 static const HashTableValue JSSVGAnimatedStringPrototypeTableValues[1] = |
|
111 { |
|
112 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
113 }; |
|
114 |
|
115 #undef THUNK_GENERATOR |
|
116 static JSC_CONST_HASHTABLE HashTable JSSVGAnimatedStringPrototypeTable = { 1, 0, JSSVGAnimatedStringPrototypeTableValues, 0 }; |
|
117 const ClassInfo JSSVGAnimatedStringPrototype::s_info = { "SVGAnimatedStringPrototype", 0, &JSSVGAnimatedStringPrototypeTable, 0 }; |
|
118 |
|
119 JSObject* JSSVGAnimatedStringPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
120 { |
|
121 return getDOMPrototype<JSSVGAnimatedString>(exec, globalObject); |
|
122 } |
|
123 |
|
124 const ClassInfo JSSVGAnimatedString::s_info = { "SVGAnimatedString", 0, &JSSVGAnimatedStringTable, 0 }; |
|
125 |
|
126 JSSVGAnimatedString::JSSVGAnimatedString(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGAnimatedString> impl) |
|
127 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
128 , m_impl(impl) |
|
129 { |
|
130 } |
|
131 |
|
132 JSSVGAnimatedString::~JSSVGAnimatedString() |
|
133 { |
|
134 forgetDOMObject(this, impl()); |
|
135 JSSVGContextCache::forgetWrapper(this); |
|
136 } |
|
137 |
|
138 JSObject* JSSVGAnimatedString::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
139 { |
|
140 return new (exec) JSSVGAnimatedStringPrototype(globalObject, JSSVGAnimatedStringPrototype::createStructure(globalObject->objectPrototype())); |
|
141 } |
|
142 |
|
143 bool JSSVGAnimatedString::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
144 { |
|
145 return getStaticValueSlot<JSSVGAnimatedString, Base>(exec, &JSSVGAnimatedStringTable, this, propertyName, slot); |
|
146 } |
|
147 |
|
148 bool JSSVGAnimatedString::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
149 { |
|
150 return getStaticValueDescriptor<JSSVGAnimatedString, Base>(exec, &JSSVGAnimatedStringTable, this, propertyName, descriptor); |
|
151 } |
|
152 |
|
153 JSValue jsSVGAnimatedStringBaseVal(ExecState* exec, JSValue slotBase, const Identifier&) |
|
154 { |
|
155 JSSVGAnimatedString* castedThis = static_cast<JSSVGAnimatedString*>(asObject(slotBase)); |
|
156 UNUSED_PARAM(exec); |
|
157 SVGAnimatedString* imp = static_cast<SVGAnimatedString*>(castedThis->impl()); |
|
158 JSValue result = jsString(exec, imp->baseVal()); |
|
159 return result; |
|
160 } |
|
161 |
|
162 JSValue jsSVGAnimatedStringAnimVal(ExecState* exec, JSValue slotBase, const Identifier&) |
|
163 { |
|
164 JSSVGAnimatedString* castedThis = static_cast<JSSVGAnimatedString*>(asObject(slotBase)); |
|
165 UNUSED_PARAM(exec); |
|
166 SVGAnimatedString* imp = static_cast<SVGAnimatedString*>(castedThis->impl()); |
|
167 JSValue result = jsString(exec, imp->animVal()); |
|
168 return result; |
|
169 } |
|
170 |
|
171 JSValue jsSVGAnimatedStringConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
172 { |
|
173 JSSVGAnimatedString* domObject = static_cast<JSSVGAnimatedString*>(asObject(slotBase)); |
|
174 return JSSVGAnimatedString::getConstructor(exec, domObject->globalObject()); |
|
175 } |
|
176 void JSSVGAnimatedString::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
177 { |
|
178 lookupPut<JSSVGAnimatedString, Base>(exec, propertyName, value, &JSSVGAnimatedStringTable, this, slot); |
|
179 } |
|
180 |
|
181 void setJSSVGAnimatedStringBaseVal(ExecState* exec, JSObject* thisObject, JSValue value) |
|
182 { |
|
183 JSSVGAnimatedString* castedThis = static_cast<JSSVGAnimatedString*>(thisObject); |
|
184 SVGAnimatedString* imp = static_cast<SVGAnimatedString*>(castedThis->impl()); |
|
185 imp->setBaseVal(ustringToString(value.toString(exec))); |
|
186 JSSVGContextCache::propagateSVGDOMChange(castedThis, imp->associatedAttributeName()); |
|
187 } |
|
188 |
|
189 JSValue JSSVGAnimatedString::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
190 { |
|
191 return getDOMConstructor<JSSVGAnimatedStringConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
192 } |
|
193 |
|
194 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGAnimatedString* object, SVGElement* context) |
|
195 { |
|
196 return getDOMObjectWrapper<JSSVGAnimatedString>(exec, globalObject, object, context); |
|
197 } |
|
198 SVGAnimatedString* toSVGAnimatedString(JSC::JSValue value) |
|
199 { |
|
200 return value.inherits(&JSSVGAnimatedString::s_info) ? static_cast<JSSVGAnimatedString*>(asObject(value))->impl() : 0; |
|
201 } |
|
202 |
|
203 } |
|
204 |
|
205 #endif // ENABLE(SVG) |