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);
bool
operator==(const DeviceAccelerationInit& aOther) const;
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);
bool
operator==(const DeviceRotationRateInit& aOther) const;
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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::DeviceAcceleration,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
} // 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::DeviceMotionEvent,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::DeviceMotionEvent,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // 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, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::DeviceRotationRate,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
} // namespace DeviceRotationRate_Binding
} // namespace mozilla::dom
#endif // DOM_DEVICEMOTIONEVENTBINDING_H_