Compare commits

..

No commits in common. "7f01b0e0f8a7d3fba371ca7b12c99732475aab1c" and "ba59233ce729d9712c24bc3ff02e14ad64262cb7" have entirely different histories.

9 changed files with 21 additions and 62 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#513d2c71276441d1951281eef0f27d5f94d1f738"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#87cb77a553d68d45c4ade7a71cae5a56edcf686b"
[[package]]
name = "hblang"
version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#513d2c71276441d1951281eef0f27d5f94d1f738"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#87cb77a553d68d45c4ade7a71cae5a56edcf686b"
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#513d2c71276441d1951281eef0f27d5f94d1f738"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#87cb77a553d68d45c4ade7a71cae5a56edcf686b"
dependencies = [
"hbbytecode",
]

View file

@ -33,6 +33,7 @@ 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)
label := Label.(3, true, text_surface, text, text_length)
widget_type := 3
label := Label.(widget_type, true, text_surface, text, text_length)
return label
}

View file

@ -11,6 +11,7 @@ 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,
@ -24,11 +25,4 @@ Vertical := packed struct {
// array of children, idk
// 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,9 +30,8 @@ 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,22 +50,21 @@ 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

@ -1 +0,0 @@
# test_abc

View file

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

View file

@ -1,19 +0,0 @@
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,11 +58,8 @@ resolution = "1024x768x24"
# [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"