Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM GamepadEvent.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_GamepadEventBinding_h
4 : #define mozilla_dom_GamepadEventBinding_h
5 :
6 : #include "EventBinding.h"
7 : #include "js/RootingAPI.h"
8 : #include "jspubtd.h"
9 : #include "mozilla/ErrorResult.h"
10 : #include "mozilla/dom/BindingDeclarations.h"
11 : #include "mozilla/dom/Gamepad.h"
12 : #include "mozilla/dom/Nullable.h"
13 :
14 : namespace mozilla {
15 : namespace dom {
16 :
17 : class Gamepad;
18 : class GamepadEvent;
19 : struct GamepadEventAtoms;
20 : struct GamepadEventInitAtoms;
21 : struct NativePropertyHooks;
22 : class ProtoAndIfaceCache;
23 :
24 : } // namespace dom
25 : } // namespace mozilla
26 :
27 : namespace mozilla {
28 : namespace dom {
29 :
30 0 : struct GamepadEventInit : public EventInit
31 : {
32 : MOZ_INIT_OUTSIDE_CTOR RefPtr<mozilla::dom::Gamepad> mGamepad;
33 :
34 : GamepadEventInit();
35 :
36 0 : explicit inline GamepadEventInit(const FastDictionaryInitializer& )
37 0 : : EventInit(FastDictionaryInitializer())
38 : {
39 : // Do nothing here; this is used by our "Fast" subclass
40 0 : }
41 :
42 : explicit inline GamepadEventInit(const GamepadEventInit& aOther)
43 : {
44 : *this = aOther;
45 : }
46 :
47 : bool
48 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
49 :
50 : bool
51 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
52 :
53 : void
54 : TraceDictionary(JSTracer* trc);
55 :
56 : GamepadEventInit&
57 : operator=(const GamepadEventInit& aOther);
58 :
59 : private:
60 : static bool
61 : InitIds(JSContext* cx, GamepadEventInitAtoms* atomsCache);
62 : };
63 :
64 : namespace binding_detail {
65 0 : struct FastGamepadEventInit : public GamepadEventInit
66 : {
67 0 : inline FastGamepadEventInit()
68 0 : : GamepadEventInit(FastDictionaryInitializer())
69 : {
70 : // Doesn't matter what int we pass to the parent constructor
71 0 : }
72 : };
73 : } // namespace binding_detail
74 :
75 :
76 : namespace GamepadEventBinding {
77 :
78 : typedef mozilla::dom::GamepadEvent NativeType;
79 :
80 : bool
81 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
82 :
83 : JSObject*
84 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
85 :
86 : const JSClass*
87 : GetJSClass();
88 :
89 : bool
90 : Wrap(JSContext* aCx, mozilla::dom::GamepadEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
91 :
92 : template <class T>
93 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
94 : {
95 0 : JS::Rooted<JSObject*> reflector(aCx);
96 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
97 : }
98 :
99 : // We declare this as an array so that retrieving a pointer to this
100 : // binding's property hooks only requires compile/link-time resolvable
101 : // address arithmetic. Declaring it as a pointer instead would require
102 : // doing a run-time load to fetch a pointer to this binding's property
103 : // hooks. And then structures which embedded a pointer to this structure
104 : // would require a run-time load for proper initialization, which would
105 : // then induce static constructors. Lots of static constructors.
106 : extern const NativePropertyHooks sNativePropertyHooks[];
107 :
108 : void
109 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
110 :
111 : JS::Handle<JSObject*>
112 : GetProtoObjectHandle(JSContext* aCx);
113 :
114 : JSObject*
115 : GetProtoObject(JSContext* aCx);
116 :
117 : JS::Handle<JSObject*>
118 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
119 :
120 : JSObject*
121 : GetConstructorObject(JSContext* aCx);
122 :
123 : } // namespace GamepadEventBinding
124 :
125 :
126 :
127 : } // namespace dom
128 : } // namespace mozilla
129 :
130 : #endif // mozilla_dom_GamepadEventBinding_h
|