pub struct UiMain { /* private fields */ }
Expand description
The top-level handler for the UI.
This struct ultimately has ownership of all components within the UI.
It implements the WinHandler
trait of druid-win-shell, and, after the
UI is built, ownership is transferred to the window, through set_handler
in the druid-win-shell window building sequence.
Implementations
Trait Implementations
sourceimpl WinHandler for UiMain
impl WinHandler for UiMain
sourcefn connect(&self, handle: &WindowHandle)
fn connect(&self, handle: &WindowHandle)
Provide the handler with a handle to the window so that it can
invalidate or make other requests. Read more
sourcefn paint(&self, paint_ctx: &mut PaintCtx<'_>) -> bool
fn paint(&self, paint_ctx: &mut PaintCtx<'_>) -> bool
Request the handler to paint the window contents. Return value
indicates whether window is animating, i.e. whether another paint
should be scheduled for the next animation frame. Read more
sourcefn char(&self, ch: u32, mods: u32)
fn char(&self, ch: u32, mods: u32)
Called on keyboard input of a single character. This corresponds
to the WM_CHAR message. Handling of text input will continue to
evolve, we need to handle input methods and more. Read more
sourcefn keydown(&self, vk_code: i32, mods: u32) -> bool
fn keydown(&self, vk_code: i32, mods: u32) -> bool
Called on a key down event. This corresponds to the WM_KEYDOWN
message. The key code is as WM_KEYDOWN. We’ll want to add stuff
like the modifier state. Read more
sourcefn mouse_wheel(&self, delta: i32, mods: u32)
fn mouse_wheel(&self, delta: i32, mods: u32)
Called on a mouse wheel event. This corresponds to a
WM_MOUSEWHEEL
message. Read more
sourcefn mouse_hwheel(&self, delta: i32, mods: u32)
fn mouse_hwheel(&self, delta: i32, mods: u32)
Called on a mouse horizontal wheel event. This corresponds to a
WM_MOUSEHWHEEL
message. Read more
sourcefn mouse_move(&self, x: i32, y: i32, _mods: u32)
fn mouse_move(&self, x: i32, y: i32, _mods: u32)
Called when the mouse moves. Note that the x, y coordinates are
in absolute pixels. Read more
sourcefn mouse(&self, event: &MouseEvent)
fn mouse(&self, event: &MouseEvent)
Called on mouse button up or down. Note that the x, y
coordinates are in absolute pixels. Read more
sourcefn destroy(&self)
fn destroy(&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). Read more
sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Get a reference to the handler state. Used mostly by idle handlers.
sourcefn size(&self, width: u32, height: u32)
fn size(&self, width: u32, height: u32)
Called when the size of the window is changed. Note that size
is in physical pixels. Read more
sourcefn rebuild_resources(&self)
fn rebuild_resources(&self)
Called when the resources need to be rebuilt.
Auto Trait Implementations
impl !RefUnwindSafe for UiMain
impl !Send for UiMain
impl !Sync for UiMain
impl Unpin for UiMain
impl !UnwindSafe for UiMain
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more