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