|
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 #include "JSImageData.h" |
|
23 |
|
24 #include "ImageData.h" |
|
25 #include <runtime/JSNumberCell.h> |
|
26 #include <wtf/GetPtr.h> |
|
27 |
|
28 using namespace JSC; |
|
29 |
|
30 namespace WebCore { |
|
31 |
|
32 ASSERT_CLASS_FITS_IN_CELL(JSImageData); |
|
33 |
|
34 /* Hash table */ |
|
35 #if ENABLE(JIT) |
|
36 #define THUNK_GENERATOR(generator) , generator |
|
37 #else |
|
38 #define THUNK_GENERATOR(generator) |
|
39 #endif |
|
40 |
|
41 static const HashTableValue JSImageDataTableValues[4] = |
|
42 { |
|
43 { "width", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsImageDataWidth), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
44 { "height", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsImageDataHeight), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
45 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsImageDataConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
46 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
47 }; |
|
48 |
|
49 #undef THUNK_GENERATOR |
|
50 static JSC_CONST_HASHTABLE HashTable JSImageDataTable = { 9, 7, JSImageDataTableValues, 0 }; |
|
51 /* Hash table for constructor */ |
|
52 #if ENABLE(JIT) |
|
53 #define THUNK_GENERATOR(generator) , generator |
|
54 #else |
|
55 #define THUNK_GENERATOR(generator) |
|
56 #endif |
|
57 |
|
58 static const HashTableValue JSImageDataConstructorTableValues[1] = |
|
59 { |
|
60 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
61 }; |
|
62 |
|
63 #undef THUNK_GENERATOR |
|
64 static JSC_CONST_HASHTABLE HashTable JSImageDataConstructorTable = { 1, 0, JSImageDataConstructorTableValues, 0 }; |
|
65 class JSImageDataConstructor : public DOMConstructorObject { |
|
66 public: |
|
67 JSImageDataConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
68 |
|
69 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
70 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
71 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
72 static const JSC::ClassInfo s_info; |
|
73 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
74 { |
|
75 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
76 } |
|
77 protected: |
|
78 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
79 }; |
|
80 |
|
81 const ClassInfo JSImageDataConstructor::s_info = { "ImageDataConstructor", 0, &JSImageDataConstructorTable, 0 }; |
|
82 |
|
83 JSImageDataConstructor::JSImageDataConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
84 : DOMConstructorObject(JSImageDataConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
85 { |
|
86 putDirect(exec->propertyNames().prototype, JSImageDataPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
87 } |
|
88 |
|
89 bool JSImageDataConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
90 { |
|
91 return getStaticValueSlot<JSImageDataConstructor, DOMObject>(exec, &JSImageDataConstructorTable, this, propertyName, slot); |
|
92 } |
|
93 |
|
94 bool JSImageDataConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
95 { |
|
96 return getStaticValueDescriptor<JSImageDataConstructor, DOMObject>(exec, &JSImageDataConstructorTable, this, propertyName, descriptor); |
|
97 } |
|
98 |
|
99 /* Hash table for prototype */ |
|
100 #if ENABLE(JIT) |
|
101 #define THUNK_GENERATOR(generator) , generator |
|
102 #else |
|
103 #define THUNK_GENERATOR(generator) |
|
104 #endif |
|
105 |
|
106 static const HashTableValue JSImageDataPrototypeTableValues[1] = |
|
107 { |
|
108 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
109 }; |
|
110 |
|
111 #undef THUNK_GENERATOR |
|
112 static JSC_CONST_HASHTABLE HashTable JSImageDataPrototypeTable = { 1, 0, JSImageDataPrototypeTableValues, 0 }; |
|
113 const ClassInfo JSImageDataPrototype::s_info = { "ImageDataPrototype", 0, &JSImageDataPrototypeTable, 0 }; |
|
114 |
|
115 JSObject* JSImageDataPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
116 { |
|
117 return getDOMPrototype<JSImageData>(exec, globalObject); |
|
118 } |
|
119 |
|
120 const ClassInfo JSImageData::s_info = { "ImageData", 0, &JSImageDataTable, 0 }; |
|
121 |
|
122 JSImageData::JSImageData(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<ImageData> impl) |
|
123 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
124 , m_impl(impl) |
|
125 { |
|
126 } |
|
127 |
|
128 JSImageData::~JSImageData() |
|
129 { |
|
130 forgetDOMObject(this, impl()); |
|
131 } |
|
132 |
|
133 JSObject* JSImageData::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
134 { |
|
135 return new (exec) JSImageDataPrototype(globalObject, JSImageDataPrototype::createStructure(globalObject->objectPrototype())); |
|
136 } |
|
137 |
|
138 bool JSImageData::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
139 { |
|
140 return getStaticValueSlot<JSImageData, Base>(exec, &JSImageDataTable, this, propertyName, slot); |
|
141 } |
|
142 |
|
143 bool JSImageData::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
144 { |
|
145 return getStaticValueDescriptor<JSImageData, Base>(exec, &JSImageDataTable, this, propertyName, descriptor); |
|
146 } |
|
147 |
|
148 JSValue jsImageDataWidth(ExecState* exec, JSValue slotBase, const Identifier&) |
|
149 { |
|
150 JSImageData* castedThis = static_cast<JSImageData*>(asObject(slotBase)); |
|
151 UNUSED_PARAM(exec); |
|
152 ImageData* imp = static_cast<ImageData*>(castedThis->impl()); |
|
153 JSValue result = jsNumber(exec, imp->width()); |
|
154 return result; |
|
155 } |
|
156 |
|
157 JSValue jsImageDataHeight(ExecState* exec, JSValue slotBase, const Identifier&) |
|
158 { |
|
159 JSImageData* castedThis = static_cast<JSImageData*>(asObject(slotBase)); |
|
160 UNUSED_PARAM(exec); |
|
161 ImageData* imp = static_cast<ImageData*>(castedThis->impl()); |
|
162 JSValue result = jsNumber(exec, imp->height()); |
|
163 return result; |
|
164 } |
|
165 |
|
166 JSValue jsImageDataConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
167 { |
|
168 JSImageData* domObject = static_cast<JSImageData*>(asObject(slotBase)); |
|
169 return JSImageData::getConstructor(exec, domObject->globalObject()); |
|
170 } |
|
171 JSValue JSImageData::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
172 { |
|
173 return getDOMConstructor<JSImageDataConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
174 } |
|
175 |
|
176 ImageData* toImageData(JSC::JSValue value) |
|
177 { |
|
178 return value.inherits(&JSImageData::s_info) ? static_cast<JSImageData*>(asObject(value))->impl() : 0; |
|
179 } |
|
180 |
|
181 } |