blob: 3d478d468d0b7c1102200bdcdabcbf1ebfe03dc4 [file] [log] [blame]
/*
This file is part of the WebKit open source project.
This file has been generated by generate-bindings.pl. DO NOT MODIFY!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "JSSVGZoomEvent.h"
#include "JSDOMBinding.h"
#include "JSDOMConstructor.h"
#include "JSSVGPoint.h"
#include "JSSVGRect.h"
#include <wtf/GetPtr.h>
using namespace JSC;
namespace WebCore {
// Attributes
JSC::EncodedJSValue jsSVGZoomEventZoomRectScreen(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsSVGZoomEventPreviousScale(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsSVGZoomEventPreviousTranslate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsSVGZoomEventNewScale(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsSVGZoomEventNewTranslate(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsSVGZoomEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
bool setJSSVGZoomEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
class JSSVGZoomEventPrototype : public JSC::JSNonFinalObject {
public:
typedef JSC::JSNonFinalObject Base;
static JSSVGZoomEventPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
JSSVGZoomEventPrototype* ptr = new (NotNull, JSC::allocateCell<JSSVGZoomEventPrototype>(vm.heap)) JSSVGZoomEventPrototype(vm, globalObject, structure);
ptr->finishCreation(vm);
return ptr;
}
DECLARE_INFO;
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
}
private:
JSSVGZoomEventPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
: JSC::JSNonFinalObject(vm, structure)
{
}
void finishCreation(JSC::VM&);
};
typedef JSDOMConstructorNotConstructable<JSSVGZoomEvent> JSSVGZoomEventConstructor;
template<> JSValue JSSVGZoomEventConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
{
return JSUIEvent::getConstructor(vm, &globalObject);
}
template<> void JSSVGZoomEventConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
{
putDirect(vm, vm.propertyNames->prototype, JSSVGZoomEvent::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("SVGZoomEvent"))), ReadOnly | DontEnum);
putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
}
template<> const ClassInfo JSSVGZoomEventConstructor::s_info = { "SVGZoomEvent", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSVGZoomEventConstructor) };
/* Hash table for prototype */
static const HashTableValue JSSVGZoomEventPrototypeTableValues[] =
{
{ "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSSVGZoomEventConstructor) } },
{ "zoomRectScreen", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventZoomRectScreen), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "previousScale", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventPreviousScale), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "previousTranslate", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventPreviousTranslate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "newScale", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventNewScale), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "newTranslate", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGZoomEventNewTranslate), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
};
const ClassInfo JSSVGZoomEventPrototype::s_info = { "SVGZoomEventPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSVGZoomEventPrototype) };
void JSSVGZoomEventPrototype::finishCreation(VM& vm)
{
Base::finishCreation(vm);
reifyStaticProperties(vm, JSSVGZoomEventPrototypeTableValues, *this);
}
const ClassInfo JSSVGZoomEvent::s_info = { "SVGZoomEvent", &Base::s_info, 0, CREATE_METHOD_TABLE(JSSVGZoomEvent) };
JSSVGZoomEvent::JSSVGZoomEvent(Structure* structure, JSDOMGlobalObject& globalObject, Ref<SVGZoomEvent>&& impl)
: JSUIEvent(structure, globalObject, WTFMove(impl))
{
}
JSObject* JSSVGZoomEvent::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
return JSSVGZoomEventPrototype::create(vm, globalObject, JSSVGZoomEventPrototype::createStructure(vm, globalObject, JSUIEvent::prototype(vm, globalObject)));
}
JSObject* JSSVGZoomEvent::prototype(VM& vm, JSGlobalObject* globalObject)
{
return getDOMPrototype<JSSVGZoomEvent>(vm, globalObject);
}
EncodedJSValue jsSVGZoomEventZoomRectScreen(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
UNUSED_PARAM(thisValue);
JSValue decodedThisValue = JSValue::decode(thisValue);
auto* castedThis = jsDynamicCast<JSSVGZoomEvent*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "SVGZoomEvent", "zoomRectScreen");
}
auto& impl = castedThis->wrapped();
JSValue result = toJS(state, castedThis->globalObject(), SVGPropertyTearOff<FloatRect>::create(impl.zoomRectScreen()));
return JSValue::encode(result);
}
EncodedJSValue jsSVGZoomEventPreviousScale(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
UNUSED_PARAM(thisValue);
JSValue decodedThisValue = JSValue::decode(thisValue);
auto* castedThis = jsDynamicCast<JSSVGZoomEvent*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "SVGZoomEvent", "previousScale");
}
auto& impl = castedThis->wrapped();
JSValue result = jsNumber(impl.previousScale());
return JSValue::encode(result);
}
EncodedJSValue jsSVGZoomEventPreviousTranslate(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
UNUSED_PARAM(thisValue);
JSValue decodedThisValue = JSValue::decode(thisValue);
auto* castedThis = jsDynamicCast<JSSVGZoomEvent*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "SVGZoomEvent", "previousTranslate");
}
auto& impl = castedThis->wrapped();
JSValue result = toJS(state, castedThis->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.previousTranslate()));
return JSValue::encode(result);
}
EncodedJSValue jsSVGZoomEventNewScale(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
UNUSED_PARAM(thisValue);
JSValue decodedThisValue = JSValue::decode(thisValue);
auto* castedThis = jsDynamicCast<JSSVGZoomEvent*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "SVGZoomEvent", "newScale");
}
auto& impl = castedThis->wrapped();
JSValue result = jsNumber(impl.newScale());
return JSValue::encode(result);
}
EncodedJSValue jsSVGZoomEventNewTranslate(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
UNUSED_PARAM(thisValue);
JSValue decodedThisValue = JSValue::decode(thisValue);
auto* castedThis = jsDynamicCast<JSSVGZoomEvent*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "SVGZoomEvent", "newTranslate");
}
auto& impl = castedThis->wrapped();
JSValue result = toJS(state, castedThis->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.newTranslate()));
return JSValue::encode(result);
}
EncodedJSValue jsSVGZoomEventConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
JSSVGZoomEventPrototype* domObject = jsDynamicCast<JSSVGZoomEventPrototype*>(JSValue::decode(thisValue));
if (UNLIKELY(!domObject))
return throwVMTypeError(state, throwScope);
return JSValue::encode(JSSVGZoomEvent::getConstructor(state->vm(), domObject->globalObject()));
}
bool setJSSVGZoomEventConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
JSValue value = JSValue::decode(encodedValue);
JSSVGZoomEventPrototype* domObject = jsDynamicCast<JSSVGZoomEventPrototype*>(JSValue::decode(thisValue));
if (UNLIKELY(!domObject)) {
throwVMTypeError(state, throwScope);
return false;
}
// Shadowing a built-in constructor
return domObject->putDirect(state->vm(), state->propertyNames().constructor, value);
}
JSValue JSSVGZoomEvent::getConstructor(VM& vm, const JSGlobalObject* globalObject)
{
return getDOMConstructor<JSSVGZoomEventConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
}
}