#[repr(C)]pub(crate) struct MouseEvent {
uievent: UIEvent,
screen_point: Cell<Point2D<i32, CSSPixel>>,
client_point: Cell<Point2D<i32, CSSPixel>>,
page_point: Cell<Point2D<i32, CSSPixel>>,
modifiers: Cell<Modifiers>,
button: Cell<i16>,
buttons: Cell<u16>,
related_target: MutNullableDom<EventTarget>,
point_in_target: Cell<Option<Point2D<f32, CSSPixel>>>,
}
Expand description
Fields§
§uievent: UIEvent
§screen_point: Cell<Point2D<i32, CSSPixel>>
The point on the screen of where this MouseEvent
was originally triggered,
to use during the dispatch phase.
See: https://w3c.github.io/uievents/#dom-mouseevent-screenx https://w3c.github.io/uievents/#dom-mouseevent-screeny
client_point: Cell<Point2D<i32, CSSPixel>>
The point in the viewport of where this MouseEvent
was originally triggered,
to use during the dispatch phase.
See: https://w3c.github.io/uievents/#dom-mouseevent-clientx https://w3c.github.io/uievents/#dom-mouseevent-clienty
page_point: Cell<Point2D<i32, CSSPixel>>
The point in the initial containing block of where this MouseEvent
was
originally triggered to use during the dispatch phase.
See: https://w3c.github.io/uievents/#dom-mouseevent-pagex https://w3c.github.io/uievents/#dom-mouseevent-pagey
modifiers: Cell<Modifiers>
The keyboard modifiers that were active when this mouse event was triggered.
point_in_target: Cell<Option<Point2D<f32, CSSPixel>>>
Implementations§
Source§impl MouseEvent
impl MouseEvent
fn __assert_parent_type(&self)
Source§impl MouseEvent
impl MouseEvent
pub(crate) fn new_inherited() -> MouseEvent
pub(crate) fn new_uninitialized( window: &Window, can_gc: CanGc, ) -> DomRoot<MouseEvent>
fn new_uninitialized_with_proto( window: &Window, proto: Option<HandleObject<'_>>, can_gc: CanGc, ) -> DomRoot<MouseEvent>
pub(crate) fn new( window: &Window, type_: DOMString, can_bubble: EventBubbles, cancelable: EventCancelable, view: Option<&Window>, detail: i32, screen_point: Point2D<i32, CSSPixel>, client_point: Point2D<i32, CSSPixel>, page_point: Point2D<i32, CSSPixel>, modifiers: Modifiers, button: i16, buttons: u16, related_target: Option<&EventTarget>, point_in_target: Option<Point2D<f32, CSSPixel>>, can_gc: CanGc, ) -> DomRoot<MouseEvent>
fn new_with_proto( window: &Window, proto: Option<HandleObject<'_>>, type_: DOMString, can_bubble: EventBubbles, cancelable: EventCancelable, view: Option<&Window>, detail: i32, screen_point: Point2D<i32, CSSPixel>, client_point: Point2D<i32, CSSPixel>, page_point: Point2D<i32, CSSPixel>, modifiers: Modifiers, button: i16, buttons: u16, related_target: Option<&EventTarget>, point_in_target: Option<Point2D<f32, CSSPixel>>, can_gc: CanGc, ) -> DomRoot<MouseEvent>
pub(crate) fn new_simple( window: &Window, event_name: FireMouseEventType, can_bubble: EventBubbles, cancelable: EventCancelable, hit_test_result: &HitTestResult, input_event: &ConstellationInputEvent, can_gc: CanGc, ) -> DomRoot<Self>
Sourcepub(crate) fn initialize_mouse_event(
&self,
type_: DOMString,
can_bubble: EventBubbles,
cancelable: EventCancelable,
view: Option<&Window>,
detail: i32,
screen_point: Point2D<i32, CSSPixel>,
client_point: Point2D<i32, CSSPixel>,
page_point: Point2D<i32, CSSPixel>,
modifiers: Modifiers,
button: i16,
buttons: u16,
related_target: Option<&EventTarget>,
point_in_target: Option<Point2D<f32, CSSPixel>>,
)
pub(crate) fn initialize_mouse_event( &self, type_: DOMString, can_bubble: EventBubbles, cancelable: EventCancelable, view: Option<&Window>, detail: i32, screen_point: Point2D<i32, CSSPixel>, client_point: Point2D<i32, CSSPixel>, page_point: Point2D<i32, CSSPixel>, modifiers: Modifiers, button: i16, buttons: u16, related_target: Option<&EventTarget>, point_in_target: Option<Point2D<f32, CSSPixel>>, )
pub(crate) fn point_in_target(&self) -> Option<Point2D<f32, CSSPixel>>
Sourcepub(crate) fn for_platform_mouse_event(
event: MouseButtonEvent,
pressed_mouse_buttons: u16,
window: &Window,
hit_test_result: &HitTestResult,
modifiers: Modifiers,
can_gc: CanGc,
) -> DomRoot<Self>
pub(crate) fn for_platform_mouse_event( event: MouseButtonEvent, pressed_mouse_buttons: u16, window: &Window, hit_test_result: &HitTestResult, modifiers: Modifiers, can_gc: CanGc, ) -> DomRoot<Self>
Create a MouseEvent triggered by the embedder https://w3c.github.io/uievents/#create-a-cancelable-mouseevent-id
Trait Implementations§
§impl Castable for MouseEvent
impl Castable for MouseEvent
Source§impl DomObject for MouseEvent
impl DomObject for MouseEvent
Source§impl DomObjectWrap<DomTypeHolder> for MouseEvent
impl DomObjectWrap<DomTypeHolder> for MouseEvent
Source§const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::MouseEventBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::mouseevent::MouseEvent>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::mouseevent::MouseEvent>>}
const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::MouseEventBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::mouseevent::MouseEvent>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::mouseevent::MouseEvent>>}
Source§impl HasParent for MouseEvent
impl HasParent for MouseEvent
Source§impl IDLInterface for MouseEvent
impl IDLInterface for MouseEvent
Source§impl MallocSizeOf for MouseEvent
impl MallocSizeOf for MouseEvent
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl MouseEventMethods<DomTypeHolder> for MouseEvent
impl MouseEventMethods<DomTypeHolder> for MouseEvent
Source§fn Constructor(
window: &Window,
proto: Option<HandleObject<'_>>,
can_gc: CanGc,
type_: DOMString,
init: &MouseEventInit<DomTypeHolder>,
) -> Fallible<DomRoot<MouseEvent>>
fn Constructor( window: &Window, proto: Option<HandleObject<'_>>, can_gc: CanGc, type_: DOMString, init: &MouseEventInit<DomTypeHolder>, ) -> Fallible<DomRoot<MouseEvent>>
Source§fn GetRelatedTarget(&self) -> Option<DomRoot<EventTarget>>
fn GetRelatedTarget(&self) -> Option<DomRoot<EventTarget>>
Source§fn InitMouseEvent(
&self,
type_arg: DOMString,
can_bubble_arg: bool,
cancelable_arg: bool,
view_arg: Option<&Window>,
detail_arg: i32,
screen_x_arg: i32,
screen_y_arg: i32,
client_x_arg: i32,
client_y_arg: i32,
ctrl_key_arg: bool,
alt_key_arg: bool,
shift_key_arg: bool,
meta_key_arg: bool,
button_arg: i16,
related_target_arg: Option<&EventTarget>,
)
fn InitMouseEvent( &self, type_arg: DOMString, can_bubble_arg: bool, cancelable_arg: bool, view_arg: Option<&Window>, detail_arg: i32, screen_x_arg: i32, screen_y_arg: i32, client_x_arg: i32, client_y_arg: i32, ctrl_key_arg: bool, alt_key_arg: bool, shift_key_arg: bool, meta_key_arg: bool, button_arg: i16, related_target_arg: Option<&EventTarget>, )
Source§fn GetModifierState(&self, key_arg: DOMString) -> bool
fn GetModifierState(&self, key_arg: DOMString) -> bool
fn Which(&self) -> i32
Source§impl MutDomObject for MouseEvent
impl MutDomObject for MouseEvent
Source§impl PartialEq for MouseEvent
impl PartialEq for MouseEvent
Source§impl ToJSValConvertible for MouseEvent
impl ToJSValConvertible for MouseEvent
impl DerivedFrom<Event> for MouseEvent
impl DerivedFrom<MouseEvent> for MouseEvent
impl DerivedFrom<MouseEvent> for PointerEvent
impl DerivedFrom<MouseEvent> for WheelEvent
impl DerivedFrom<UIEvent> for MouseEvent
impl Eq for MouseEvent
Auto Trait Implementations§
impl !Freeze for MouseEvent
impl !RefUnwindSafe for MouseEvent
impl !Send for MouseEvent
impl !Sync for MouseEvent
impl Unpin for MouseEvent
impl !UnwindSafe for MouseEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
GlobalScope
] of the realm that the DomObject
was created in. If this
object is a Node
, this will be different from it’s owning Document
if adopted by. For
Node
s it’s almost always better to use NodeTraits::owning_global
.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more