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