Back to rust
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
[package]
|
||||
name = "pulse-ui"
|
||||
version = "0.1.0-alpha.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
[lib]
|
||||
name = "pulse_ui"
|
||||
path = ".mist/src/lib.rs"
|
||||
@@ -1,3 +0,0 @@
|
||||
package = "lib.mist"
|
||||
packages = []
|
||||
include = []
|
||||
@@ -1,3 +0,0 @@
|
||||
pub void test() {
|
||||
println!("Hello, World");
|
||||
}
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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) {}
|
||||
}
|
||||
Reference in New Issue
Block a user