pub struct WindowHandler { /* private fields */ }Implementations§
Source§impl WindowHandler
impl WindowHandler
pub fn new<W: Widget + 'static>(widget: W) -> Self
Sourcepub fn schedule_update(&mut self)
pub fn schedule_update(&mut self)
Will schedule an update for the next frame.
Trait Implementations§
Source§impl AppHandler for WindowHandler
impl AppHandler for WindowHandler
Source§impl FruiWindowHandler for WindowHandler
impl FruiWindowHandler for WindowHandler
fn connect(&mut self, handle: &WindowHandle)
fn prepare_paint(&mut self)
fn paint(&mut self, piet: &mut PaintContext<'_>, _invalid: &Region)
fn size(&mut self, size: Size)
fn idle(&mut self, _token: IdleToken)
fn destroy(&mut self)
fn as_any(&mut self) -> &mut dyn Any
fn mouse_down(&mut self, event: &MouseEvent)
fn mouse_move(&mut self, event: &MouseEvent)
fn mouse_up(&mut self, event: &MouseEvent)
fn wheel(&mut self, event: &MouseEvent)
fn key_down(&mut self, event: KeyEvent) -> bool
Source§impl WinHandler for WindowHandler
impl WinHandler for WindowHandler
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<'_>, invalid: &Region)
fn paint(&mut self, piet: &mut Piet<'_>, invalid: &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 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 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 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 mouse_down(&mut self, event: &MouseEvent)
fn mouse_down(&mut self, event: &MouseEvent)
Called on mouse button down.
Source§fn mouse_move(&mut self, event: &MouseEvent)
fn mouse_move(&mut self, event: &MouseEvent)
Called when the mouse moves.
Source§fn mouse_up(&mut self, event: &MouseEvent)
fn mouse_up(&mut self, event: &MouseEvent)
Called on mouse button up.
Source§fn wheel(&mut self, event: &MouseEvent)
fn wheel(&mut self, event: &MouseEvent)
Called on a mouse wheel event. Read more
Source§fn rebuild_resources(&mut self)
fn rebuild_resources(&mut self)
Called when the resources need to be rebuilt. Read more
Source§fn save_as(&mut self, token: FileDialogToken, file: Option<FileInfo>)
fn save_as(&mut self, token: FileDialogToken, file: Option<FileInfo>)
Called when a “Save As” dialog is closed. Read more
Source§fn open_file(&mut self, token: FileDialogToken, file: Option<FileInfo>)
fn open_file(&mut self, token: FileDialogToken, file: Option<FileInfo>)
Called when an “Open” dialog is closed. Read more
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 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 mouse_leave(&mut self)
fn mouse_leave(&mut self)
Called when the mouse cursor has left the application window
Source§fn timer(&mut self, token: TimerToken)
fn timer(&mut self, token: TimerToken)
Called on timer event. Read more
Source§fn lost_focus(&mut self)
fn lost_focus(&mut self)
Called when this window stops being the focused window.
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
Auto Trait Implementations§
impl !Freeze for WindowHandler
impl !Immutable for WindowHandler
impl !RefUnwindSafe for WindowHandler
impl !Send for WindowHandler
impl !Sync for WindowHandler
impl Unpin for WindowHandler
impl !UnwindSafe for WindowHandler
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