[][src]Trait orbtk_shell::window_adapter::WindowAdapter

pub trait WindowAdapter {
    fn mouse_position(&self) -> Point;
fn active(&mut self, active: bool);
fn run(&mut self, render_context: &mut RenderContext2D); fn resize(&mut self, _width: f64, _height: f64) { ... }
fn mouse(&mut self, _x: f64, _y: f64) { ... }
fn mouse_event(&mut self, _event: MouseEvent) { ... }
fn scroll(&mut self, _delta_x: f64, _delta_y: f64) { ... }
fn key_event(&mut self, _event: KeyEvent) { ... }
fn quit_event(&mut self) { ... } }

The WindowAdapter represents the bridge to the Shell backend. It receives events from the Window and runs it's own logic.

Required methods

fn mouse_position(&self) -> Point

Gets the current mouse position.

fn active(&mut self, active: bool)

Is called if active state of the window is changed.

fn run(&mut self, render_context: &mut RenderContext2D)

Runs the inner logic of the shell adapter.

Loading content...

Provided methods

fn resize(&mut self, _width: f64, _height: f64)

Is called after the window is resized.

fn mouse(&mut self, _x: f64, _y: f64)

Is called after the mouse was moved.

fn mouse_event(&mut self, _event: MouseEvent)

Is called after the state of a mouse button is changed.

fn scroll(&mut self, _delta_x: f64, _delta_y: f64)

Is called if mouse wheel or trackpad detect scroll event.

fn key_event(&mut self, _event: KeyEvent)

Is called after the state of a keyboard key is changed.

fn quit_event(&mut self)

Is called after the quit event of the window is called.

Loading content...

Implementors

Loading content...