diff options
-rw-r--r-- | src/lib.rs | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -38,12 +38,6 @@ pub const KEY_CTRLALT: i32 = bindings::KEY_CTRLALT as i32; pub const KEY_CTRLSHIFT: i32 = bindings::KEY_CTRLSHIFT as i32; #[derive(Debug, Copy, Clone)] -pub struct Size { - pub w: u32, - pub h: u32, -} - -#[derive(Debug, Copy, Clone)] pub struct Style { pub fg: u8, // 0-7, 9 pub bg: u8, // 0-7, 9 @@ -79,9 +73,9 @@ pub fn clear_screen() { unsafe { bindings::clearscreen(); } } -pub fn get_term_size() -> Size { +pub fn get_term_size() -> (u32, u32) { let sz = unsafe { bindings::gettermsize() }; - Size { w: sz.w as u32, h: sz.h as u32 } + (sz.w as u32, sz.h as u32) } pub fn set_style(style: Style) { @@ -120,7 +114,7 @@ pub fn print(s: &str) { s.as_bytes().as_ptr() as *const i8); } } -pub fn fillrect(lefttop: (u32, u32), size: (u32, u32), c: char) { +pub fn fill_rect(lefttop: (u32, u32), size: (u32, u32), c: char) { unsafe { bindings::fillrect( lefttop.0 as i32, lefttop.1 as i32, size.0 as i32, size.1 as i32, |