Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM PeriodicWave.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_PeriodicWaveBinding_h
4 : #define mozilla_dom_PeriodicWaveBinding_h
5 :
6 : #include "PeriodicWaveBinding.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 : struct NativePropertyHooks;
17 : class PeriodicWave;
18 : struct PeriodicWaveAtoms;
19 : struct PeriodicWaveConstraintsAtoms;
20 : struct PeriodicWaveOptionsAtoms;
21 : class ProtoAndIfaceCache;
22 :
23 : } // namespace dom
24 : } // namespace mozilla
25 :
26 : namespace mozilla {
27 : namespace dom {
28 :
29 : struct PeriodicWaveConstraints : public DictionaryBase
30 : {
31 : MOZ_INIT_OUTSIDE_CTOR bool mDisableNormalization;
32 :
33 : PeriodicWaveConstraints();
34 :
35 0 : explicit inline PeriodicWaveConstraints(const FastDictionaryInitializer& )
36 0 : {
37 : // Do nothing here; this is used by our "Fast" subclass
38 0 : }
39 :
40 : explicit inline PeriodicWaveConstraints(const PeriodicWaveConstraints& aOther)
41 : {
42 : *this = aOther;
43 : }
44 :
45 : bool
46 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
47 :
48 : bool
49 : Init(const nsAString& aJSON);
50 :
51 : bool
52 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
53 :
54 : bool
55 : ToJSON(nsAString& aJSON) const;
56 :
57 : void
58 : TraceDictionary(JSTracer* trc);
59 :
60 : PeriodicWaveConstraints&
61 : operator=(const PeriodicWaveConstraints& aOther);
62 :
63 : private:
64 : static bool
65 : InitIds(JSContext* cx, PeriodicWaveConstraintsAtoms* atomsCache);
66 : };
67 :
68 : namespace binding_detail {
69 : struct FastPeriodicWaveConstraints : public PeriodicWaveConstraints
70 : {
71 0 : inline FastPeriodicWaveConstraints()
72 0 : : PeriodicWaveConstraints(FastDictionaryInitializer())
73 : {
74 : // Doesn't matter what int we pass to the parent constructor
75 0 : }
76 : };
77 : } // namespace binding_detail
78 :
79 :
80 0 : struct PeriodicWaveOptions : public PeriodicWaveConstraints
81 : {
82 : MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<float>> mImag;
83 : MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<float>> mReal;
84 :
85 : PeriodicWaveOptions();
86 :
87 0 : explicit inline PeriodicWaveOptions(const FastDictionaryInitializer& )
88 0 : : PeriodicWaveConstraints(FastDictionaryInitializer())
89 : {
90 : // Do nothing here; this is used by our "Fast" subclass
91 0 : }
92 :
93 : explicit inline PeriodicWaveOptions(const PeriodicWaveOptions& aOther)
94 : {
95 : *this = aOther;
96 : }
97 :
98 : bool
99 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
100 :
101 : bool
102 : Init(const nsAString& aJSON);
103 :
104 : bool
105 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
106 :
107 : bool
108 : ToJSON(nsAString& aJSON) const;
109 :
110 : void
111 : TraceDictionary(JSTracer* trc);
112 :
113 : PeriodicWaveOptions&
114 : operator=(const PeriodicWaveOptions& aOther);
115 :
116 : private:
117 : static bool
118 : InitIds(JSContext* cx, PeriodicWaveOptionsAtoms* atomsCache);
119 : };
120 :
121 : namespace binding_detail {
122 0 : struct FastPeriodicWaveOptions : public PeriodicWaveOptions
123 : {
124 0 : inline FastPeriodicWaveOptions()
125 0 : : PeriodicWaveOptions(FastDictionaryInitializer())
126 : {
127 : // Doesn't matter what int we pass to the parent constructor
128 0 : }
129 : };
130 : } // namespace binding_detail
131 :
132 :
133 : namespace PeriodicWaveBinding {
134 :
135 : typedef mozilla::dom::PeriodicWave NativeType;
136 :
137 : bool
138 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
139 :
140 : JSObject*
141 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
142 :
143 : const JSClass*
144 : GetJSClass();
145 :
146 : bool
147 : Wrap(JSContext* aCx, mozilla::dom::PeriodicWave* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
148 :
149 : template <class T>
150 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
151 : {
152 0 : JS::Rooted<JSObject*> reflector(aCx);
153 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
154 : }
155 :
156 : // We declare this as an array so that retrieving a pointer to this
157 : // binding's property hooks only requires compile/link-time resolvable
158 : // address arithmetic. Declaring it as a pointer instead would require
159 : // doing a run-time load to fetch a pointer to this binding's property
160 : // hooks. And then structures which embedded a pointer to this structure
161 : // would require a run-time load for proper initialization, which would
162 : // then induce static constructors. Lots of static constructors.
163 : extern const NativePropertyHooks sNativePropertyHooks[];
164 :
165 : void
166 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
167 :
168 : JS::Handle<JSObject*>
169 : GetProtoObjectHandle(JSContext* aCx);
170 :
171 : JS::Handle<JSObject*>
172 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
173 :
174 : JSObject*
175 : GetConstructorObject(JSContext* aCx);
176 :
177 : } // namespace PeriodicWaveBinding
178 :
179 :
180 :
181 : } // namespace dom
182 : } // namespace mozilla
183 :
184 : #endif // mozilla_dom_PeriodicWaveBinding_h
|