worked on rendering code
worked on code for libgui for rendering a user interface
This commit is contained in:
@@ -19,7 +19,7 @@ extern "x86-interrupt" fn double_fault_handler(stack_frame: InterruptStackFrame,
|
||||
panic!("EXCEPTION: double fault\n{:#?}", stack_frame)
|
||||
}
|
||||
|
||||
extern "x86-interrupt" fn timer_interrupt_handler(stack_frame: InterruptStackFrame) {
|
||||
extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFrame) {
|
||||
unsafe {
|
||||
GLOBALTIMER.lock().inc();
|
||||
PICS.lock().notify_end_of_interrupt(InterruptIndex::Timer.as_u8());
|
||||
|
||||
@@ -186,7 +186,10 @@ impl Renderer {
|
||||
'┐' => 191,
|
||||
'└' => 192,
|
||||
'┘' => 217,
|
||||
'┌' => 218,
|
||||
'┌' => 218,
|
||||
'┼' => 197,
|
||||
'░' => 176,
|
||||
'▓' => 178,
|
||||
_ => { return None; }
|
||||
};
|
||||
Some(res)
|
||||
|
||||
@@ -52,11 +52,14 @@ pub struct Element {
|
||||
frame: Vec<Vec<char>>,
|
||||
dimensions: (u8, u8)
|
||||
}
|
||||
|
||||
/// elements can be created using their from_str() method
|
||||
/// you can then render the element to the current frame using the render() method
|
||||
/// the position of the element by passing a tuple (x,y) to render()
|
||||
///
|
||||
/// nothing will appear on the screen until the frame is actually
|
||||
/// nothing will appear on the screen until the frame is actually rendered by
|
||||
/// the render_frame method on the renderer
|
||||
|
||||
impl Element {
|
||||
pub fn from_str(elemstr: String) -> Self {
|
||||
let mut element = Element { frame: Vec::<Vec<char>>::new(), dimensions: (0, 0) };
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
use alloc::{boxed::Box, string::{String, ToString}, vec::Vec};
|
||||
use alloc::{string::{String, ToString}, vec::Vec};
|
||||
use rand::{Rng, SeedableRng, rngs::SmallRng, RngCore};
|
||||
use spin::Mutex;
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
Reference in New Issue
Block a user