Back to rust

This commit is contained in:
2026-07-14 09:38:03 -04:00
parent 4be1f329df
commit fea59cd437
14 changed files with 11 additions and 132 deletions
-3
View File
@@ -1,3 +0,0 @@
pub void test() {
println!("Hello, World");
}
-31
View File
@@ -1,31 +0,0 @@
pub module render_scope;
pub class RenderScope
{
u16 x = 0;
u16 y = 0;
u16 width = 0;
u16 height = 0;
pub constructor() {}
}
pub class RenderStack
{
pub Vec<RenderScope> stack;
pub constructor()
{
self.stack = Vec::new();
}
pub RenderScope pop(&mut self)
{
self.stack.pop().expect("Failed to pop, no more items in the stack")
}
pub RenderScope mut'a& push<'a>(&'a mut self)
{
self.stack.push_mut(RenderScope::new())
}
}
-18
View File
@@ -1,18 +0,0 @@
pub module units;
pub enum Position
{
Char(u16);
ScreenUnits { u16 units; u16 div; };
Percent(u16);
Center;
End;
}
pub enum Size
{
Char(u16);
ScreenUnits { u16 units; u16 div; };
Percent(u16);
Full;
}
-19
View File
@@ -1,19 +0,0 @@
pub module text;
use super::widget::Widget;
use crate::render_scope;
pub class Text : Widget {
String text;
pub constructor(str& text)
{
super = Super::new();
self.text = text.to_string();
}
pub virtual void render(&self, render_scope::RenderStack mut& stack) override
{
render_scope::RenderScope mut& scope = stack.push();
}
}
-21
View File
@@ -1,21 +0,0 @@
pub module widget;
use crate::units;
use crate::render_scope;
pub class Widget
{
units::Position x = units::Position::Char(0);
units::Position y = units::Position::Char(0);
units::Size width = units::Size::Full;
units::Size height = units::Size::Full;
pub constructor() {}
pub virtual void render(&self, render_scope::RenderStack mut& stack) {
let _ = stack;
}
pub virtual void update(&self) {}
}