pub struct EventCtx<'a> {
pub phase: EventPhase,
pub element: ElementId,
pub state: VisualState,
pub hover_self: bool,
pub pos: Point,
pub rect: Rect,
pub environment: &'a Environment,
pub window: WindowId,
/* private fields */
}Fields§
§phase: EventPhase§element: ElementId§state: VisualState§hover_self: bool§pos: Point§rect: Rect§environment: &'a Environment§window: WindowIdImplementations§
Source§impl EventCtx<'_>
impl EventCtx<'_>
pub fn local_pos(&self) -> Point
pub fn stop_propagation(&mut self)
pub fn handled(&mut self)
pub fn capture_pointer(&mut self)
pub fn release_pointer(&mut self)
pub fn request_focus(&mut self)
pub fn begin_drag<T: 'static>(&self, payload: T, options: DragOptions)
pub fn drag_session(&self) -> Option<DragSession>
pub fn drop_position(&self, modifiers: Modifiers) -> DropPosition
pub fn cancel_drag(&mut self)
pub fn pressure(&self) -> f32
pub fn tool(&self) -> PenTool
pub fn text_width(&mut self, text: &str, size: f32) -> f32
pub fn text_width_weighted( &mut self, text: &str, size: f32, weight: FontWeight, ) -> f32
pub fn text_width_weighted_spaced( &mut self, text: &str, size: f32, weight: FontWeight, spacing: LetterSpacing, ) -> f32
pub fn caret_positions( &mut self, text: &str, size: f32, weight: FontWeight, ) -> Vec<f32>
pub fn caret_positions_spaced( &mut self, text: &str, size: f32, weight: FontWeight, spacing: LetterSpacing, ) -> Vec<f32>
pub fn char_index_from_x( &mut self, text: &str, size: f32, weight: FontWeight, x: f32, ) -> usize
pub fn char_index_from_x_spaced( &mut self, text: &str, size: f32, weight: FontWeight, x: f32, spacing: LetterSpacing, ) -> usize
pub fn shape_rich_full( &mut self, spans: &[TextSpan], size: f32, width: f32, mode: WrapMode, spacing: LetterSpacing, align: RichAlign, ) -> Rc<RichParagraph>
pub fn request_frame(&self)
pub fn hide_overlay(&self, id: OverlayId) -> bool
pub fn has_overlay(&self, id: OverlayId) -> bool
pub fn overlay_rect(&self, id: OverlayId) -> Option<Rect>
pub fn overlay_set_position(&self, id: OverlayId, x: f32, y: f32) -> bool
pub fn has_focus_within(&self) -> bool
pub fn window_rect(&self) -> Rect
pub fn window_size(&self) -> Size
pub fn scale(&self) -> f32
pub fn safe_insets(&self) -> Edges
pub fn runtime(&self) -> &Runtime
pub fn element(&self) -> ElementId
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for EventCtx<'a>
impl<'a> !Send for EventCtx<'a>
impl<'a> !Sync for EventCtx<'a>
impl<'a> !UnwindSafe for EventCtx<'a>
impl<'a> Freeze for EventCtx<'a>
impl<'a> Unpin for EventCtx<'a>
impl<'a> UnsafeUnpin for EventCtx<'a>
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