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

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/generated/JSCanvasUnsignedByteArray.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:
 
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(3D_CANVAS)
 
24
 
 
25
#include "JSCanvasUnsignedByteArray.h"
 
26
 
 
27
#include "CanvasUnsignedByteArray.h"
 
28
#include <runtime/PropertyNameArray.h>
 
29
#include <wtf/GetPtr.h>
 
30
 
 
31
using namespace JSC;
 
32
 
 
33
namespace WebCore {
 
34
 
 
35
ASSERT_CLASS_FITS_IN_CELL(JSCanvasUnsignedByteArray);
 
36
 
 
37
/* Hash table for prototype */
 
38
 
 
39
static const HashTableValue JSCanvasUnsignedByteArrayPrototypeTableValues[1] =
 
40
{
 
41
    { 0, 0, 0, 0 }
 
42
};
 
43
 
 
44
static JSC_CONST_HASHTABLE HashTable JSCanvasUnsignedByteArrayPrototypeTable =
 
45
#if ENABLE(PERFECT_HASH_SIZE)
 
46
    { 0, JSCanvasUnsignedByteArrayPrototypeTableValues, 0 };
 
47
#else
 
48
    { 1, 0, JSCanvasUnsignedByteArrayPrototypeTableValues, 0 };
 
49
#endif
 
50
 
 
51
const ClassInfo JSCanvasUnsignedByteArrayPrototype::s_info = { "CanvasUnsignedByteArrayPrototype", 0, &JSCanvasUnsignedByteArrayPrototypeTable, 0 };
 
52
 
 
53
JSObject* JSCanvasUnsignedByteArrayPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
 
54
{
 
55
    return getDOMPrototype<JSCanvasUnsignedByteArray>(exec, globalObject);
 
56
}
 
57
 
 
58
const ClassInfo JSCanvasUnsignedByteArray::s_info = { "CanvasUnsignedByteArray", &JSCanvasArray::s_info, 0, 0 };
 
59
 
 
60
JSCanvasUnsignedByteArray::JSCanvasUnsignedByteArray(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<CanvasUnsignedByteArray> impl)
 
61
    : JSCanvasArray(structure, globalObject, impl)
 
62
{
 
63
}
 
64
 
 
65
JSObject* JSCanvasUnsignedByteArray::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
 
66
{
 
67
    return new (exec) JSCanvasUnsignedByteArrayPrototype(JSCanvasUnsignedByteArrayPrototype::createStructure(JSCanvasArrayPrototype::self(exec, globalObject)));
 
68
}
 
69
 
 
70
bool JSCanvasUnsignedByteArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 
71
{
 
72
    bool ok;
 
73
    unsigned index = propertyName.toUInt32(&ok, false);
 
74
    if (ok && index < static_cast<CanvasUnsignedByteArray*>(impl())->length()) {
 
75
        slot.setValue(getByIndex(exec, index));
 
76
        return true;
 
77
    }
 
78
    return Base::getOwnPropertySlot(exec, propertyName, slot);
 
79
}
 
80
 
 
81
bool JSCanvasUnsignedByteArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
82
{
 
83
    bool ok;
 
84
    unsigned index = propertyName.toUInt32(&ok, false);
 
85
    if (ok && index < static_cast<CanvasUnsignedByteArray*>(impl())->length()) {
 
86
        descriptor.setDescriptor(getByIndex(exec, index), DontDelete);
 
87
        return true;
 
88
    }
 
89
    return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
 
90
}
 
91
 
 
92
bool JSCanvasUnsignedByteArray::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
 
93
{
 
94
    if (propertyName < static_cast<CanvasUnsignedByteArray*>(impl())->length()) {
 
95
        slot.setValue(getByIndex(exec, propertyName));
 
96
        return true;
 
97
    }
 
98
    return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot);
 
99
}
 
100
 
 
101
void JSCanvasUnsignedByteArray::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 
102
{
 
103
    bool ok;
 
104
    unsigned index = propertyName.toUInt32(&ok, false);
 
105
    if (ok) {
 
106
        indexSetter(exec, index, value);
 
107
        return;
 
108
    }
 
109
    Base::put(exec, propertyName, value, slot);
 
110
}
 
111
 
 
112
void JSCanvasUnsignedByteArray::put(ExecState* exec, unsigned propertyName, JSValue value)
 
113
{
 
114
    indexSetter(exec, propertyName, value);
 
115
    return;
 
116
}
 
117
 
 
118
void JSCanvasUnsignedByteArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
 
119
{
 
120
    for (unsigned i = 0; i < static_cast<CanvasUnsignedByteArray*>(impl())->length(); ++i)
 
121
        propertyNames.add(Identifier::from(exec, i));
 
122
     Base::getOwnPropertyNames(exec, propertyNames);
 
123
}
 
124
 
 
125
 
 
126
JSValue JSCanvasUnsignedByteArray::getByIndex(ExecState* exec, unsigned index)
 
127
{
 
128
    return jsNumber(exec, static_cast<CanvasUnsignedByteArray*>(impl())->item(index));
 
129
}
 
130
CanvasUnsignedByteArray* toCanvasUnsignedByteArray(JSC::JSValue value)
 
131
{
 
132
    return value.inherits(&JSCanvasUnsignedByteArray::s_info) ? static_cast<JSCanvasUnsignedByteArray*>(asObject(value))->impl() : 0;
 
133
}
 
134
 
 
135
}
 
136
 
 
137
#endif // ENABLE(3D_CANVAS)