Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM PointerEvent.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_POINTEREVENTBINDING_H_
#define DOM_POINTEREVENTBINDING_H_
#include "MouseEventBinding.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/PointerEvent.h"
#include "mozilla/dom/PrototypeList.h"
namespace mozilla {
namespace dom {
struct NativePropertyHooks;
class PointerEvent;
struct PointerEventInitAtoms;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
struct PointerEventInit : public MouseEventInit
{
MOZ_INIT_OUTSIDE_CTOR Sequence<OwningNonNull<mozilla::dom::PointerEvent>> mCoalescedEvents;
MOZ_INIT_OUTSIDE_CTOR int32_t mHeight;
MOZ_INIT_OUTSIDE_CTOR bool mIsPrimary;
MOZ_INIT_OUTSIDE_CTOR int32_t mPointerId;
MOZ_INIT_OUTSIDE_CTOR nsString mPointerType;
MOZ_INIT_OUTSIDE_CTOR Sequence<OwningNonNull<mozilla::dom::PointerEvent>> mPredictedEvents;
MOZ_INIT_OUTSIDE_CTOR float mPressure;
MOZ_INIT_OUTSIDE_CTOR float mTangentialPressure;
MOZ_INIT_OUTSIDE_CTOR int32_t mTiltX;
MOZ_INIT_OUTSIDE_CTOR int32_t mTiltY;
MOZ_INIT_OUTSIDE_CTOR int32_t mTwist;
MOZ_INIT_OUTSIDE_CTOR int32_t mWidth;
PointerEventInit();
explicit inline PointerEventInit(const FastDictionaryInitializer& )
: MouseEventInit(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
PointerEventInit(PointerEventInit&& aOther) = default;
explicit inline PointerEventInit(const PointerEventInit& aOther)
: MouseEventInit(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);
inline void
TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
{
MouseEventInit::TraverseForCC(aCallback, aFlags);
ImplCycleCollectionTraverse(aCallback, mCoalescedEvents, "mCoalescedEvents", aFlags);
ImplCycleCollectionTraverse(aCallback, mPredictedEvents, "mPredictedEvents", aFlags);
}
inline void
UnlinkForCC()
{
MouseEventInit::UnlinkForCC();
ImplCycleCollectionUnlink(mCoalescedEvents);
ImplCycleCollectionUnlink(mPredictedEvents);
}
PointerEventInit&
operator=(const PointerEventInit& aOther);
private:
static bool
InitIds(JSContext* cx, PointerEventInitAtoms* atomsCache);
};
namespace binding_detail {
struct FastPointerEventInit : public PointerEventInit
{
inline FastPointerEventInit()
: PointerEventInit(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace PointerEvent_Binding {
typedef mozilla::dom::PointerEvent NativeType;
bool
Wrap(JSContext* aCx, mozilla::dom::PointerEvent* 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::PointerEvent,
&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::PointerEvent,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace PointerEvent_Binding
} // namespace mozilla::dom
#endif // DOM_POINTEREVENTBINDING_H_