1
0
Fork 0
forked from AbleOS/ableos
This commit is contained in:
peony 2024-11-10 12:51:51 +01:00
parent 7f920e2f65
commit 5c131eae13
5 changed files with 32 additions and 13 deletions

6
Cargo.lock generated
View file

@ -228,12 +228,12 @@ dependencies = [
[[package]]
name = "hbbytecode"
version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#42a713aeaef11ca86d96083915191fbe456c47e5"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#29a23cec0c831f9ace29d847b5356b932868508c"
[[package]]
name = "hblang"
version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#42a713aeaef11ca86d96083915191fbe456c47e5"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#29a23cec0c831f9ace29d847b5356b932868508c"
dependencies = [
"hashbrown 0.15.1",
"hbbytecode",
@ -245,7 +245,7 @@ dependencies = [
[[package]]
name = "hbvm"
version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#42a713aeaef11ca86d96083915191fbe456c47e5"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#29a23cec0c831f9ace29d847b5356b932868508c"
dependencies = [
"hbbytecode",
]

View file

@ -1,6 +0,0 @@
.{math, buffer} := @use("../../stn/src/lib.hb");
get_pos := fn(): Vec2(uint) {
}

View file

@ -27,6 +27,10 @@ main := fn(): int {
win_buff := buffer.create("XHorizon\0")
screen := render.init(true)
if screen == null {
log.error("Screen could not be initialized!\0")
return 1
}
// Clear the screen to black.
render.clear(screen, render.black)
@ -64,6 +68,26 @@ main := fn(): int {
// get input events from drivers via intouch
// key_event := intouch.recieve_key_event();
// log.info("before mouse event check\0");
{
// Note: MLokis, this inline halts the compiler forever
// mouse_event := @inline(intouch.recieve_mouse_event)
// Note: MLokis, this function returns null unless the mouse is moving
mouse_event := intouch.recieve_mouse_event()
//
if mouse_event != null {
log.warn("Mouse event recieved\0")
mouse_x += mouse_event.x_change
mouse_y += mouse_event.y_change
set_label_text(text_label, "Mouse Moved\0")
}
// render mouse
render.put_rect(screen, .(mouse_x, mouse_y), .(20, 20), render.white)
// Send events to focused window
}
// TODO: Get windows out of a collection and iter through
render.put_rect(screen, .(0, 0), .(screen.width - 1, screen.height - 1), render.white)
{

View file

@ -32,8 +32,8 @@ resolution = "1600x900x24"
# [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"
@ -48,6 +48,7 @@ resolution = "1600x900x24"
# path = "boot:///ps2_keyboard_driver.hbf"
# [boot.limine.ableos.modules.filesystem_fat32]
# [boot.limine.ableos.modules.ps2_keyboard_driv
# path = "boot:///filesystem_fat32.hbf"
# [boot.limine.ableos.modules.pumpkin_print]
@ -59,8 +60,8 @@ path = "boot:///ps2_mouse_driver.hbf"
# [boot.limine.ableos.modules.ps2_driver]
# path = "boot:///ps2_driver.hbf"
[boot.limine.ableos.modules.app_bar]
path = "boot:///app_bar.hbf"
# [boot.limine.ableos.modules.app_bar]
# path = "boot:///app_bar.hbf"
# [boot.limine.ableos.modules.test_abc]
# path = "boot:///test_abc.hbf"