pub struct Frame { /* private fields */ }
Expand description
The Frame
struct is the building block for all future
widgets inside of Oxide. Objects of Frame
abstract away
the actual creation and drawing of areas of a terminal,
because this process is the same for all widgets. Every
widget should contain one Frame
type to be used to render
text to the screen
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn new(cols: usize, rows: usize) -> Frame
pub fn new(cols: usize, rows: usize) -> Frame
Constructs a new Frame object with a width of cols
and height of rows
Sourcepub fn draw_into(&self, cells: &mut dyn CellAccessor)
pub fn draw_into(&self, cells: &mut dyn CellAccessor)
Draw the buffer contained inside of the base object to a valid object that implements CellAccessor.
pub fn resize(&mut self, new_size: Size)
Trait Implementations§
Source§impl Alignable for Frame
impl Alignable for Frame
fn halign( &mut self, parent: &dyn HasSize, halign: HorizontalAlign, margin: usize, )
fn valign(&mut self, parent: &dyn HasSize, valign: VerticalAlign, margin: usize)
fn align( &mut self, parent: &dyn HasSize, halign: HorizontalAlign, valign: VerticalAlign, margin: (usize, usize), )
Source§impl CellAccessor for Frame
impl CellAccessor for Frame
fn cellvec(&self) -> &Vec<Cell>
fn cellvec_mut(&mut self) -> &mut Vec<Cell>
fn pos_to_index(&self, x: usize, y: usize) -> Option<usize>
Source§impl HasPosition for Frame
impl HasPosition for Frame
Auto Trait Implementations§
impl Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnwindSafe for Frame
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
Source§impl<T> Painter for Twhere
T: CellAccessor,
impl<T> Painter for Twhere
T: CellAccessor,
Source§fn printline_with_cell(&mut self, x: usize, y: usize, line: &str, cell: Cell)
fn printline_with_cell(&mut self, x: usize, y: usize, line: &str, cell: Cell)
Prints a string at the specified position. Read more
Source§fn printline(&mut self, x: usize, y: usize, line: &str)
fn printline(&mut self, x: usize, y: usize, line: &str)
Prints a string at the specified position. Read more
Source§fn halign_line(
&self,
line: &str,
halign: HorizontalAlign,
margin: usize,
) -> usize
fn halign_line( &self, line: &str, halign: HorizontalAlign, margin: usize, ) -> usize
Source§fn valign_line(&self, line: &str, valign: VerticalAlign, margin: usize) -> usize
fn valign_line(&self, line: &str, valign: VerticalAlign, margin: usize) -> usize
fn repeat_cell( &mut self, x: usize, y: usize, orientation: Orientation, count: usize, cell: Cell, )
fn draw_box(&mut self)
Source§impl<T> Painter for Twhere
T: CellAccessor,
impl<T> Painter for Twhere
T: CellAccessor,
Source§fn printline_with_cell(&mut self, x: usize, y: usize, line: &str, cell: Cell)
fn printline_with_cell(&mut self, x: usize, y: usize, line: &str, cell: Cell)
Prints a string at the specified position. Read more
Source§fn printline(&mut self, x: usize, y: usize, line: &str)
fn printline(&mut self, x: usize, y: usize, line: &str)
Prints a string at the specified position. Read more