Compare commits
2 commits
ba59233ce7
...
7f01b0e0f8
Author | SHA1 | Date | |
---|---|---|---|
Able | 7f01b0e0f8 | ||
Able | e8edee4ccc |
6
Cargo.lock
generated
6
Cargo.lock
generated
|
@ -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",
|
||||
]
|
||||
|
|
|
@ -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
|
||||
}
|
|
@ -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,
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -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")
|
||||
|
|
1
sysdata/programs/test_abc/README.md
Normal file
1
sysdata/programs/test_abc/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
# test_abc
|
11
sysdata/programs/test_abc/meta.toml
Normal file
11
sysdata/programs/test_abc/meta.toml
Normal 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"
|
19
sysdata/programs/test_abc/src/main.hb
Normal file
19
sysdata/programs/test_abc/src/main.hb
Normal 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
|
||||
}
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue