~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/generated/JSSVGLengthList.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "config.h"
22
22
 
23
 
 
24
23
#if ENABLE(SVG)
25
24
 
26
 
#include "SVGElement.h"
27
25
#include "JSSVGLengthList.h"
28
26
 
29
 
#include <wtf/GetPtr.h>
30
 
 
31
27
#include "JSSVGLength.h"
32
28
#include "SVGLength.h"
33
29
#include "SVGLengthList.h"
34
 
 
35
30
#include <runtime/Error.h>
36
31
#include <runtime/JSNumberCell.h>
 
32
#include <wtf/GetPtr.h>
37
33
 
38
34
using namespace JSC;
39
35
 
40
36
namespace WebCore {
41
37
 
42
 
ASSERT_CLASS_FITS_IN_CELL(JSSVGLengthList)
 
38
ASSERT_CLASS_FITS_IN_CELL(JSSVGLengthList);
43
39
 
44
40
/* Hash table */
45
41
 
49
45
    { 0, 0, 0, 0 }
50
46
};
51
47
 
52
 
static const HashTable JSSVGLengthListTable =
 
48
static JSC_CONST_HASHTABLE HashTable JSSVGLengthListTable =
53
49
#if ENABLE(PERFECT_HASH_SIZE)
54
50
    { 0, JSSVGLengthListTableValues, 0 };
55
51
#else
70
66
    { 0, 0, 0, 0 }
71
67
};
72
68
 
73
 
static const HashTable JSSVGLengthListPrototypeTable =
 
69
static JSC_CONST_HASHTABLE HashTable JSSVGLengthListPrototypeTable =
74
70
#if ENABLE(PERFECT_HASH_SIZE)
75
71
    { 63, JSSVGLengthListPrototypeTableValues, 0 };
76
72
#else
89
85
    return getStaticFunctionSlot<JSObject>(exec, &JSSVGLengthListPrototypeTable, this, propertyName, slot);
90
86
}
91
87
 
 
88
bool JSSVGLengthListPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
89
{
 
90
    return getStaticFunctionDescriptor<JSObject>(exec, &JSSVGLengthListPrototypeTable, this, propertyName, descriptor);
 
91
}
 
92
 
92
93
const ClassInfo JSSVGLengthList::s_info = { "SVGLengthList", 0, &JSSVGLengthListTable, 0 };
93
94
 
94
 
JSSVGLengthList::JSSVGLengthList(PassRefPtr<Structure> structure, PassRefPtr<SVGLengthList> impl, SVGElement* context)
95
 
    : DOMObject(structure)
96
 
    , m_context(context)
 
95
JSSVGLengthList::JSSVGLengthList(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGLengthList> impl, SVGElement* context)
 
96
    : DOMObjectWithSVGContext(structure, globalObject, context)
97
97
    , m_impl(impl)
98
98
{
99
99
}
100
100
 
101
101
JSSVGLengthList::~JSSVGLengthList()
102
102
{
103
 
    forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get());
104
 
 
 
103
    forgetDOMObject(*Heap::heap(this)->globalData(), impl());
105
104
}
106
105
 
107
106
JSObject* JSSVGLengthList::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
114
113
    return getStaticValueSlot<JSSVGLengthList, Base>(exec, &JSSVGLengthListTable, this, propertyName, slot);
115
114
}
116
115
 
117
 
JSValuePtr jsSVGLengthListNumberOfItems(ExecState* exec, const Identifier&, const PropertySlot& slot)
118
 
{
119
 
    SVGLengthList* imp = static_cast<SVGLengthList*>(static_cast<JSSVGLengthList*>(asObject(slot.slotBase()))->impl());
 
116
bool JSSVGLengthList::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
117
{
 
118
    return getStaticValueDescriptor<JSSVGLengthList, Base>(exec, &JSSVGLengthListTable, this, propertyName, descriptor);
 
119
}
 
120
 
 
121
JSValue jsSVGLengthListNumberOfItems(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
122
{
 
123
    JSSVGLengthList* castedThis = static_cast<JSSVGLengthList*>(asObject(slot.slotBase()));
 
124
    UNUSED_PARAM(exec);
 
125
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThis->impl());
120
126
    return jsNumber(exec, imp->numberOfItems());
121
127
}
122
128
 
123
 
JSValuePtr jsSVGLengthListPrototypeFunctionClear(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
 
129
JSValue JSC_HOST_CALL jsSVGLengthListPrototypeFunctionClear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
124
130
{
125
 
    if (!thisValue->isObject(&JSSVGLengthList::s_info))
 
131
    UNUSED_PARAM(args);
 
132
    if (!thisValue.inherits(&JSSVGLengthList::s_info))
126
133
        return throwError(exec, TypeError);
127
134
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
128
135
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
133
140
    return jsUndefined();
134
141
}
135
142
 
136
 
JSValuePtr jsSVGLengthListPrototypeFunctionInitialize(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
137
 
{
138
 
    if (!thisValue->isObject(&JSSVGLengthList::s_info))
139
 
        return throwError(exec, TypeError);
140
 
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
141
 
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
142
 
    ExceptionCode ec = 0;
143
 
    SVGLength item = toSVGLength(args.at(exec, 0));
144
 
 
145
 
 
146
 
    JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->initialize(item, ec)).get(), castedThisObj->context());
147
 
    setDOMException(exec, ec);
148
 
    return result;
149
 
}
150
 
 
151
 
JSValuePtr jsSVGLengthListPrototypeFunctionGetItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
152
 
{
153
 
    if (!thisValue->isObject(&JSSVGLengthList::s_info))
154
 
        return throwError(exec, TypeError);
155
 
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
156
 
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
157
 
    ExceptionCode ec = 0;
158
 
    unsigned index = args.at(exec, 0)->toInt32(exec);
159
 
 
160
 
 
161
 
    JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->getItem(index, ec)).get(), castedThisObj->context());
162
 
    setDOMException(exec, ec);
163
 
    return result;
164
 
}
165
 
 
166
 
JSValuePtr jsSVGLengthListPrototypeFunctionInsertItemBefore(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
167
 
{
168
 
    if (!thisValue->isObject(&JSSVGLengthList::s_info))
169
 
        return throwError(exec, TypeError);
170
 
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
171
 
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
172
 
    ExceptionCode ec = 0;
173
 
    SVGLength item = toSVGLength(args.at(exec, 0));
174
 
    unsigned index = args.at(exec, 1)->toInt32(exec);
175
 
 
176
 
 
177
 
    JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->insertItemBefore(item, index, ec)).get(), castedThisObj->context());
178
 
    setDOMException(exec, ec);
179
 
    return result;
180
 
}
181
 
 
182
 
JSValuePtr jsSVGLengthListPrototypeFunctionReplaceItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
183
 
{
184
 
    if (!thisValue->isObject(&JSSVGLengthList::s_info))
185
 
        return throwError(exec, TypeError);
186
 
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
187
 
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
188
 
    ExceptionCode ec = 0;
189
 
    SVGLength item = toSVGLength(args.at(exec, 0));
190
 
    unsigned index = args.at(exec, 1)->toInt32(exec);
191
 
 
192
 
 
193
 
    JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->replaceItem(item, index, ec)).get(), castedThisObj->context());
194
 
    setDOMException(exec, ec);
195
 
    return result;
196
 
}
197
 
 
198
 
JSValuePtr jsSVGLengthListPrototypeFunctionRemoveItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
199
 
{
200
 
    if (!thisValue->isObject(&JSSVGLengthList::s_info))
201
 
        return throwError(exec, TypeError);
202
 
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
203
 
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
204
 
    ExceptionCode ec = 0;
205
 
    unsigned index = args.at(exec, 0)->toInt32(exec);
206
 
 
207
 
 
208
 
    JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->removeItem(index, ec)).get(), castedThisObj->context());
209
 
    setDOMException(exec, ec);
210
 
    return result;
211
 
}
212
 
 
213
 
JSValuePtr jsSVGLengthListPrototypeFunctionAppendItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
214
 
{
215
 
    if (!thisValue->isObject(&JSSVGLengthList::s_info))
216
 
        return throwError(exec, TypeError);
217
 
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
218
 
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
219
 
    ExceptionCode ec = 0;
220
 
    SVGLength item = toSVGLength(args.at(exec, 0));
221
 
 
222
 
 
223
 
    JSC::JSValuePtr result = toJS(exec, JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->appendItem(item, ec)).get(), castedThisObj->context());
224
 
    setDOMException(exec, ec);
225
 
    return result;
226
 
}
227
 
 
228
 
JSC::JSValuePtr toJS(JSC::ExecState* exec, SVGLengthList* object, SVGElement* context)
229
 
{
230
 
    return getDOMObjectWrapper<JSSVGLengthList>(exec, object, context);
231
 
}
232
 
SVGLengthList* toSVGLengthList(JSC::JSValuePtr value)
233
 
{
234
 
    return value->isObject(&JSSVGLengthList::s_info) ? static_cast<JSSVGLengthList*>(asObject(value))->impl() : 0;
 
143
JSValue JSC_HOST_CALL jsSVGLengthListPrototypeFunctionInitialize(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
144
{
 
145
    UNUSED_PARAM(args);
 
146
    if (!thisValue.inherits(&JSSVGLengthList::s_info))
 
147
        return throwError(exec, TypeError);
 
148
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
 
149
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
 
150
    ExceptionCode ec = 0;
 
151
    SVGLength item = toSVGLength(args.at(0));
 
152
 
 
153
 
 
154
    JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->initialize(item, ec)).get(), castedThisObj->context());
 
155
    setDOMException(exec, ec);
 
156
    return result;
 
157
}
 
158
 
 
159
JSValue JSC_HOST_CALL jsSVGLengthListPrototypeFunctionGetItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
160
{
 
161
    UNUSED_PARAM(args);
 
162
    if (!thisValue.inherits(&JSSVGLengthList::s_info))
 
163
        return throwError(exec, TypeError);
 
164
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
 
165
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
 
166
    ExceptionCode ec = 0;
 
167
    unsigned index = args.at(0).toInt32(exec);
 
168
 
 
169
 
 
170
    JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->getItem(index, ec)).get(), castedThisObj->context());
 
171
    setDOMException(exec, ec);
 
172
    return result;
 
173
}
 
174
 
 
175
JSValue JSC_HOST_CALL jsSVGLengthListPrototypeFunctionInsertItemBefore(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
176
{
 
177
    UNUSED_PARAM(args);
 
178
    if (!thisValue.inherits(&JSSVGLengthList::s_info))
 
179
        return throwError(exec, TypeError);
 
180
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
 
181
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
 
182
    ExceptionCode ec = 0;
 
183
    SVGLength item = toSVGLength(args.at(0));
 
184
    unsigned index = args.at(1).toInt32(exec);
 
185
 
 
186
 
 
187
    JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->insertItemBefore(item, index, ec)).get(), castedThisObj->context());
 
188
    setDOMException(exec, ec);
 
189
    return result;
 
190
}
 
191
 
 
192
JSValue JSC_HOST_CALL jsSVGLengthListPrototypeFunctionReplaceItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
193
{
 
194
    UNUSED_PARAM(args);
 
195
    if (!thisValue.inherits(&JSSVGLengthList::s_info))
 
196
        return throwError(exec, TypeError);
 
197
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
 
198
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
 
199
    ExceptionCode ec = 0;
 
200
    SVGLength item = toSVGLength(args.at(0));
 
201
    unsigned index = args.at(1).toInt32(exec);
 
202
 
 
203
 
 
204
    JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->replaceItem(item, index, ec)).get(), castedThisObj->context());
 
205
    setDOMException(exec, ec);
 
206
    return result;
 
207
}
 
208
 
 
209
JSValue JSC_HOST_CALL jsSVGLengthListPrototypeFunctionRemoveItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
210
{
 
211
    UNUSED_PARAM(args);
 
212
    if (!thisValue.inherits(&JSSVGLengthList::s_info))
 
213
        return throwError(exec, TypeError);
 
214
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
 
215
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
 
216
    ExceptionCode ec = 0;
 
217
    unsigned index = args.at(0).toInt32(exec);
 
218
 
 
219
 
 
220
    JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->removeItem(index, ec)).get(), castedThisObj->context());
 
221
    setDOMException(exec, ec);
 
222
    return result;
 
223
}
 
224
 
 
225
JSValue JSC_HOST_CALL jsSVGLengthListPrototypeFunctionAppendItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
226
{
 
227
    UNUSED_PARAM(args);
 
228
    if (!thisValue.inherits(&JSSVGLengthList::s_info))
 
229
        return throwError(exec, TypeError);
 
230
    JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
 
231
    SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
 
232
    ExceptionCode ec = 0;
 
233
    SVGLength item = toSVGLength(args.at(0));
 
234
 
 
235
 
 
236
    JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->appendItem(item, ec)).get(), castedThisObj->context());
 
237
    setDOMException(exec, ec);
 
238
    return result;
 
239
}
 
240
 
 
241
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGLengthList* object, SVGElement* context)
 
242
{
 
243
    return getDOMObjectWrapper<JSSVGLengthList>(exec, globalObject, object, context);
 
244
}
 
245
SVGLengthList* toSVGLengthList(JSC::JSValue value)
 
246
{
 
247
    return value.inherits(&JSSVGLengthList::s_info) ? static_cast<JSSVGLengthList*>(asObject(value))->impl() : 0;
235
248
}
236
249
 
237
250
}