Struct titanium::desktop::gui::libdruid::DruidHandler
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§
§impl<T> WinHandler for DruidHandler<T>where
T: Data,
impl<T> WinHandler for DruidHandler<T>where T: Data,
§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
§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.§fn paint(&mut self, piet: &mut CairoRenderContext<'_>, region: &Region)
fn paint(&mut self, piet: &mut CairoRenderContext<'_>, 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.§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
§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
§fn open_files(&mut self, token: FileDialogToken, file_info: Vec<FileInfo, Global>)
fn open_files(&mut self, token: FileDialogToken, file_info: Vec<FileInfo, Global>)
Called when an “Open” dialog with multiple selection is closed. Read more
§fn mouse_down(&mut self, event: &MouseEvent)
fn mouse_down(&mut self, event: &MouseEvent)
Called on mouse button down.
§fn mouse_move(&mut self, event: &MouseEvent)
fn mouse_move(&mut self, event: &MouseEvent)
Called when the mouse moves.
§fn mouse_leave(&mut self)
fn mouse_leave(&mut self)
Called when the mouse cursor has left the application window
§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.
§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).
§fn timer(&mut self, token: TimerToken)
fn timer(&mut self, token: TimerToken)
Called on timer event. Read more
§fn idle(&mut self, token: IdleToken)
fn idle(&mut self, token: IdleToken)
Called when a idle token is requested by [
IdleHandle::schedule_idle()] call.§fn as_any(&mut self) -> &mut (dyn Any + 'static)
fn as_any(&mut self) -> &mut (dyn Any + 'static)
Get a reference to the handler state. Used mostly by idle handlers.
§fn acquire_input_lock(
&mut self,
token: TextFieldToken,
mutable: bool
) -> Box<dyn InputHandler + 'static, Global>
fn acquire_input_lock( &mut self, token: TextFieldToken, mutable: bool ) -> Box<dyn InputHandler + 'static, Global>
Take a lock for the text document specified by
token. Read more§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.§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
§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).
§fn rebuild_resources(&mut self)
fn rebuild_resources(&mut self)
Called when the resources need to be rebuilt. Read more
§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§
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§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.