From 40cc412ab36ec1ed62c9bb469438acc75b42f160 Mon Sep 17 00:00:00 2001 From: Able Date: Fri, 13 Sep 2024 16:40:05 -0500 Subject: [PATCH] Horizon API work --- sysdata/libraries/horizon_api/src/element.hb | 14 ------------ sysdata/libraries/horizon_api/src/frame.hb | 3 --- sysdata/libraries/horizon_api/src/lib.hb | 22 +++++++++++++++---- sysdata/libraries/horizon_api/src/text.hb | 3 --- sysdata/programs/horizon/README.md | 3 +++ sysdata/programs/horizon/meta.toml | 11 ++++++++++ sysdata/programs/horizon/protocol/lib.idl | 6 +++++ sysdata/programs/horizon/src/main.hb | 12 ++++++++++ .../horizon_testing_program/README.md | 1 + .../horizon_testing_program/meta.toml | 11 ++++++++++ .../horizon_testing_program/src/main.hb | 12 ++++++++++ sysdata/system_config.toml | 7 ++++++ 12 files changed, 81 insertions(+), 24 deletions(-) delete mode 100644 sysdata/libraries/horizon_api/src/element.hb delete mode 100644 sysdata/libraries/horizon_api/src/frame.hb delete mode 100644 sysdata/libraries/horizon_api/src/text.hb create mode 100644 sysdata/programs/horizon/README.md create mode 100644 sysdata/programs/horizon/meta.toml create mode 100644 sysdata/programs/horizon/protocol/lib.idl create mode 100644 sysdata/programs/horizon/src/main.hb create mode 100644 sysdata/programs/horizon_testing_program/README.md create mode 100644 sysdata/programs/horizon_testing_program/meta.toml create mode 100644 sysdata/programs/horizon_testing_program/src/main.hb diff --git a/sysdata/libraries/horizon_api/src/element.hb b/sysdata/libraries/horizon_api/src/element.hb deleted file mode 100644 index 76299cce..00000000 --- a/sysdata/libraries/horizon_api/src/element.hb +++ /dev/null @@ -1,14 +0,0 @@ -Element := struct { - width: int, - height: int, - - x: u16, - y: u16, - - id: int, -} - -create_element := fn(): Element { - return Element.(0, 0, 0, 0, 0) -} - diff --git a/sysdata/libraries/horizon_api/src/frame.hb b/sysdata/libraries/horizon_api/src/frame.hb deleted file mode 100644 index 61d80629..00000000 --- a/sysdata/libraries/horizon_api/src/frame.hb +++ /dev/null @@ -1,3 +0,0 @@ -FrameID := struct { - -} \ No newline at end of file diff --git a/sysdata/libraries/horizon_api/src/lib.hb b/sysdata/libraries/horizon_api/src/lib.hb index 81aa0fa4..4611dc4f 100644 --- a/sysdata/libraries/horizon_api/src/lib.hb +++ b/sysdata/libraries/horizon_api/src/lib.hb @@ -1,12 +1,26 @@ +stn := @use("rel:../../stn/src/lib.hb") +.{string, memory, buffer} := stn + WindowID := struct { host_id: int, window_id: int, } -create_window := fn(): WindowID { - return WindowID.(1, 2) -} +create_window := fn(channel: int): void { + // get the horizon buffer + // request a new window and provide the callback buffer + // wait to recieve a message + + windowing_system_buffer := buffer.search("XHorizon\0") + + + + if windowing_system_buffer == 0 { + } else { + msg := "\{01}\0" + msg_length := 2 + @eca(void, 3, windowing_system_buffer, msg, msg_length) + } -update_ui := fn(window_id: WindowID): void { return } \ No newline at end of file diff --git a/sysdata/libraries/horizon_api/src/text.hb b/sysdata/libraries/horizon_api/src/text.hb deleted file mode 100644 index 22996c3d..00000000 --- a/sysdata/libraries/horizon_api/src/text.hb +++ /dev/null @@ -1,3 +0,0 @@ -ui_lisp_text_example := "(text id_1)\0"; - - diff --git a/sysdata/programs/horizon/README.md b/sysdata/programs/horizon/README.md new file mode 100644 index 00000000..7451b8ec --- /dev/null +++ b/sysdata/programs/horizon/README.md @@ -0,0 +1,3 @@ +# Horizon +The Horizon Windowing system server. This is the component that spawns/layouts and renders windows. +For the api look in libraries/horizon_api. diff --git a/sysdata/programs/horizon/meta.toml b/sysdata/programs/horizon/meta.toml new file mode 100644 index 00000000..ccfe1e2a --- /dev/null +++ b/sysdata/programs/horizon/meta.toml @@ -0,0 +1,11 @@ +[package] +name = "horizon" +authors = ["able"] + +[dependants.libraries] + +[dependants.binaries] +hblang.version = "1.0.0" + +[build] +command = "hblang src/main.hb" diff --git a/sysdata/programs/horizon/protocol/lib.idl b/sysdata/programs/horizon/protocol/lib.idl new file mode 100644 index 00000000..92a04820 --- /dev/null +++ b/sysdata/programs/horizon/protocol/lib.idl @@ -0,0 +1,6 @@ +alias HostID = u64; + +struct WindowID { + host_id: HostID, + window_id: u64 +} diff --git a/sysdata/programs/horizon/src/main.hb b/sysdata/programs/horizon/src/main.hb new file mode 100644 index 00000000..3c7c6317 --- /dev/null +++ b/sysdata/programs/horizon/src/main.hb @@ -0,0 +1,12 @@ +stn := @use("../../../libraries/stn/src/lib.hb"); +.{string, memory, buffer} := stn + +horizon_api := @use("../../../libraries/horizon_api/src/lib.hb") + +main := fn(): int { + a := buffer.create("XHorizon\0") + loop { + } + + return 0 +} \ No newline at end of file diff --git a/sysdata/programs/horizon_testing_program/README.md b/sysdata/programs/horizon_testing_program/README.md new file mode 100644 index 00000000..04c8af8f --- /dev/null +++ b/sysdata/programs/horizon_testing_program/README.md @@ -0,0 +1 @@ +# horizon_testing_program \ No newline at end of file diff --git a/sysdata/programs/horizon_testing_program/meta.toml b/sysdata/programs/horizon_testing_program/meta.toml new file mode 100644 index 00000000..7e360c90 --- /dev/null +++ b/sysdata/programs/horizon_testing_program/meta.toml @@ -0,0 +1,11 @@ +[package] +name = "horizon_testing_program" +authors = ["able"] + +[dependants.libraries] + +[dependants.binaries] +hblang.version = "1.0.0" + +[build] +command = "hblang src/main.hb" diff --git a/sysdata/programs/horizon_testing_program/src/main.hb b/sysdata/programs/horizon_testing_program/src/main.hb new file mode 100644 index 00000000..f665ae4a --- /dev/null +++ b/sysdata/programs/horizon_testing_program/src/main.hb @@ -0,0 +1,12 @@ +stn := @use("../../../libraries/stn/src/lib.hb"); +.{string, memory, buffer} := stn + +horizon_api := @use("../../../libraries/horizon_api/src/lib.hb"); +.{create_window} := horizon_api + +main := fn(): int { + windowing_system_buffer := buffer.create("XHorizon\0") + + create_window(windowing_system_buffer) + return 0 +} \ No newline at end of file diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index f0539ef8..cc80cab1 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -32,3 +32,10 @@ path = "boot:///fb_driver.hbf" [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_testing_program] +path = "boot:///horizon_testing_program.hbf"