Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM PannerNode.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_PANNERNODEBINDING_H_
#define DOM_PANNERNODEBINDING_H_
#include "AudioNodeBinding.h"
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/EnumTypeTraits.h"
#include "mozilla/Span.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
namespace mozilla {
namespace dom {
struct NativePropertyHooks;
class PannerNode;
struct PannerOptionsAtoms;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class PanningModelType : uint8_t {
Equalpower,
HRTF,
};
namespace binding_detail {
template <> struct EnumStrings<PanningModelType> {
static const nsLiteralCString Values[2];
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, PanningModelType aArgument, JS::MutableHandle<JS::Value> aValue);
enum class DistanceModelType : uint8_t {
Linear,
Inverse,
Exponential,
};
namespace binding_detail {
template <> struct EnumStrings<DistanceModelType> {
static const nsLiteralCString Values[3];
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, DistanceModelType aArgument, JS::MutableHandle<JS::Value> aValue);
struct PannerOptions : public AudioNodeOptions
{
MOZ_INIT_OUTSIDE_CTOR double mConeInnerAngle;
MOZ_INIT_OUTSIDE_CTOR double mConeOuterAngle;
MOZ_INIT_OUTSIDE_CTOR double mConeOuterGain;
MOZ_INIT_OUTSIDE_CTOR DistanceModelType mDistanceModel;
MOZ_INIT_OUTSIDE_CTOR double mMaxDistance;
MOZ_INIT_OUTSIDE_CTOR float mOrientationX;
MOZ_INIT_OUTSIDE_CTOR float mOrientationY;
MOZ_INIT_OUTSIDE_CTOR float mOrientationZ;
MOZ_INIT_OUTSIDE_CTOR PanningModelType mPanningModel;
MOZ_INIT_OUTSIDE_CTOR float mPositionX;
MOZ_INIT_OUTSIDE_CTOR float mPositionY;
MOZ_INIT_OUTSIDE_CTOR float mPositionZ;
MOZ_INIT_OUTSIDE_CTOR double mRefDistance;
MOZ_INIT_OUTSIDE_CTOR double mRolloffFactor;
PannerOptions();
explicit inline PannerOptions(const FastDictionaryInitializer& )
: AudioNodeOptions(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
PannerOptions(PannerOptions&& aOther) = default;
explicit inline PannerOptions(const PannerOptions& aOther)
: AudioNodeOptions(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);
PannerOptions&
operator=(const PannerOptions& aOther);
private:
static bool
InitIds(JSContext* cx, PannerOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastPannerOptions : public PannerOptions
{
inline FastPannerOptions()
: PannerOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace PannerNode_Binding {
typedef mozilla::dom::PannerNode NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::dom::PannerNode* 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::PannerNode,
&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::PannerNode,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace PannerNode_Binding
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::PanningModelType>
{
static constexpr dom::PanningModelType value = dom::PanningModelType::HRTF;
static_assert(static_cast<uint8_t>(dom::PanningModelType::Equalpower) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(mozilla::ArrayLength(dom::binding_detail::EnumStrings<dom::PanningModelType>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
template <>
struct MaxContiguousEnumValue<dom::DistanceModelType>
{
static constexpr dom::DistanceModelType value = dom::DistanceModelType::Exponential;
static_assert(static_cast<uint8_t>(dom::DistanceModelType::Linear) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(mozilla::ArrayLength(dom::binding_detail::EnumStrings<dom::DistanceModelType>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_PANNERNODEBINDING_H_