Updated WebKit from /home/shausman/src/webkit/trunk to origin/qtwebkit-4.5 ( bd7262be...
[qt:qt-l10n-hu.git] / src / 3rdparty / webkit / WebCore / generated / JSSVGNumberList.cpp
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
24 #if ENABLE(SVG)
25
26 #include "SVGElement.h"
27 #include "JSSVGNumberList.h"
28
29 #include <wtf/GetPtr.h>
30
31 #include "JSSVGNumber.h"
32 #include "SVGNumberList.h"
33
34 #include <runtime/Error.h>
35 #include <runtime/JSNumberCell.h>
36
37 using namespace JSC;
38
39 namespace WebCore {
40
41 ASSERT_CLASS_FITS_IN_CELL(JSSVGNumberList)
42
43 /* Hash table */
44
45 static const HashTableValue JSSVGNumberListTableValues[2] =
46 {
47     { "numberOfItems", DontDelete|ReadOnly, (intptr_t)jsSVGNumberListNumberOfItems, (intptr_t)0 },
48     { 0, 0, 0, 0 }
49 };
50
51 static const HashTable JSSVGNumberListTable =
52 #if ENABLE(PERFECT_HASH_SIZE)
53     { 0, JSSVGNumberListTableValues, 0 };
54 #else
55     { 2, 1, JSSVGNumberListTableValues, 0 };
56 #endif
57
58 /* Hash table for prototype */
59
60 static const HashTableValue JSSVGNumberListPrototypeTableValues[8] =
61 {
62     { "clear", DontDelete|Function, (intptr_t)jsSVGNumberListPrototypeFunctionClear, (intptr_t)0 },
63     { "initialize", DontDelete|Function, (intptr_t)jsSVGNumberListPrototypeFunctionInitialize, (intptr_t)1 },
64     { "getItem", DontDelete|Function, (intptr_t)jsSVGNumberListPrototypeFunctionGetItem, (intptr_t)1 },
65     { "insertItemBefore", DontDelete|Function, (intptr_t)jsSVGNumberListPrototypeFunctionInsertItemBefore, (intptr_t)2 },
66     { "replaceItem", DontDelete|Function, (intptr_t)jsSVGNumberListPrototypeFunctionReplaceItem, (intptr_t)2 },
67     { "removeItem", DontDelete|Function, (intptr_t)jsSVGNumberListPrototypeFunctionRemoveItem, (intptr_t)1 },
68     { "appendItem", DontDelete|Function, (intptr_t)jsSVGNumberListPrototypeFunctionAppendItem, (intptr_t)1 },
69     { 0, 0, 0, 0 }
70 };
71
72 static const HashTable JSSVGNumberListPrototypeTable =
73 #if ENABLE(PERFECT_HASH_SIZE)
74     { 63, JSSVGNumberListPrototypeTableValues, 0 };
75 #else
76     { 18, 15, JSSVGNumberListPrototypeTableValues, 0 };
77 #endif
78
79 const ClassInfo JSSVGNumberListPrototype::s_info = { "SVGNumberListPrototype", 0, &JSSVGNumberListPrototypeTable, 0 };
80
81 JSObject* JSSVGNumberListPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
82 {
83     return getDOMPrototype<JSSVGNumberList>(exec, globalObject);
84 }
85
86 bool JSSVGNumberListPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
87 {
88     return getStaticFunctionSlot<JSObject>(exec, &JSSVGNumberListPrototypeTable, this, propertyName, slot);
89 }
90
91 const ClassInfo JSSVGNumberList::s_info = { "SVGNumberList", 0, &JSSVGNumberListTable, 0 };
92
93 JSSVGNumberList::JSSVGNumberList(PassRefPtr<Structure> structure, PassRefPtr<SVGNumberList> impl, SVGElement* context)
94     : DOMObject(structure)
95     , m_context(context)
96     , m_impl(impl)
97 {
98 }
99
100 JSSVGNumberList::~JSSVGNumberList()
101 {
102     forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get());
103
104 }
105
106 JSObject* JSSVGNumberList::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
107 {
108     return new (exec) JSSVGNumberListPrototype(JSSVGNumberListPrototype::createStructure(globalObject->objectPrototype()));
109 }
110
111 bool JSSVGNumberList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
112 {
113     return getStaticValueSlot<JSSVGNumberList, Base>(exec, &JSSVGNumberListTable, this, propertyName, slot);
114 }
115
116 JSValuePtr jsSVGNumberListNumberOfItems(ExecState* exec, const Identifier&, const PropertySlot& slot)
117 {
118     SVGNumberList* imp = static_cast<SVGNumberList*>(static_cast<JSSVGNumberList*>(asObject(slot.slotBase()))->impl());
119     return jsNumber(exec, imp->numberOfItems());
120 }
121
122 JSValuePtr jsSVGNumberListPrototypeFunctionClear(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
123 {
124     if (!thisValue->isObject(&JSSVGNumberList::s_info))
125         return throwError(exec, TypeError);
126     JSSVGNumberList* castedThisObj = static_cast<JSSVGNumberList*>(asObject(thisValue));
127     SVGNumberList* imp = static_cast<SVGNumberList*>(castedThisObj->impl());
128     ExceptionCode ec = 0;
129
130     imp->clear(ec);
131     setDOMException(exec, ec);
132     return jsUndefined();
133 }
134
135 JSValuePtr jsSVGNumberListPrototypeFunctionInitialize(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
136 {
137     if (!thisValue->isObject(&JSSVGNumberList::s_info))
138         return throwError(exec, TypeError);
139     JSSVGNumberList* castedThisObj = static_cast<JSSVGNumberList*>(asObject(thisValue));
140     SVGNumberList* imp = static_cast<SVGNumberList*>(castedThisObj->impl());
141     ExceptionCode ec = 0;
142     float item = args.at(exec, 0)->toFloat(exec);
143
144
145     JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<float>::create(imp->initialize(item, ec)).get(), castedThisObj->context());
146     setDOMException(exec, ec);
147     return result;
148 }
149
150 JSValuePtr jsSVGNumberListPrototypeFunctionGetItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
151 {
152     if (!thisValue->isObject(&JSSVGNumberList::s_info))
153         return throwError(exec, TypeError);
154     JSSVGNumberList* castedThisObj = static_cast<JSSVGNumberList*>(asObject(thisValue));
155     SVGNumberList* imp = static_cast<SVGNumberList*>(castedThisObj->impl());
156     ExceptionCode ec = 0;
157     unsigned index = args.at(exec, 0)->toInt32(exec);
158
159
160     JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<float>::create(imp->getItem(index, ec)).get(), castedThisObj->context());
161     setDOMException(exec, ec);
162     return result;
163 }
164
165 JSValuePtr jsSVGNumberListPrototypeFunctionInsertItemBefore(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
166 {
167     if (!thisValue->isObject(&JSSVGNumberList::s_info))
168         return throwError(exec, TypeError);
169     JSSVGNumberList* castedThisObj = static_cast<JSSVGNumberList*>(asObject(thisValue));
170     SVGNumberList* imp = static_cast<SVGNumberList*>(castedThisObj->impl());
171     ExceptionCode ec = 0;
172     float item = args.at(exec, 0)->toFloat(exec);
173     unsigned index = args.at(exec, 1)->toInt32(exec);
174
175
176     JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<float>::create(imp->insertItemBefore(item, index, ec)).get(), castedThisObj->context());
177     setDOMException(exec, ec);
178     return result;
179 }
180
181 JSValuePtr jsSVGNumberListPrototypeFunctionReplaceItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
182 {
183     if (!thisValue->isObject(&JSSVGNumberList::s_info))
184         return throwError(exec, TypeError);
185     JSSVGNumberList* castedThisObj = static_cast<JSSVGNumberList*>(asObject(thisValue));
186     SVGNumberList* imp = static_cast<SVGNumberList*>(castedThisObj->impl());
187     ExceptionCode ec = 0;
188     float item = args.at(exec, 0)->toFloat(exec);
189     unsigned index = args.at(exec, 1)->toInt32(exec);
190
191
192     JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<float>::create(imp->replaceItem(item, index, ec)).get(), castedThisObj->context());
193     setDOMException(exec, ec);
194     return result;
195 }
196
197 JSValuePtr jsSVGNumberListPrototypeFunctionRemoveItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
198 {
199     if (!thisValue->isObject(&JSSVGNumberList::s_info))
200         return throwError(exec, TypeError);
201     JSSVGNumberList* castedThisObj = static_cast<JSSVGNumberList*>(asObject(thisValue));
202     SVGNumberList* imp = static_cast<SVGNumberList*>(castedThisObj->impl());
203     ExceptionCode ec = 0;
204     unsigned index = args.at(exec, 0)->toInt32(exec);
205
206
207     JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<float>::create(imp->removeItem(index, ec)).get(), castedThisObj->context());
208     setDOMException(exec, ec);
209     return result;
210 }
211
212 JSValuePtr jsSVGNumberListPrototypeFunctionAppendItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
213 {
214     if (!thisValue->isObject(&JSSVGNumberList::s_info))
215         return throwError(exec, TypeError);
216     JSSVGNumberList* castedThisObj = static_cast<JSSVGNumberList*>(asObject(thisValue));
217     SVGNumberList* imp = static_cast<SVGNumberList*>(castedThisObj->impl());
218     ExceptionCode ec = 0;
219     float item = args.at(exec, 0)->toFloat(exec);
220
221
222     JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<float>::create(imp->appendItem(item, ec)).get(), castedThisObj->context());
223     setDOMException(exec, ec);
224     return result;
225 }
226
227 JSC::JSValuePtr toJS(JSC::ExecState* exec, SVGNumberList* object, SVGElement* context)
228 {
229     return getDOMObjectWrapper<JSSVGNumberList>(exec, object, context);
230 }
231 SVGNumberList* toSVGNumberList(JSC::JSValuePtr value)
232 {
233     return value->isObject(&JSSVGNumberList::s_info) ? static_cast<JSSVGNumberList*>(asObject(value))->impl() : 0;
234 }
235
236 }
237
238 #endif // ENABLE(SVG)