#[repr(C)]pub(crate) struct MouseEvent {Show 19 fields
uievent: UIEvent,
screen_x: Cell<i32>,
screen_y: Cell<i32>,
client_x: Cell<i32>,
client_y: Cell<i32>,
page_x: Cell<i32>,
page_y: Cell<i32>,
x: Cell<i32>,
y: Cell<i32>,
offset_x: Cell<i32>,
offset_y: Cell<i32>,
ctrl_key: Cell<bool>,
shift_key: Cell<bool>,
alt_key: Cell<bool>,
meta_key: Cell<bool>,
button: Cell<i16>,
buttons: Cell<u16>,
related_target: MutNullableDom<EventTarget>,
point_in_target: Cell<Option<Point2D<f32>>>,
}
Expand description
Fields§
§uievent: UIEvent
§screen_x: Cell<i32>
§screen_y: Cell<i32>
§client_x: Cell<i32>
§client_y: Cell<i32>
§page_x: Cell<i32>
§page_y: Cell<i32>
§x: Cell<i32>
§y: Cell<i32>
§offset_x: Cell<i32>
§offset_y: Cell<i32>
§ctrl_key: Cell<bool>
§shift_key: Cell<bool>
§alt_key: Cell<bool>
§meta_key: Cell<bool>
§point_in_target: Cell<Option<Point2D<f32>>>
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_x: i32, screen_y: i32, client_x: i32, client_y: i32, ctrl_key: bool, alt_key: bool, shift_key: bool, meta_key: bool, button: i16, buttons: u16, related_target: Option<&EventTarget>, point_in_target: Option<Point2D<f32>>, 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_x: i32, screen_y: i32, client_x: i32, client_y: i32, ctrl_key: bool, alt_key: bool, shift_key: bool, meta_key: bool, button: i16, buttons: u16, related_target: Option<&EventTarget>, point_in_target: Option<Point2D<f32>>, can_gc: CanGc, ) -> DomRoot<MouseEvent>
Sourcepub(crate) fn initialize_mouse_event(
&self,
type_: DOMString,
can_bubble: EventBubbles,
cancelable: EventCancelable,
view: Option<&Window>,
detail: i32,
screen_x: i32,
screen_y: i32,
client_x: i32,
client_y: i32,
ctrl_key: bool,
alt_key: bool,
shift_key: bool,
meta_key: bool,
button: i16,
buttons: u16,
related_target: Option<&EventTarget>,
point_in_target: Option<Point2D<f32>>,
)
pub(crate) fn initialize_mouse_event( &self, type_: DOMString, can_bubble: EventBubbles, cancelable: EventCancelable, view: Option<&Window>, detail: i32, screen_x: i32, screen_y: i32, client_x: i32, client_y: i32, ctrl_key: bool, alt_key: bool, shift_key: bool, meta_key: bool, button: i16, buttons: u16, related_target: Option<&EventTarget>, point_in_target: Option<Point2D<f32>>, )
pub(crate) fn point_in_target(&self) -> Option<Point2D<f32>>
Sourcepub(crate) fn for_platform_mouse_event(
event: MouseButtonEvent,
pressed_mouse_buttons: u16,
window: &Window,
hit_test_result: &CompositorHitTestResult,
can_gc: CanGc,
) -> DomRoot<Self>
pub(crate) fn for_platform_mouse_event( event: MouseButtonEvent, pressed_mouse_buttons: u16, window: &Window, hit_test_result: &CompositorHitTestResult, can_gc: CanGc, ) -> DomRoot<Self>
Create a MouseEvent triggered by the embedder
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>>}
Function pointer to the general wrap function type
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
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
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>, )
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
Mutably borrows from an owned value. Read more
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,
Returns the [
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§fn global(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
Returns the [
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
Compare self to
key
and return true
if they are equal.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
Compare self to
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>
Creates a filterable data provider with the given name for debugging. Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert