1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#[repr(C)]
pub struct nsIDOMMouseEvent {
vtable: *const nsIDOMMouseEventVTable,
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
}
unsafe impl XpCom for nsIDOMMouseEvent {
const IID: nsIID = nsID(0x5bdab8d8, 0x7933, 0x4c5c,
[0xb6, 0xd1, 0xab, 0x34, 0x48, 0x12, 0x37, 0xf7]);
}
unsafe impl RefCounted for nsIDOMMouseEvent {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
#[doc(hidden)]
pub trait nsIDOMMouseEventCoerce {
fn coerce_from(v: &nsIDOMMouseEvent) -> &Self;
}
impl nsIDOMMouseEventCoerce for nsIDOMMouseEvent {
#[inline]
fn coerce_from(v: &nsIDOMMouseEvent) -> &Self {
v
}
}
impl nsIDOMMouseEvent {
#[inline]
pub fn coerce<T: nsIDOMMouseEventCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
impl ::std::ops::Deref for nsIDOMMouseEvent {
type Target = nsIDOMUIEvent;
#[inline]
fn deref(&self) -> &nsIDOMUIEvent {
unsafe {
::std::mem::transmute(self)
}
}
}
impl<T: nsIDOMUIEventCoerce> nsIDOMMouseEventCoerce for T {
#[inline]
fn coerce_from(v: &nsIDOMMouseEvent) -> &Self {
T::coerce_from(v)
}
}
#[doc(hidden)]
#[repr(C)]
pub struct nsIDOMMouseEventVTable {
pub __base: nsIDOMUIEventVTable,
pub GetScreenX: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aScreenX: *mut libc::int32_t) -> nsresult,
pub GetScreenY: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aScreenY: *mut libc::int32_t) -> nsresult,
pub GetMozMovementX: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aMozMovementX: *mut libc::int32_t) -> nsresult,
pub GetMozMovementY: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aMozMovementY: *mut libc::int32_t) -> nsresult,
pub GetClientX: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aClientX: *mut libc::int32_t) -> nsresult,
pub GetClientY: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aClientY: *mut libc::int32_t) -> nsresult,
pub GetCtrlKey: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aCtrlKey: *mut bool) -> nsresult,
pub GetShiftKey: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aShiftKey: *mut bool) -> nsresult,
pub GetAltKey: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aAltKey: *mut bool) -> nsresult,
pub GetMetaKey: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aMetaKey: *mut bool) -> nsresult,
pub GetButton: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aButton: *mut libc::int16_t) -> nsresult,
pub GetButtons: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aButtons: *mut libc::uint16_t) -> nsresult,
pub GetRelatedTarget: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aRelatedTarget: *mut *const nsIDOMEventTarget) -> nsresult,
pub InitMouseEvent: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, typeArg: &::nsstring::nsAString, canBubbleArg: bool, cancelableArg: bool, viewArg: *const mozIDOMWindow, detailArg: libc::int32_t, screenXArg: libc::int32_t, screenYArg: libc::int32_t, clientXArg: libc::int32_t, clientYArg: libc::int32_t, ctrlKeyArg: bool, altKeyArg: bool, shiftKeyArg: bool, metaKeyArg: bool, buttonArg: libc::uint16_t, relatedTargetArg: *const nsIDOMEventTarget) -> nsresult,
pub GetMozPressure: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aMozPressure: *mut libc::c_float) -> nsresult,
pub GetMozInputSource: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, aMozInputSource: *mut libc::uint16_t) -> nsresult,
pub GetModifierState: unsafe extern "system" fn (this: *const nsIDOMMouseEvent, keyArg: &::nsstring::nsAString, _retval: *mut bool) -> nsresult,
}
impl nsIDOMMouseEvent {
pub const MOZ_SOURCE_UNKNOWN: i64 = 0;
pub const MOZ_SOURCE_MOUSE: i64 = 1;
pub const MOZ_SOURCE_PEN: i64 = 2;
pub const MOZ_SOURCE_ERASER: i64 = 3;
pub const MOZ_SOURCE_CURSOR: i64 = 4;
pub const MOZ_SOURCE_TOUCH: i64 = 5;
pub const MOZ_SOURCE_KEYBOARD: i64 = 6;
#[inline]
pub unsafe fn GetScreenX(&self, aScreenX: *mut libc::int32_t) -> nsresult {
((*self.vtable).GetScreenX)(self, aScreenX)
}
#[inline]
pub unsafe fn GetScreenY(&self, aScreenY: *mut libc::int32_t) -> nsresult {
((*self.vtable).GetScreenY)(self, aScreenY)
}
#[inline]
pub unsafe fn GetMozMovementX(&self, aMozMovementX: *mut libc::int32_t) -> nsresult {
((*self.vtable).GetMozMovementX)(self, aMozMovementX)
}
#[inline]
pub unsafe fn GetMozMovementY(&self, aMozMovementY: *mut libc::int32_t) -> nsresult {
((*self.vtable).GetMozMovementY)(self, aMozMovementY)
}
#[inline]
pub unsafe fn GetClientX(&self, aClientX: *mut libc::int32_t) -> nsresult {
((*self.vtable).GetClientX)(self, aClientX)
}
#[inline]
pub unsafe fn GetClientY(&self, aClientY: *mut libc::int32_t) -> nsresult {
((*self.vtable).GetClientY)(self, aClientY)
}
#[inline]
pub unsafe fn GetCtrlKey(&self, aCtrlKey: *mut bool) -> nsresult {
((*self.vtable).GetCtrlKey)(self, aCtrlKey)
}
#[inline]
pub unsafe fn GetShiftKey(&self, aShiftKey: *mut bool) -> nsresult {
((*self.vtable).GetShiftKey)(self, aShiftKey)
}
#[inline]
pub unsafe fn GetAltKey(&self, aAltKey: *mut bool) -> nsresult {
((*self.vtable).GetAltKey)(self, aAltKey)
}
#[inline]
pub unsafe fn GetMetaKey(&self, aMetaKey: *mut bool) -> nsresult {
((*self.vtable).GetMetaKey)(self, aMetaKey)
}
#[inline]
pub unsafe fn GetButton(&self, aButton: *mut libc::int16_t) -> nsresult {
((*self.vtable).GetButton)(self, aButton)
}
#[inline]
pub unsafe fn GetButtons(&self, aButtons: *mut libc::uint16_t) -> nsresult {
((*self.vtable).GetButtons)(self, aButtons)
}
#[inline]
pub unsafe fn GetRelatedTarget(&self, aRelatedTarget: *mut *const nsIDOMEventTarget) -> nsresult {
((*self.vtable).GetRelatedTarget)(self, aRelatedTarget)
}
#[inline]
pub unsafe fn InitMouseEvent(&self, typeArg: &::nsstring::nsAString, canBubbleArg: bool, cancelableArg: bool, viewArg: *const mozIDOMWindow, detailArg: libc::int32_t, screenXArg: libc::int32_t, screenYArg: libc::int32_t, clientXArg: libc::int32_t, clientYArg: libc::int32_t, ctrlKeyArg: bool, altKeyArg: bool, shiftKeyArg: bool, metaKeyArg: bool, buttonArg: libc::uint16_t, relatedTargetArg: *const nsIDOMEventTarget) -> nsresult {
((*self.vtable).InitMouseEvent)(self, typeArg, canBubbleArg, cancelableArg, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg)
}
#[inline]
pub unsafe fn GetMozPressure(&self, aMozPressure: *mut libc::c_float) -> nsresult {
((*self.vtable).GetMozPressure)(self, aMozPressure)
}
#[inline]
pub unsafe fn GetMozInputSource(&self, aMozInputSource: *mut libc::uint16_t) -> nsresult {
((*self.vtable).GetMozInputSource)(self, aMozInputSource)
}
#[inline]
pub unsafe fn GetModifierState(&self, keyArg: &::nsstring::nsAString, _retval: *mut bool) -> nsresult {
((*self.vtable).GetModifierState)(self, keyArg, _retval)
}
}