OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 class MouseEventWrappingImplementation extends UIEventWrappingImplementation imp
lements MouseEvent { | |
6 MouseEventWrappingImplementation._wrap(ptr) : super._wrap(ptr); | |
7 | |
8 factory MouseEventWrappingImplementation(String type, Window view, int detail, | |
9 int screenX, int screenY, int clientX, int clientY, int button, | |
10 [bool canBubble = true, bool cancelable = true, bool ctrlKey = false, | |
11 bool altKey = false, bool shiftKey = false, bool metaKey = false, | |
12 EventTarget relatedTarget = null]) { | |
13 final e = dom.document.createEvent("MouseEvent"); | |
14 e.initMouseEvent(type, canBubble, cancelable, LevelDom.unwrap(view), detail, | |
15 screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, | |
16 button, LevelDom.unwrap(relatedTarget)); | |
17 return LevelDom.wrapMouseEvent(e); | |
18 } | |
19 | |
20 bool get altKey() => _ptr.altKey; | |
21 | |
22 int get button() => _ptr.button; | |
23 | |
24 int get clientX() => _ptr.clientX; | |
25 | |
26 int get clientY() => _ptr.clientY; | |
27 | |
28 bool get ctrlKey() => _ptr.ctrlKey; | |
29 | |
30 Node get fromElement() => LevelDom.wrapNode(_ptr.fromElement); | |
31 | |
32 bool get metaKey() => _ptr.metaKey; | |
33 | |
34 int get offsetX() => _ptr.offsetX; | |
35 | |
36 int get offsetY() => _ptr.offsetY; | |
37 | |
38 EventTarget get relatedTarget() => LevelDom.wrapEventTarget(_ptr.relatedTarget
); | |
39 | |
40 int get screenX() => _ptr.screenX; | |
41 | |
42 int get screenY() => _ptr.screenY; | |
43 | |
44 bool get shiftKey() => _ptr.shiftKey; | |
45 | |
46 Node get toElement() => LevelDom.wrapNode(_ptr.toElement); | |
47 | |
48 int get x() => _ptr.x; | |
49 | |
50 int get y() => _ptr.y; | |
51 } | |
OLD | NEW |