From e8edee4ccc5d741ab7e34850265b5585ed72ce49 Mon Sep 17 00:00:00 2001 From: Able Date: Thu, 7 Nov 2024 09:57:39 -0600 Subject: [PATCH] broken :thumbsup: --- Cargo.lock | 6 +++--- .../libraries/horizon_api/src/widgets/label.hb | 3 +-- .../horizon_api/src/widgets/widgets.hb | 8 +++++++- sysdata/libraries/intouch/src/lib.hb | 5 +++-- sysdata/programs/horizon/src/main.hb | 18 +++++++++--------- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 680a1a51..fb7bb7e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", ] diff --git a/sysdata/libraries/horizon_api/src/widgets/label.hb b/sysdata/libraries/horizon_api/src/widgets/label.hb index 3a44b397..5a02f157 100644 --- a/sysdata/libraries/horizon_api/src/widgets/label.hb +++ b/sysdata/libraries/horizon_api/src/widgets/label.hb @@ -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 } \ No newline at end of file diff --git a/sysdata/libraries/horizon_api/src/widgets/widgets.hb b/sysdata/libraries/horizon_api/src/widgets/widgets.hb index c9aca72a..2cda29ab 100644 --- a/sysdata/libraries/horizon_api/src/widgets/widgets.hb +++ b/sysdata/libraries/horizon_api/src/widgets/widgets.hb @@ -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, @@ -25,4 +24,11 @@ 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, } \ No newline at end of file diff --git a/sysdata/libraries/intouch/src/lib.hb b/sysdata/libraries/intouch/src/lib.hb index d57177ad..b6d751ca 100644 --- a/sysdata/libraries/intouch/src/lib.hb +++ b/sysdata/libraries/intouch/src/lib.hb @@ -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 } \ No newline at end of file diff --git a/sysdata/programs/horizon/src/main.hb b/sysdata/programs/horizon/src/main.hb index cf9a000e..0f593285 100644 --- a/sysdata/programs/horizon/src/main.hb +++ b/sysdata/programs/horizon/src/main.hb @@ -50,15 +50,15 @@ 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