Struct druid::DruidHandler
source · pub struct DruidHandler<T> { /* private fields */ }
Expand description
The struct implements the druid-shell
WinHandler
trait.
One DruidHandler
exists per window.
This is something of an internal detail and possibly we don’t want to surface it publicly.
Trait Implementations§
source§impl<T: Data> WinHandler for DruidHandler<T>
impl<T: Data> WinHandler for DruidHandler<T>
source§fn connect(&mut self, handle: &WindowHandle)
fn connect(&mut self, handle: &WindowHandle)
Provide the handler with a handle to the window so that it can
invalidate or make other requests. Read more
source§fn prepare_paint(&mut self)
fn prepare_paint(&mut self)
Request the handler to prepare to paint the window contents. In particular, if there are
any regions that need to be repainted on the next call to
paint
, the handler should
invalidate those regions by calling WindowHandle::invalidate_rect
or
WindowHandle::invalidate
.source§fn paint(&mut self, piet: &mut Piet<'_>, region: &Region)
fn paint(&mut self, piet: &mut Piet<'_>, region: &Region)
Request the handler to paint the window contents.
invalid
is the region in display
points that needs to be repainted; painting outside the invalid region will
have no effect.source§fn save_as(&mut self, token: FileDialogToken, file_info: Option<FileInfo>)
fn save_as(&mut self, token: FileDialogToken, file_info: Option<FileInfo>)
Called when a “Save As” dialog is closed. Read more
source§fn open_file(&mut self, token: FileDialogToken, file_info: Option<FileInfo>)
fn open_file(&mut self, token: FileDialogToken, file_info: Option<FileInfo>)
Called when an “Open” dialog is closed. Read more
source§fn open_files(&mut self, token: FileDialogToken, file_info: Vec<FileInfo>)
fn open_files(&mut self, token: FileDialogToken, file_info: Vec<FileInfo>)
Called when an “Open” dialog with multiple selection is closed. Read more
source§fn mouse_down(&mut self, event: &MouseEvent)
fn mouse_down(&mut self, event: &MouseEvent)
Called on mouse button down.
source§fn mouse_up(&mut self, event: &MouseEvent)
fn mouse_up(&mut self, event: &MouseEvent)
Called on mouse button up.
source§fn mouse_move(&mut self, event: &MouseEvent)
fn mouse_move(&mut self, event: &MouseEvent)
Called when the mouse moves.
source§fn mouse_leave(&mut self)
fn mouse_leave(&mut self)
Called when the mouse cursor has left the application window
source§fn key_up(&mut self, event: KeyEvent)
fn key_up(&mut self, event: KeyEvent)
Called when a key is released. This corresponds to the WM_KEYUP message
on Windows, or keyUp(withEvent:) on macOS.
source§fn wheel(&mut self, event: &MouseEvent)
fn wheel(&mut self, event: &MouseEvent)
Called on a mouse wheel event. Read more
source§fn zoom(&mut self, delta: f64)
fn zoom(&mut self, delta: f64)
Called when a platform-defined zoom gesture occurs (such as pinching
on the trackpad).
source§fn timer(&mut self, token: TimerToken)
fn timer(&mut self, token: TimerToken)
Called on timer event. Read more
source§fn idle(&mut self, token: IdleToken)
fn idle(&mut self, token: IdleToken)
Called when a idle token is requested by
IdleHandle::schedule_idle()
call.source§fn as_any(&mut self) -> &mut dyn Any
fn as_any(&mut self) -> &mut dyn Any
Get a reference to the handler state. Used mostly by idle handlers.
source§fn acquire_input_lock(
&mut self,
token: TextFieldToken,
mutable: bool
) -> Box<dyn InputHandler>
fn acquire_input_lock( &mut self, token: TextFieldToken, mutable: bool ) -> Box<dyn InputHandler>
Take a lock for the text document specified by
token
. Read moresource§fn release_input_lock(&mut self, token: TextFieldToken)
fn release_input_lock(&mut self, token: TextFieldToken)
Release a lock previously acquired by
acquire_input_lock
.source§fn request_close(&mut self)
fn request_close(&mut self)
Called when the shell requests to close the window, for example because the user clicked
the little “X” in the titlebar. Read more
source§fn destroy(&mut self)
fn destroy(&mut self)
Called when the window is being destroyed. Note that this happens
earlier in the sequence than drop (at WM_DESTROY, while the latter is
WM_NCDESTROY).
source§fn rebuild_resources(&mut self)
fn rebuild_resources(&mut self)
Called when the resources need to be rebuilt. Read more
source§fn lost_focus(&mut self)
fn lost_focus(&mut self)
Called when this window stops being the focused window.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for DruidHandler<T>
impl<T> !Send for DruidHandler<T>
impl<T> !Sync for DruidHandler<T>
impl<T> Unpin for DruidHandler<T>
impl<T> !UnwindSafe for DruidHandler<T>
Blanket Implementations§
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>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.