blob: a091220c7796a14382c942c8f2e96fff92c97e53 [file] [log] [blame]
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
part of $LIBRARYNAME;
$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
factory $CLASSNAME(String type,
{Window view, int detail: 0, int screenX: 0, int screenY: 0,
int clientX: 0, int clientY: 0, int button: 0, bool canBubble: true,
bool cancelable: true, bool ctrlKey: false, bool altKey: false,
bool shiftKey: false, bool metaKey: false, EventTarget relatedTarget}) {
if (view == null) {
view = window;
}
var event = document._createEvent('MouseEvent');
event._initMouseEvent(type, canBubble, cancelable, view, detail,
screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey,
button, relatedTarget);
return event;
}
$!MEMBERS
@deprecated
int get clientX => client.x;
@deprecated
int get clientY => client.y;
@deprecated
int get offsetX => offset.x;
@deprecated
int get offsetY => offset.y;
@deprecated
int get movementX => movement.x;
@deprecated
int get movementY => movement.y;
@deprecated
int get screenX => screen.x;
@deprecated
int get screenY => screen.y;
@DomName('MouseEvent.clientX')
@DomName('MouseEvent.clientY')
Point get client => new Point/*<num>*/(_clientX, _clientY);
@DomName('MouseEvent.movementX')
@DomName('MouseEvent.movementY')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@Experimental()
Point get movement => new Point/*<num>*/(_movementX, _movementY);
/**
* The coordinates of the mouse pointer in target node coordinates.
*
* This value may vary between platforms if the target node moves
* after the event has fired or if the element has CSS transforms affecting
* it.
*/
Point get offset => new Point/*<num>*/(_offsetX, _offsetY);
@DomName('MouseEvent.screenX')
@DomName('MouseEvent.screenY')
Point get screen => new Point/*<num>*/(_screenX, _screenY);
@DomName('MouseEvent.layerX')
@DomName('MouseEvent.layerY')
Point get layer => new Point/*<num>*/(_layerX, _layerY);
@DomName('MouseEvent.pageX')
@DomName('MouseEvent.pageY')
Point get page => new Point/*<num>*/(_pageX, _pageY);
@DomName('MouseEvent.dataTransfer')
DataTransfer get dataTransfer => js.JsNative.getProperty(this, 'dataTransfer');
}