Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM DeviceMotionEvent.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_DeviceMotionEventBinding_h
4 : #define mozilla_dom_DeviceMotionEventBinding_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/Nullable.h"
12 :
13 : namespace mozilla {
14 : namespace dom {
15 :
16 : class DeviceAcceleration;
17 : struct DeviceAccelerationAtoms;
18 : struct DeviceAccelerationInit;
19 : struct DeviceAccelerationInitAtoms;
20 : class DeviceMotionEvent;
21 : struct DeviceMotionEventAtoms;
22 : struct DeviceMotionEventInitAtoms;
23 : class DeviceRotationRate;
24 : struct DeviceRotationRateAtoms;
25 : struct DeviceRotationRateInit;
26 : struct DeviceRotationRateInitAtoms;
27 : struct NativePropertyHooks;
28 : class ProtoAndIfaceCache;
29 :
30 : } // namespace dom
31 : } // namespace mozilla
32 :
33 : namespace mozilla {
34 : namespace dom {
35 :
36 0 : struct DeviceAccelerationInit : public DictionaryBase
37 : {
38 : MOZ_INIT_OUTSIDE_CTOR Nullable<double> mX;
39 : MOZ_INIT_OUTSIDE_CTOR Nullable<double> mY;
40 : MOZ_INIT_OUTSIDE_CTOR Nullable<double> mZ;
41 :
42 : DeviceAccelerationInit();
43 :
44 0 : explicit inline DeviceAccelerationInit(const FastDictionaryInitializer& )
45 0 : {
46 : // Do nothing here; this is used by our "Fast" subclass
47 0 : }
48 :
49 : explicit inline DeviceAccelerationInit(const DeviceAccelerationInit& aOther)
50 : {
51 : *this = aOther;
52 : }
53 :
54 : bool
55 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
56 :
57 : bool
58 : Init(const nsAString& aJSON);
59 :
60 : bool
61 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
62 :
63 : bool
64 : ToJSON(nsAString& aJSON) const;
65 :
66 : void
67 : TraceDictionary(JSTracer* trc);
68 :
69 : DeviceAccelerationInit&
70 : operator=(const DeviceAccelerationInit& aOther);
71 :
72 : private:
73 : static bool
74 : InitIds(JSContext* cx, DeviceAccelerationInitAtoms* atomsCache);
75 : };
76 :
77 : namespace binding_detail {
78 0 : struct FastDeviceAccelerationInit : public DeviceAccelerationInit
79 : {
80 0 : inline FastDeviceAccelerationInit()
81 0 : : DeviceAccelerationInit(FastDictionaryInitializer())
82 : {
83 : // Doesn't matter what int we pass to the parent constructor
84 0 : }
85 : };
86 : } // namespace binding_detail
87 :
88 :
89 0 : struct DeviceRotationRateInit : public DictionaryBase
90 : {
91 : MOZ_INIT_OUTSIDE_CTOR Nullable<double> mAlpha;
92 : MOZ_INIT_OUTSIDE_CTOR Nullable<double> mBeta;
93 : MOZ_INIT_OUTSIDE_CTOR Nullable<double> mGamma;
94 :
95 : DeviceRotationRateInit();
96 :
97 0 : explicit inline DeviceRotationRateInit(const FastDictionaryInitializer& )
98 0 : {
99 : // Do nothing here; this is used by our "Fast" subclass
100 0 : }
101 :
102 : explicit inline DeviceRotationRateInit(const DeviceRotationRateInit& aOther)
103 : {
104 : *this = aOther;
105 : }
106 :
107 : bool
108 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
109 :
110 : bool
111 : Init(const nsAString& aJSON);
112 :
113 : bool
114 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
115 :
116 : bool
117 : ToJSON(nsAString& aJSON) const;
118 :
119 : void
120 : TraceDictionary(JSTracer* trc);
121 :
122 : DeviceRotationRateInit&
123 : operator=(const DeviceRotationRateInit& aOther);
124 :
125 : private:
126 : static bool
127 : InitIds(JSContext* cx, DeviceRotationRateInitAtoms* atomsCache);
128 : };
129 :
130 : namespace binding_detail {
131 0 : struct FastDeviceRotationRateInit : public DeviceRotationRateInit
132 : {
133 0 : inline FastDeviceRotationRateInit()
134 0 : : DeviceRotationRateInit(FastDictionaryInitializer())
135 : {
136 : // Doesn't matter what int we pass to the parent constructor
137 0 : }
138 : };
139 : } // namespace binding_detail
140 :
141 :
142 0 : struct DeviceMotionEventInit : public EventInit
143 : {
144 : MOZ_INIT_OUTSIDE_CTOR DeviceAccelerationInit mAcceleration;
145 : MOZ_INIT_OUTSIDE_CTOR DeviceAccelerationInit mAccelerationIncludingGravity;
146 : MOZ_INIT_OUTSIDE_CTOR Nullable<double> mInterval;
147 : MOZ_INIT_OUTSIDE_CTOR DeviceRotationRateInit mRotationRate;
148 :
149 : DeviceMotionEventInit();
150 :
151 0 : explicit inline DeviceMotionEventInit(const FastDictionaryInitializer& )
152 0 : : EventInit(FastDictionaryInitializer()),
153 0 : mAcceleration(FastDictionaryInitializer()),
154 0 : mAccelerationIncludingGravity(FastDictionaryInitializer()),
155 0 : mRotationRate(FastDictionaryInitializer())
156 : {
157 : // Do nothing here; this is used by our "Fast" subclass
158 0 : }
159 :
160 : explicit inline DeviceMotionEventInit(const DeviceMotionEventInit& aOther)
161 : : mAcceleration(FastDictionaryInitializer()),
162 : mAccelerationIncludingGravity(FastDictionaryInitializer()),
163 : mRotationRate(FastDictionaryInitializer())
164 : {
165 : *this = aOther;
166 : }
167 :
168 : bool
169 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
170 :
171 : bool
172 : Init(const nsAString& aJSON);
173 :
174 : bool
175 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
176 :
177 : bool
178 : ToJSON(nsAString& aJSON) const;
179 :
180 : void
181 : TraceDictionary(JSTracer* trc);
182 :
183 : DeviceMotionEventInit&
184 : operator=(const DeviceMotionEventInit& aOther);
185 :
186 : private:
187 : static bool
188 : InitIds(JSContext* cx, DeviceMotionEventInitAtoms* atomsCache);
189 : };
190 :
191 : namespace binding_detail {
192 0 : struct FastDeviceMotionEventInit : public DeviceMotionEventInit
193 : {
194 0 : inline FastDeviceMotionEventInit()
195 0 : : DeviceMotionEventInit(FastDictionaryInitializer())
196 : {
197 : // Doesn't matter what int we pass to the parent constructor
198 0 : }
199 : };
200 : } // namespace binding_detail
201 :
202 :
203 : namespace DeviceAccelerationBinding {
204 :
205 : typedef mozilla::dom::DeviceAcceleration NativeType;
206 :
207 : const JSClass*
208 : GetJSClass();
209 :
210 : bool
211 : Wrap(JSContext* aCx, mozilla::dom::DeviceAcceleration* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
212 :
213 : template <class T>
214 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
215 : {
216 0 : JS::Rooted<JSObject*> reflector(aCx);
217 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
218 : }
219 :
220 : // We declare this as an array so that retrieving a pointer to this
221 : // binding's property hooks only requires compile/link-time resolvable
222 : // address arithmetic. Declaring it as a pointer instead would require
223 : // doing a run-time load to fetch a pointer to this binding's property
224 : // hooks. And then structures which embedded a pointer to this structure
225 : // would require a run-time load for proper initialization, which would
226 : // then induce static constructors. Lots of static constructors.
227 : extern const NativePropertyHooks sNativePropertyHooks[];
228 :
229 : void
230 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
231 :
232 : JS::Handle<JSObject*>
233 : GetProtoObjectHandle(JSContext* aCx);
234 :
235 : } // namespace DeviceAccelerationBinding
236 :
237 :
238 :
239 : namespace DeviceMotionEventBinding {
240 :
241 : typedef mozilla::dom::DeviceMotionEvent NativeType;
242 :
243 : JSObject*
244 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
245 :
246 : const JSClass*
247 : GetJSClass();
248 :
249 : bool
250 : Wrap(JSContext* aCx, mozilla::dom::DeviceMotionEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
251 :
252 : template <class T>
253 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
254 : {
255 0 : JS::Rooted<JSObject*> reflector(aCx);
256 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
257 : }
258 :
259 : // We declare this as an array so that retrieving a pointer to this
260 : // binding's property hooks only requires compile/link-time resolvable
261 : // address arithmetic. Declaring it as a pointer instead would require
262 : // doing a run-time load to fetch a pointer to this binding's property
263 : // hooks. And then structures which embedded a pointer to this structure
264 : // would require a run-time load for proper initialization, which would
265 : // then induce static constructors. Lots of static constructors.
266 : extern const NativePropertyHooks sNativePropertyHooks[];
267 :
268 : void
269 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
270 :
271 : JS::Handle<JSObject*>
272 : GetProtoObjectHandle(JSContext* aCx);
273 :
274 : JS::Handle<JSObject*>
275 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
276 :
277 : JSObject*
278 : GetConstructorObject(JSContext* aCx);
279 :
280 : } // namespace DeviceMotionEventBinding
281 :
282 :
283 :
284 : namespace DeviceRotationRateBinding {
285 :
286 : typedef mozilla::dom::DeviceRotationRate NativeType;
287 :
288 : const JSClass*
289 : GetJSClass();
290 :
291 : bool
292 : Wrap(JSContext* aCx, mozilla::dom::DeviceRotationRate* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
293 :
294 : template <class T>
295 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
296 : {
297 0 : JS::Rooted<JSObject*> reflector(aCx);
298 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
299 : }
300 :
301 : // We declare this as an array so that retrieving a pointer to this
302 : // binding's property hooks only requires compile/link-time resolvable
303 : // address arithmetic. Declaring it as a pointer instead would require
304 : // doing a run-time load to fetch a pointer to this binding's property
305 : // hooks. And then structures which embedded a pointer to this structure
306 : // would require a run-time load for proper initialization, which would
307 : // then induce static constructors. Lots of static constructors.
308 : extern const NativePropertyHooks sNativePropertyHooks[];
309 :
310 : void
311 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
312 :
313 : JS::Handle<JSObject*>
314 : GetProtoObjectHandle(JSContext* aCx);
315 :
316 : } // namespace DeviceRotationRateBinding
317 :
318 :
319 :
320 : } // namespace dom
321 : } // namespace mozilla
322 :
323 : #endif // mozilla_dom_DeviceMotionEventBinding_h
|