Copy as Markdown
Other Tools
/* THIS FILE IS AUTOGENERATED FROM DeviceMotionEvent.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_DEVICEMOTIONEVENTBINDING_H_
#define DOM_DEVICEMOTIONEVENTBINDING_H_
#include "EventBinding.h"
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
namespace mozilla {
namespace dom {
class DeviceAcceleration;
struct DeviceAccelerationInit;
struct DeviceAccelerationInitAtoms;
class DeviceMotionEvent;
struct DeviceMotionEventInitAtoms;
class DeviceRotationRate;
struct DeviceRotationRateInit;
struct DeviceRotationRateInitAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
struct DeviceAccelerationInit : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Nullable<double> mX;
MOZ_INIT_OUTSIDE_CTOR Nullable<double> mY;
MOZ_INIT_OUTSIDE_CTOR Nullable<double> mZ;
DeviceAccelerationInit();
explicit inline DeviceAccelerationInit(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
DeviceAccelerationInit(DeviceAccelerationInit&& aOther) = default;
explicit inline DeviceAccelerationInit(const DeviceAccelerationInit& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
DeviceAccelerationInit&
operator=(const DeviceAccelerationInit& aOther);
private:
static bool
InitIds(JSContext* cx, DeviceAccelerationInitAtoms* atomsCache);
};
namespace binding_detail {
struct FastDeviceAccelerationInit : public DeviceAccelerationInit
{
inline FastDeviceAccelerationInit()
: DeviceAccelerationInit(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct DeviceRotationRateInit : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Nullable<double> mAlpha;
MOZ_INIT_OUTSIDE_CTOR Nullable<double> mBeta;
MOZ_INIT_OUTSIDE_CTOR Nullable<double> mGamma;
DeviceRotationRateInit();
explicit inline DeviceRotationRateInit(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
DeviceRotationRateInit(DeviceRotationRateInit&& aOther) = default;
explicit inline DeviceRotationRateInit(const DeviceRotationRateInit& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
DeviceRotationRateInit&
operator=(const DeviceRotationRateInit& aOther);
private:
static bool
InitIds(JSContext* cx, DeviceRotationRateInitAtoms* atomsCache);
};
namespace binding_detail {
struct FastDeviceRotationRateInit : public DeviceRotationRateInit
{
inline FastDeviceRotationRateInit()
: DeviceRotationRateInit(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct DeviceMotionEventInit : public EventInit
{
MOZ_INIT_OUTSIDE_CTOR DeviceAccelerationInit mAcceleration;
MOZ_INIT_OUTSIDE_CTOR DeviceAccelerationInit mAccelerationIncludingGravity;
MOZ_INIT_OUTSIDE_CTOR Nullable<double> mInterval;
MOZ_INIT_OUTSIDE_CTOR DeviceRotationRateInit mRotationRate;
DeviceMotionEventInit();
explicit inline DeviceMotionEventInit(const FastDictionaryInitializer& )
: EventInit(FastDictionaryInitializer()),
mAcceleration(FastDictionaryInitializer()),
mAccelerationIncludingGravity(FastDictionaryInitializer()),
mRotationRate(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
DeviceMotionEventInit(DeviceMotionEventInit&& aOther) = default;
explicit inline DeviceMotionEventInit(const DeviceMotionEventInit& aOther)
: EventInit(FastDictionaryInitializer()),
mAcceleration(FastDictionaryInitializer()),
mAccelerationIncludingGravity(FastDictionaryInitializer()),
mRotationRate(FastDictionaryInitializer())
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
DeviceMotionEventInit&
operator=(const DeviceMotionEventInit& aOther);
private:
static bool
InitIds(JSContext* cx, DeviceMotionEventInitAtoms* atomsCache);
};
namespace binding_detail {
struct FastDeviceMotionEventInit : public DeviceMotionEventInit
{
inline FastDeviceMotionEventInit()
: DeviceMotionEventInit(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace DeviceAcceleration_Binding {
typedef mozilla::dom::DeviceAcceleration NativeType;
bool
Wrap(JSContext* aCx, mozilla::dom::DeviceAcceleration* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
template <class T>
inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> reflector(aCx);
return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
}
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal);
} // namespace DeviceAcceleration_Binding
namespace DeviceMotionEvent_Binding {
typedef mozilla::dom::DeviceMotionEvent NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::dom::DeviceMotionEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
template <class T>
inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> reflector(aCx);
return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
}
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal);
JS::Handle<JSObject*>
GetConstructorObjectHandle(JSContext* aCx);
inline bool CreateAndDefineOnGlobal(JSContext* aCx)
{
// Get the interface or namespace object for this class. This will
// create the object as needed and always define the properties for
// it on the global. The caller should make sure the interface or
// namespace is exposed on the global before calling this.
return GetPerInterfaceObjectHandle(aCx, constructors::id::DeviceMotionEvent,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace DeviceMotionEvent_Binding
namespace DeviceRotationRate_Binding {
typedef mozilla::dom::DeviceRotationRate NativeType;
bool
Wrap(JSContext* aCx, mozilla::dom::DeviceRotationRate* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
template <class T>
inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> reflector(aCx);
return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
}
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal);
} // namespace DeviceRotationRate_Binding
} // namespace mozilla::dom
#endif // DOM_DEVICEMOTIONEVENTBINDING_H_