Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM VideoColorSpace.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_VIDEOCOLORSPACEBINDING_H_
#define DOM_VIDEOCOLORSPACEBINDING_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 ProtoAndIfaceCache;
class VideoColorSpace;
struct VideoColorSpaceInitAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class VideoColorPrimaries : uint8_t {
Bt709,
Bt470bg,
Smpte170m,
Bt2020,
Smpte432,
};
namespace binding_detail {
template <> struct EnumStrings<VideoColorPrimaries> {
static const nsLiteralCString Values[5];
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, VideoColorPrimaries aArgument, JS::MutableHandle<JS::Value> aValue);
enum class VideoTransferCharacteristics : uint8_t {
Bt709,
Smpte170m,
Iec61966_2_1,
Linear,
Pq,
Hlg,
};
namespace binding_detail {
template <> struct EnumStrings<VideoTransferCharacteristics> {
static const nsLiteralCString Values[6];
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, VideoTransferCharacteristics aArgument, JS::MutableHandle<JS::Value> aValue);
enum class VideoMatrixCoefficients : uint8_t {
Rgb,
Bt709,
Bt470bg,
Smpte170m,
Bt2020_ncl,
};
namespace binding_detail {
template <> struct EnumStrings<VideoMatrixCoefficients> {
static const nsLiteralCString Values[5];
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, VideoMatrixCoefficients aArgument, JS::MutableHandle<JS::Value> aValue);
struct VideoColorSpaceInit : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Nullable<bool> mFullRange;
MOZ_INIT_OUTSIDE_CTOR Nullable<VideoMatrixCoefficients> mMatrix;
MOZ_INIT_OUTSIDE_CTOR Nullable<VideoColorPrimaries> mPrimaries;
MOZ_INIT_OUTSIDE_CTOR Nullable<VideoTransferCharacteristics> mTransfer;
VideoColorSpaceInit();
explicit inline VideoColorSpaceInit(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
VideoColorSpaceInit(VideoColorSpaceInit&& aOther) = default;
explicit inline VideoColorSpaceInit(const VideoColorSpaceInit& 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);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
VideoColorSpaceInit&
operator=(const VideoColorSpaceInit& aOther);
private:
static bool
InitIds(JSContext* cx, VideoColorSpaceInitAtoms* atomsCache);
};
namespace binding_detail {
struct FastVideoColorSpaceInit : public VideoColorSpaceInit
{
inline FastVideoColorSpaceInit()
: VideoColorSpaceInit(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace VideoColorSpace_Binding {
typedef mozilla::dom::VideoColorSpace NativeType;
MOZ_CAN_RUN_SCRIPT bool
CollectJSONAttributes(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::VideoColorSpace* self, JS::Rooted<JSObject*>& result);
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::dom::VideoColorSpace* 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::VideoColorSpace,
&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::VideoColorSpace,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace VideoColorSpace_Binding
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::VideoColorPrimaries>
{
static constexpr dom::VideoColorPrimaries value = dom::VideoColorPrimaries::Smpte432;
static_assert(static_cast<uint8_t>(dom::VideoColorPrimaries::Bt709) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(mozilla::ArrayLength(dom::binding_detail::EnumStrings<dom::VideoColorPrimaries>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
template <>
struct MaxContiguousEnumValue<dom::VideoTransferCharacteristics>
{
static constexpr dom::VideoTransferCharacteristics value = dom::VideoTransferCharacteristics::Hlg;
static_assert(static_cast<uint8_t>(dom::VideoTransferCharacteristics::Bt709) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(mozilla::ArrayLength(dom::binding_detail::EnumStrings<dom::VideoTransferCharacteristics>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
template <>
struct MaxContiguousEnumValue<dom::VideoMatrixCoefficients>
{
static constexpr dom::VideoMatrixCoefficients value = dom::VideoMatrixCoefficients::Bt2020_ncl;
static_assert(static_cast<uint8_t>(dom::VideoMatrixCoefficients::Rgb) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(mozilla::ArrayLength(dom::binding_detail::EnumStrings<dom::VideoMatrixCoefficients>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_VIDEOCOLORSPACEBINDING_H_