Compare commits

..

2 commits

Author SHA1 Message Date
Able 7f01b0e0f8 👍 2024-11-07 09:57:50 -06:00
Able e8edee4ccc broken 👍 2024-11-07 09:57:39 -06:00
9 changed files with 62 additions and 21 deletions

6
Cargo.lock generated
View file

@ -264,12 +264,12 @@ dependencies = [
[[package]]
name = "hbbytecode"
version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#87cb77a553d68d45c4ade7a71cae5a56edcf686b"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#513d2c71276441d1951281eef0f27d5f94d1f738"
[[package]]
name = "hblang"
version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#87cb77a553d68d45c4ade7a71cae5a56edcf686b"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#513d2c71276441d1951281eef0f27d5f94d1f738"
dependencies = [
"hashbrown 0.15.1",
"hbbytecode",
@ -281,7 +281,7 @@ dependencies = [
[[package]]
name = "hbvm"
version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#87cb77a553d68d45c4ade7a71cae5a56edcf686b"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#513d2c71276441d1951281eef0f27d5f94d1f738"
dependencies = [
"hbbytecode",
]

View file

@ -33,7 +33,6 @@ render_label_to_surface := fn(surface: Surface, label: Label, font: Font, pos: V
new_label := fn(text: ^u8): Label {
text_surface := render.new_surface(1000, 20)
text_length := string.length(text)
widget_type := 3
label := Label.(widget_type, true, text_surface, text, text_length)
label := Label.(3, true, text_surface, text, text_length)
return label
}

View file

@ -11,7 +11,6 @@ render := @use("../../../../libraries/render/src/lib.hb");
widget_types := @use("widget_types.hb")
label := @use("label.hb")
// .{Label, render_label_to_surface, set_label_text} := label
Size := struct {
min_width: int,
@ -26,3 +25,10 @@ Vertical := packed struct {
// use a vec or linked list or whatever
children: ^^u8,
}
Horizontal := packed struct {
magic: uint,
// array of children, idk
// use a vec or linked list or whatever
children: ^^u8,
}

View file

@ -19,7 +19,7 @@ recieve_key_event := fn(): ?KeyEvent {
return null
}
recieve_mouse_event := fn(): ?^MouseEvent {
recieve_mouse_event := fn(): ?MouseEvent {
mem_page := memory.request_page(1)
buf_id := buffer.search("PS/2 Mouse\0")
@ -30,8 +30,9 @@ recieve_mouse_event := fn(): ?^MouseEvent {
dx := *mem_page
dy := *mem_page + 1
mevent := MouseEvent.(dx, dy, 0, 0, 0)
return &mevent
return mevent
}
// log.warn("No mouse events\0")
return null
}

View file

@ -50,21 +50,22 @@ main := fn(): int {
render.clear(screen, render.black)
// TODO: Read the window buffer here
{
ret := buffer.recv([u8; 4096], win_buff, mem_buf)
// for some reason this null check causes the compiler to spin forever
// if ret == null {
// log.info("No messages\0")
// } else {
// log.info("Handle Messages\0")
// }
}
// {
// ret := buffer.recv([u8; 4096], win_buff, mem_buf)
// // for some reason this null check causes the compiler to spin forever
// // if ret == null {
// // log.info("No messages\0")
// // } else {
// // log.info("Handle Messages\0")
// // }
// }
{
// get input events from drivers via intouch
// key_event := intouch.recieve_key_event()
mouse_event := intouch.recieve_mouse_event()
if mouse_event != null {
log.info("Mouse event")
mouse_x += mouse_event.x_change
mouse_y += mouse_event.y_change
set_label_text(text_label, "Mouse Moved\0")

View file

@ -0,0 +1 @@
# test_abc

View file

@ -0,0 +1,11 @@
[package]
name = "test_abc"
authors = [""]
[dependants.libraries]
[dependants.binaries]
hblang.version = "1.0.0"
[build]
command = "hblang src/main.hb"

View file

@ -0,0 +1,19 @@
stn := @use("../../../libraries/stn/src/lib.hb");
.{log} := stn
Structure := struct {}
returner_fn := fn(): ?Structure {
structure := Structure.()
return structure
}
main := fn(): int {
ret := returner_fn()
if ret != null {
log.info("not null\0")
return 1
}
return 0
}

View file

@ -37,8 +37,8 @@ resolution = "1024x768x24"
# [boot.limine.ableos.modules.serial_driver_test]
# path = "boot:///serial_driver_test.hbf"
[boot.limine.ableos.modules.horizon]
path = "boot:///horizon.hbf"
# [boot.limine.ableos.modules.horizon]
# path = "boot:///horizon.hbf"
# [boot.limine.ableos.modules.horizon_testing_program]
# path = "boot:///horizon_testing_program.hbf"
@ -58,8 +58,11 @@ path = "boot:///horizon.hbf"
# [boot.limine.ableos.modules.pumpkin_print]
# path = "boot:///pumpkin_print.hbf"
[boot.limine.ableos.modules.ps2_mouse_driver]
path = "boot:///ps2_mouse_driver.hbf"
# [boot.limine.ableos.modules.ps2_mouse_driver]
# path = "boot:///ps2_mouse_driver.hbf"
# [boot.limine.ableos.modules.app_bar]
# path = "boot:///app_bar.hbf"
# [boot.limine.ableos.modules.test_abc]
# path = "boot:///test_abc.hbf"