From 5c131eae139464fa5e08241fb6fbb7ae01c753d7 Mon Sep 17 00:00:00 2001 From: peony Date: Sun, 10 Nov 2024 12:51:51 +0100 Subject: [PATCH] misc --- Cargo.lock | 6 +++--- sysdata/libraries/mouse/src/lib.hb | 0 sysdata/libraries/mouse/src/mouse.hb | 6 ------ sysdata/programs/horizon/src/main.hb | 24 ++++++++++++++++++++++++ sysdata/system_config.toml | 9 +++++---- 5 files changed, 32 insertions(+), 13 deletions(-) delete mode 100644 sysdata/libraries/mouse/src/lib.hb delete mode 100644 sysdata/libraries/mouse/src/mouse.hb diff --git a/Cargo.lock b/Cargo.lock index f776aab..91fa85e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", ] diff --git a/sysdata/libraries/mouse/src/lib.hb b/sysdata/libraries/mouse/src/lib.hb deleted file mode 100644 index e69de29..0000000 diff --git a/sysdata/libraries/mouse/src/mouse.hb b/sysdata/libraries/mouse/src/mouse.hb deleted file mode 100644 index 82a6d61..0000000 --- a/sysdata/libraries/mouse/src/mouse.hb +++ /dev/null @@ -1,6 +0,0 @@ -.{math, buffer} := @use("../../stn/src/lib.hb"); - -get_pos := fn(): Vec2(uint) { - -} - diff --git a/sysdata/programs/horizon/src/main.hb b/sysdata/programs/horizon/src/main.hb index d1da4b2..c900f84 100644 --- a/sysdata/programs/horizon/src/main.hb +++ b/sysdata/programs/horizon/src/main.hb @@ -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) { diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index 3096c49..9348d23 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -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"