/work/obj-fuzz/dist/include/mozilla/dom/WheelEventBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM WheelEvent.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_WheelEventBinding_h |
4 | | #define mozilla_dom_WheelEventBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "MouseEventBinding.h" |
8 | | #include "js/RootingAPI.h" |
9 | | #include "jspubtd.h" |
10 | | #include "mozilla/ErrorResult.h" |
11 | | #include "mozilla/dom/BindingDeclarations.h" |
12 | | #include "mozilla/dom/EventTarget.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 | | class EventTarget; |
23 | | struct NativePropertyHooks; |
24 | | class ProtoAndIfaceCache; |
25 | | class WheelEvent; |
26 | | struct WheelEventAtoms; |
27 | | struct WheelEventInitAtoms; |
28 | | |
29 | | } // namespace dom |
30 | | } // namespace mozilla |
31 | | |
32 | | namespace mozilla { |
33 | | namespace dom { |
34 | | |
35 | | struct WheelEventInit : public MouseEventInit |
36 | | { |
37 | | MOZ_INIT_OUTSIDE_CTOR uint32_t mDeltaMode; |
38 | | MOZ_INIT_OUTSIDE_CTOR double mDeltaX; |
39 | | MOZ_INIT_OUTSIDE_CTOR double mDeltaY; |
40 | | MOZ_INIT_OUTSIDE_CTOR double mDeltaZ; |
41 | | |
42 | | WheelEventInit(); |
43 | | |
44 | | explicit inline WheelEventInit(const FastDictionaryInitializer& ) |
45 | | : MouseEventInit(FastDictionaryInitializer()) |
46 | 0 | { |
47 | 0 | // Do nothing here; this is used by our "Fast" subclass |
48 | 0 | } |
49 | | |
50 | | explicit inline WheelEventInit(const WheelEventInit& aOther) |
51 | 0 | { |
52 | 0 | *this = aOther; |
53 | 0 | } |
54 | | |
55 | | bool |
56 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
57 | | |
58 | | bool |
59 | | Init(const nsAString& aJSON); |
60 | | |
61 | | bool |
62 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
63 | | |
64 | | bool |
65 | | ToJSON(nsAString& aJSON) const; |
66 | | |
67 | | void |
68 | | TraceDictionary(JSTracer* trc); |
69 | | |
70 | | inline void |
71 | | TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags) |
72 | 0 | { |
73 | 0 | MouseEventInit::TraverseForCC(aCallback, aFlags); |
74 | 0 | } |
75 | | |
76 | | inline void |
77 | | UnlinkForCC() |
78 | 0 | { |
79 | 0 | MouseEventInit::UnlinkForCC(); |
80 | 0 | } |
81 | | |
82 | | WheelEventInit& |
83 | | operator=(const WheelEventInit& aOther); |
84 | | |
85 | | private: |
86 | | static bool |
87 | | InitIds(JSContext* cx, WheelEventInitAtoms* atomsCache); |
88 | | }; |
89 | | |
90 | | namespace binding_detail { |
91 | | struct FastWheelEventInit : public WheelEventInit |
92 | | { |
93 | | inline FastWheelEventInit() |
94 | | : WheelEventInit(FastDictionaryInitializer()) |
95 | 0 | { |
96 | 0 | // Doesn't matter what int we pass to the parent constructor |
97 | 0 | } |
98 | | }; |
99 | | } // namespace binding_detail |
100 | | |
101 | | |
102 | | namespace WheelEvent_Binding { |
103 | | |
104 | | typedef mozilla::dom::WheelEvent NativeType; |
105 | | |
106 | | static const uint32_t DOM_DELTA_PIXEL = 0; |
107 | | static const uint32_t DOM_DELTA_LINE = 1; |
108 | | static const uint32_t DOM_DELTA_PAGE = 2; |
109 | | const JSClass* |
110 | | GetJSClass(); |
111 | | |
112 | | bool |
113 | | Wrap(JSContext* aCx, mozilla::dom::WheelEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
114 | | |
115 | | template <class T> |
116 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
117 | 0 | { |
118 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
119 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
120 | 0 | } |
121 | | |
122 | | // We declare this as an array so that retrieving a pointer to this |
123 | | // binding's property hooks only requires compile/link-time resolvable |
124 | | // address arithmetic. Declaring it as a pointer instead would require |
125 | | // doing a run-time load to fetch a pointer to this binding's property |
126 | | // hooks. And then structures which embedded a pointer to this structure |
127 | | // would require a run-time load for proper initialization, which would |
128 | | // then induce static constructors. Lots of static constructors. |
129 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
130 | | |
131 | | void |
132 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
133 | | |
134 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
135 | 0 | { |
136 | 0 | /* Get the interface prototype object for this class. This will create the |
137 | 0 | object as needed. */ |
138 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::WheelEvent, |
139 | 0 | &CreateInterfaceObjects, |
140 | 0 | /* aDefineOnGlobal = */ true); |
141 | 0 |
|
142 | 0 | } |
143 | | |
144 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
145 | 0 | { |
146 | 0 | /* Get the interface object for this class. This will create the object as |
147 | 0 | needed. */ |
148 | 0 |
|
149 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::WheelEvent, |
150 | 0 | &CreateInterfaceObjects, |
151 | 0 | aDefineOnGlobal); |
152 | 0 | } |
153 | | |
154 | | JSObject* |
155 | | GetConstructorObject(JSContext* aCx); |
156 | | |
157 | | } // namespace WheelEvent_Binding |
158 | | |
159 | | |
160 | | |
161 | | } // namespace dom |
162 | | } // namespace mozilla |
163 | | |
164 | | #endif // mozilla_dom_WheelEventBinding_h |