2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
23 #if ENABLE(TOUCH_EVENTS)
27 #include "EventTarget.h"
28 #include "JSEventTarget.h"
30 #include <wtf/GetPtr.h>
36 ASSERT_CLASS_FITS_IN_CELL(JSTouch);
40 #define THUNK_GENERATOR(generator) , generator
42 #define THUNK_GENERATOR(generator)
45 #define INTRINSIC(intrinsic) , intrinsic
47 #define INTRINSIC(intrinsic)
50 static const HashTableValue JSTouchTableValues[] =
52 { "clientX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchClientX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { "clientY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchClientY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54 { "screenX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchScreenX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55 { "screenY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchScreenY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56 { "pageX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchPageX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57 { "pageY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchPageY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58 { "target", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchTarget), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59 { "identifier", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchIdentifier), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60 { "webkitRadiusX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchWebkitRadiusX), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61 { "webkitRadiusY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchWebkitRadiusY), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
62 { "webkitRotationAngle", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchWebkitRotationAngle), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
63 { "webkitForce", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchWebkitForce), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
64 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
65 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
68 #undef THUNK_GENERATOR
69 static const HashTable JSTouchTable = { 33, 31, JSTouchTableValues, 0 };
70 /* Hash table for constructor */
72 #define THUNK_GENERATOR(generator) , generator
74 #define THUNK_GENERATOR(generator)
77 #define INTRINSIC(intrinsic) , intrinsic
79 #define INTRINSIC(intrinsic)
82 static const HashTableValue JSTouchConstructorTableValues[] =
84 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
87 #undef THUNK_GENERATOR
88 static const HashTable JSTouchConstructorTable = { 1, 0, JSTouchConstructorTableValues, 0 };
89 const ClassInfo JSTouchConstructor::s_info = { "TouchConstructor", &DOMConstructorObject::s_info, &JSTouchConstructorTable, 0, CREATE_METHOD_TABLE(JSTouchConstructor) };
91 JSTouchConstructor::JSTouchConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
92 : DOMConstructorObject(structure, globalObject)
96 void JSTouchConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
98 Base::finishCreation(exec->globalData());
99 ASSERT(inherits(&s_info));
100 putDirect(exec->globalData(), exec->propertyNames().prototype, JSTouchPrototype::self(exec, globalObject), DontDelete | ReadOnly);
103 bool JSTouchConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
105 return getStaticValueSlot<JSTouchConstructor, JSDOMWrapper>(exec, &JSTouchConstructorTable, static_cast<JSTouchConstructor*>(cell), propertyName, slot);
108 bool JSTouchConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
110 return getStaticValueDescriptor<JSTouchConstructor, JSDOMWrapper>(exec, &JSTouchConstructorTable, static_cast<JSTouchConstructor*>(object), propertyName, descriptor);
113 /* Hash table for prototype */
115 #define THUNK_GENERATOR(generator) , generator
117 #define THUNK_GENERATOR(generator)
120 #define INTRINSIC(intrinsic) , intrinsic
122 #define INTRINSIC(intrinsic)
125 static const HashTableValue JSTouchPrototypeTableValues[] =
127 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
130 #undef THUNK_GENERATOR
131 static const HashTable JSTouchPrototypeTable = { 1, 0, JSTouchPrototypeTableValues, 0 };
132 const ClassInfo JSTouchPrototype::s_info = { "TouchPrototype", &JSC::JSNonFinalObject::s_info, &JSTouchPrototypeTable, 0, CREATE_METHOD_TABLE(JSTouchPrototype) };
134 JSObject* JSTouchPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
136 return getDOMPrototype<JSTouch>(exec, globalObject);
139 const ClassInfo JSTouch::s_info = { "Touch", &JSDOMWrapper::s_info, &JSTouchTable, 0 , CREATE_METHOD_TABLE(JSTouch) };
141 JSTouch::JSTouch(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Touch> impl)
142 : JSDOMWrapper(structure, globalObject)
143 , m_impl(impl.leakRef())
147 void JSTouch::finishCreation(JSGlobalData& globalData)
149 Base::finishCreation(globalData);
150 ASSERT(inherits(&s_info));
153 JSObject* JSTouch::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
155 return JSTouchPrototype::create(exec->globalData(), globalObject, JSTouchPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
158 bool JSTouch::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
160 JSTouch* thisObject = jsCast<JSTouch*>(cell);
161 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
162 return getStaticValueSlot<JSTouch, Base>(exec, &JSTouchTable, thisObject, propertyName, slot);
165 bool JSTouch::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
167 JSTouch* thisObject = jsCast<JSTouch*>(object);
168 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
169 return getStaticValueDescriptor<JSTouch, Base>(exec, &JSTouchTable, thisObject, propertyName, descriptor);
172 JSValue jsTouchClientX(ExecState* exec, JSValue slotBase, const Identifier&)
174 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
176 Touch* imp = static_cast<Touch*>(castedThis->impl());
177 JSValue result = jsNumber(imp->clientX());
182 JSValue jsTouchClientY(ExecState* exec, JSValue slotBase, const Identifier&)
184 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
186 Touch* imp = static_cast<Touch*>(castedThis->impl());
187 JSValue result = jsNumber(imp->clientY());
192 JSValue jsTouchScreenX(ExecState* exec, JSValue slotBase, const Identifier&)
194 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
196 Touch* imp = static_cast<Touch*>(castedThis->impl());
197 JSValue result = jsNumber(imp->screenX());
202 JSValue jsTouchScreenY(ExecState* exec, JSValue slotBase, const Identifier&)
204 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
206 Touch* imp = static_cast<Touch*>(castedThis->impl());
207 JSValue result = jsNumber(imp->screenY());
212 JSValue jsTouchPageX(ExecState* exec, JSValue slotBase, const Identifier&)
214 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
216 Touch* imp = static_cast<Touch*>(castedThis->impl());
217 JSValue result = jsNumber(imp->pageX());
222 JSValue jsTouchPageY(ExecState* exec, JSValue slotBase, const Identifier&)
224 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
226 Touch* imp = static_cast<Touch*>(castedThis->impl());
227 JSValue result = jsNumber(imp->pageY());
232 JSValue jsTouchTarget(ExecState* exec, JSValue slotBase, const Identifier&)
234 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
236 Touch* imp = static_cast<Touch*>(castedThis->impl());
237 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->target()));
242 JSValue jsTouchIdentifier(ExecState* exec, JSValue slotBase, const Identifier&)
244 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
246 Touch* imp = static_cast<Touch*>(castedThis->impl());
247 JSValue result = jsNumber(imp->identifier());
252 JSValue jsTouchWebkitRadiusX(ExecState* exec, JSValue slotBase, const Identifier&)
254 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
256 Touch* imp = static_cast<Touch*>(castedThis->impl());
257 JSValue result = jsNumber(imp->webkitRadiusX());
262 JSValue jsTouchWebkitRadiusY(ExecState* exec, JSValue slotBase, const Identifier&)
264 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
266 Touch* imp = static_cast<Touch*>(castedThis->impl());
267 JSValue result = jsNumber(imp->webkitRadiusY());
272 JSValue jsTouchWebkitRotationAngle(ExecState* exec, JSValue slotBase, const Identifier&)
274 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
276 Touch* imp = static_cast<Touch*>(castedThis->impl());
277 JSValue result = jsNumber(imp->webkitRotationAngle());
282 JSValue jsTouchWebkitForce(ExecState* exec, JSValue slotBase, const Identifier&)
284 JSTouch* castedThis = static_cast<JSTouch*>(asObject(slotBase));
286 Touch* imp = static_cast<Touch*>(castedThis->impl());
287 JSValue result = jsNumber(imp->webkitForce());
292 JSValue jsTouchConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
294 JSTouch* domObject = static_cast<JSTouch*>(asObject(slotBase));
295 return JSTouch::getConstructor(exec, domObject->globalObject());
298 JSValue JSTouch::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
300 return getDOMConstructor<JSTouchConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
303 static inline bool isObservable(JSTouch* jsTouch)
305 if (jsTouch->hasCustomProperties())
310 bool JSTouchOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
312 JSTouch* jsTouch = static_cast<JSTouch*>(handle.get().asCell());
313 if (!isObservable(jsTouch))
315 UNUSED_PARAM(visitor);
319 void JSTouchOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
321 JSTouch* jsTouch = static_cast<JSTouch*>(handle.get().asCell());
322 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
323 uncacheWrapper(world, jsTouch->impl(), jsTouch);
324 jsTouch->releaseImpl();
327 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Touch* impl)
329 return wrap<JSTouch>(exec, globalObject, impl);
332 Touch* toTouch(JSC::JSValue value)
334 return value.inherits(&JSTouch::s_info) ? static_cast<JSTouch*>(asObject(value))->impl() : 0;
339 #endif // ENABLE(TOUCH_EVENTS)