Skip to main content

TheTrait

Trait TheTrait 

Source
pub trait TheTrait {
Show 33 methods // Required method fn new() -> Self where Self: Sized; // Provided methods fn init(&mut self, ctx: &mut TheContext) { ... } fn default_window_size(&self) -> (usize, usize) { ... } fn min_window_size(&self) -> (usize, usize) { ... } fn default_window_position(&self) -> Option<(i32, i32)> { ... } fn window_title(&self) -> String { ... } fn target_fps(&self) -> f64 { ... } fn window_icon(&self) -> Option<(Vec<u8>, u32, u32)> { ... } fn set_cmd_line_args_early(&mut self, args: Vec<String>) { ... } fn set_cmd_line_args(&mut self, args: Vec<String>, ctx: &mut TheContext) { ... } fn draw(&mut self, pixels: &mut [u8], ctx: &mut TheContext) { ... } fn update(&mut self, ctx: &mut TheContext) -> bool { ... } fn touch_down(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool { ... } fn touch_dragged(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool { ... } fn touch_up(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool { ... } fn hover(&mut self, _x: f32, _y: f32, ctx: &mut TheContext) -> bool { ... } fn key_down( &mut self, char: Option<char>, key: Option<TheKeyCode>, ctx: &mut TheContext, ) -> bool { ... } fn key_up( &mut self, char: Option<char>, key: Option<TheKeyCode>, ctx: &mut TheContext, ) -> bool { ... } fn mouse_wheel( &mut self, delta: (isize, isize), ctx: &mut TheContext, ) -> bool { ... } fn modifier_changed( &mut self, shift: bool, ctrl: bool, alt: bool, logo: bool, ) -> bool { ... } fn dropped_file(&mut self, _path: String) -> bool { ... } fn closing(&self) -> bool { ... } fn open(&mut self) { ... } fn save(&mut self) { ... } fn save_as(&mut self) { ... } fn cut(&mut self) -> String { ... } fn copy(&mut self) -> String { ... } fn paste(&mut self, text: String) { ... } fn undo(&mut self) { ... } fn redo(&mut self) { ... } fn has_changes(&self) -> bool { ... } fn window_moved(&mut self, _x: i32, _y: i32) { ... } fn window_resized(&mut self, _width: usize, _height: usize) { ... }
}

Required Methods§

Source

fn new() -> Self
where Self: Sized,

Provided Methods§

Source

fn init(&mut self, ctx: &mut TheContext)

Source

fn default_window_size(&self) -> (usize, usize)

Source

fn min_window_size(&self) -> (usize, usize)

Minimum resizable window size. Defaults to default_window_size() but can be overridden independently.

Source

fn default_window_position(&self) -> Option<(i32, i32)>

Source

fn window_title(&self) -> String

Source

fn target_fps(&self) -> f64

Source

fn window_icon(&self) -> Option<(Vec<u8>, u32, u32)>

Source

fn set_cmd_line_args_early(&mut self, args: Vec<String>)

Source

fn set_cmd_line_args(&mut self, args: Vec<String>, ctx: &mut TheContext)

Source

fn draw(&mut self, pixels: &mut [u8], ctx: &mut TheContext)

Source

fn update(&mut self, ctx: &mut TheContext) -> bool

Source

fn touch_down(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool

Source

fn touch_dragged(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool

Source

fn touch_up(&mut self, x: f32, y: f32, ctx: &mut TheContext) -> bool

Source

fn hover(&mut self, _x: f32, _y: f32, ctx: &mut TheContext) -> bool

Source

fn key_down( &mut self, char: Option<char>, key: Option<TheKeyCode>, ctx: &mut TheContext, ) -> bool

Source

fn key_up( &mut self, char: Option<char>, key: Option<TheKeyCode>, ctx: &mut TheContext, ) -> bool

Source

fn mouse_wheel(&mut self, delta: (isize, isize), ctx: &mut TheContext) -> bool

Source

fn modifier_changed( &mut self, shift: bool, ctrl: bool, alt: bool, logo: bool, ) -> bool

Source

fn dropped_file(&mut self, _path: String) -> bool

Source

fn closing(&self) -> bool

Source

fn open(&mut self)

Open a file requester

Source

fn save(&mut self)

Save the file

Source

fn save_as(&mut self)

Save the file as…

Source

fn cut(&mut self) -> String

Source

fn copy(&mut self) -> String

Source

fn paste(&mut self, text: String)

Source

fn undo(&mut self)

Source

fn redo(&mut self)

Source

fn has_changes(&self) -> bool

Returns true if the app has internal changes.

Source

fn window_moved(&mut self, _x: i32, _y: i32)

Source

fn window_resized(&mut self, _width: usize, _height: usize)

Implementors§