/work/obj-fuzz/dist/include/mozilla/dom/UIEventBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM UIEvent.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_UIEventBinding_h |
4 | | #define mozilla_dom_UIEventBinding_h |
5 | | |
6 | | #include "EventBinding.h" |
7 | | #include "GeckoProfiler.h" |
8 | | #include "UIEventBinding.h" |
9 | | #include "js/RootingAPI.h" |
10 | | #include "jspubtd.h" |
11 | | #include "mozilla/ErrorResult.h" |
12 | | #include "mozilla/dom/BindingDeclarations.h" |
13 | | #include "mozilla/dom/Nullable.h" |
14 | | #include "mozilla/dom/PrototypeList.h" |
15 | | #include "nsGlobalWindow.h" |
16 | | |
17 | | class nsGlobalWindowInner; |
18 | | |
19 | | namespace mozilla { |
20 | | namespace dom { |
21 | | |
22 | | struct EventModifierInitAtoms; |
23 | | struct NativePropertyHooks; |
24 | | class ProtoAndIfaceCache; |
25 | | class UIEvent; |
26 | | struct UIEventAtoms; |
27 | | struct UIEventInitAtoms; |
28 | | |
29 | | } // namespace dom |
30 | | } // namespace mozilla |
31 | | |
32 | | namespace mozilla { |
33 | | namespace dom { |
34 | | |
35 | | struct UIEventInit : public EventInit |
36 | | { |
37 | | MOZ_INIT_OUTSIDE_CTOR int32_t mDetail; |
38 | | MOZ_INIT_OUTSIDE_CTOR RefPtr<nsGlobalWindowInner> mView; |
39 | | |
40 | | UIEventInit(); |
41 | | |
42 | | explicit inline UIEventInit(const FastDictionaryInitializer& ) |
43 | | : EventInit(FastDictionaryInitializer()) |
44 | 0 | { |
45 | 0 | // Do nothing here; this is used by our "Fast" subclass |
46 | 0 | } |
47 | | |
48 | | explicit inline UIEventInit(const UIEventInit& aOther) |
49 | 0 | { |
50 | 0 | *this = aOther; |
51 | 0 | } |
52 | | |
53 | | bool |
54 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
55 | | |
56 | | bool |
57 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
58 | | |
59 | | void |
60 | | TraceDictionary(JSTracer* trc); |
61 | | |
62 | | inline void |
63 | | TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags) |
64 | 0 | { |
65 | 0 | ImplCycleCollectionTraverse(aCallback, mView, "mView", aFlags); |
66 | 0 | } |
67 | | |
68 | | inline void |
69 | | UnlinkForCC() |
70 | 0 | { |
71 | 0 | ImplCycleCollectionUnlink(mView); |
72 | 0 | } |
73 | | |
74 | | UIEventInit& |
75 | | operator=(const UIEventInit& aOther); |
76 | | |
77 | | private: |
78 | | static bool |
79 | | InitIds(JSContext* cx, UIEventInitAtoms* atomsCache); |
80 | | }; |
81 | | |
82 | | namespace binding_detail { |
83 | | struct FastUIEventInit : public UIEventInit |
84 | | { |
85 | | inline FastUIEventInit() |
86 | | : UIEventInit(FastDictionaryInitializer()) |
87 | 0 | { |
88 | 0 | // Doesn't matter what int we pass to the parent constructor |
89 | 0 | } |
90 | | }; |
91 | | } // namespace binding_detail |
92 | | |
93 | | |
94 | | struct EventModifierInit : public UIEventInit |
95 | | { |
96 | | MOZ_INIT_OUTSIDE_CTOR bool mAltKey; |
97 | | MOZ_INIT_OUTSIDE_CTOR bool mCtrlKey; |
98 | | MOZ_INIT_OUTSIDE_CTOR bool mMetaKey; |
99 | | MOZ_INIT_OUTSIDE_CTOR bool mModifierAltGraph; |
100 | | MOZ_INIT_OUTSIDE_CTOR bool mModifierCapsLock; |
101 | | MOZ_INIT_OUTSIDE_CTOR bool mModifierFn; |
102 | | MOZ_INIT_OUTSIDE_CTOR bool mModifierFnLock; |
103 | | MOZ_INIT_OUTSIDE_CTOR bool mModifierNumLock; |
104 | | MOZ_INIT_OUTSIDE_CTOR bool mModifierOS; |
105 | | MOZ_INIT_OUTSIDE_CTOR bool mModifierScrollLock; |
106 | | MOZ_INIT_OUTSIDE_CTOR bool mModifierSymbol; |
107 | | MOZ_INIT_OUTSIDE_CTOR bool mModifierSymbolLock; |
108 | | MOZ_INIT_OUTSIDE_CTOR bool mShiftKey; |
109 | | |
110 | | EventModifierInit(); |
111 | | |
112 | | explicit inline EventModifierInit(const FastDictionaryInitializer& ) |
113 | | : UIEventInit(FastDictionaryInitializer()) |
114 | 0 | { |
115 | 0 | // Do nothing here; this is used by our "Fast" subclass |
116 | 0 | } |
117 | | |
118 | | explicit inline EventModifierInit(const EventModifierInit& aOther) |
119 | 0 | { |
120 | 0 | *this = aOther; |
121 | 0 | } |
122 | | |
123 | | bool |
124 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
125 | | |
126 | | bool |
127 | | Init(const nsAString& aJSON); |
128 | | |
129 | | bool |
130 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
131 | | |
132 | | bool |
133 | | ToJSON(nsAString& aJSON) const; |
134 | | |
135 | | void |
136 | | TraceDictionary(JSTracer* trc); |
137 | | |
138 | | inline void |
139 | | TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags) |
140 | 0 | { |
141 | 0 | UIEventInit::TraverseForCC(aCallback, aFlags); |
142 | 0 | } |
143 | | |
144 | | inline void |
145 | | UnlinkForCC() |
146 | 0 | { |
147 | 0 | UIEventInit::UnlinkForCC(); |
148 | 0 | } |
149 | | |
150 | | EventModifierInit& |
151 | | operator=(const EventModifierInit& aOther); |
152 | | |
153 | | private: |
154 | | static bool |
155 | | InitIds(JSContext* cx, EventModifierInitAtoms* atomsCache); |
156 | | }; |
157 | | |
158 | | namespace binding_detail { |
159 | | struct FastEventModifierInit : public EventModifierInit |
160 | | { |
161 | | inline FastEventModifierInit() |
162 | | : EventModifierInit(FastDictionaryInitializer()) |
163 | 0 | { |
164 | 0 | // Doesn't matter what int we pass to the parent constructor |
165 | 0 | } |
166 | | }; |
167 | | } // namespace binding_detail |
168 | | |
169 | | |
170 | | namespace UIEvent_Binding { |
171 | | |
172 | | typedef mozilla::dom::UIEvent NativeType; |
173 | | |
174 | | static const int32_t SCROLL_PAGE_UP = -32768; |
175 | | static const int32_t SCROLL_PAGE_DOWN = 32768; |
176 | | const JSClass* |
177 | | GetJSClass(); |
178 | | |
179 | | bool |
180 | | Wrap(JSContext* aCx, mozilla::dom::UIEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
181 | | |
182 | | template <class T> |
183 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
184 | 0 | { |
185 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
186 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
187 | 0 | } |
188 | | |
189 | | // We declare this as an array so that retrieving a pointer to this |
190 | | // binding's property hooks only requires compile/link-time resolvable |
191 | | // address arithmetic. Declaring it as a pointer instead would require |
192 | | // doing a run-time load to fetch a pointer to this binding's property |
193 | | // hooks. And then structures which embedded a pointer to this structure |
194 | | // would require a run-time load for proper initialization, which would |
195 | | // then induce static constructors. Lots of static constructors. |
196 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
197 | | |
198 | | void |
199 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
200 | | |
201 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
202 | 0 | { |
203 | 0 | /* Get the interface prototype object for this class. This will create the |
204 | 0 | object as needed. */ |
205 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::UIEvent, |
206 | 0 | &CreateInterfaceObjects, |
207 | 0 | /* aDefineOnGlobal = */ true); |
208 | 0 |
|
209 | 0 | } |
210 | | |
211 | | JSObject* |
212 | | GetProtoObject(JSContext* aCx); |
213 | | |
214 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
215 | 0 | { |
216 | 0 | /* Get the interface object for this class. This will create the object as |
217 | 0 | needed. */ |
218 | 0 |
|
219 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::UIEvent, |
220 | 0 | &CreateInterfaceObjects, |
221 | 0 | aDefineOnGlobal); |
222 | 0 | } |
223 | | |
224 | | JSObject* |
225 | | GetConstructorObject(JSContext* aCx); |
226 | | |
227 | | } // namespace UIEvent_Binding |
228 | | |
229 | | |
230 | | |
231 | | } // namespace dom |
232 | | } // namespace mozilla |
233 | | |
234 | | #endif // mozilla_dom_UIEventBinding_h |