From 6fa1c829fd110b4f16dc42c451b77c0a43a88605 Mon Sep 17 00:00:00 2001
From: Able <abl3theabove@gmail.com>
Date: Sun, 13 Oct 2024 22:34:33 -0500
Subject: [PATCH] Horizon work

---
 sysdata/libraries/horizon_api/src/lib.hb     | 12 +++++++++---
 sysdata/libraries/horizon_api/src/widgets.hb | 20 ++++++++++++++++++++
 sysdata/libraries/ignim/src/application.hb   |  2 +-
 sysdata/libraries/intouch/src/keycodes.hb    |  2 +-
 sysdata/system_config.toml                   |  8 ++++----
 5 files changed, 35 insertions(+), 9 deletions(-)
 create mode 100644 sysdata/libraries/horizon_api/src/widgets.hb

diff --git a/sysdata/libraries/horizon_api/src/lib.hb b/sysdata/libraries/horizon_api/src/lib.hb
index c3a53ff..cc374ca 100644
--- a/sysdata/libraries/horizon_api/src/lib.hb
+++ b/sysdata/libraries/horizon_api/src/lib.hb
@@ -3,12 +3,16 @@ stn := @use("../../stn/src/lib.hb");
 
 input := @use("../../intouch/src/lib.hb")
 
+widgets := @use("widgets.hb")
+
 WindowID := struct {
 	host_id: int,
 	window_id: int,
 }
 
-create_window := fn(channel: int): void {
+VoidWindowID := WindowID.(0, 0)
+
+create_window := fn(channel: int): WindowID {
 	// get the horizon buffer
 	// request a new window and provide the callback buffer
 	// wait to recieve a message
@@ -16,10 +20,12 @@ create_window := fn(channel: int): void {
 	windowing_system_buffer := buffer.search("XHorizon\0")
 
 	if windowing_system_buffer == 0 {
-		return
+		return VoidWindowID
 	} else {
 		msg := "\{01}\0"
 		msg_length := 2
-		return @eca(3, windowing_system_buffer, msg, msg_length)
+
+		@as(void, @eca(3, windowing_system_buffer, msg, msg_length))
+		return WindowID.(1, 0)
 	}
 }
\ No newline at end of file
diff --git a/sysdata/libraries/horizon_api/src/widgets.hb b/sysdata/libraries/horizon_api/src/widgets.hb
new file mode 100644
index 0000000..04574f2
--- /dev/null
+++ b/sysdata/libraries/horizon_api/src/widgets.hb
@@ -0,0 +1,20 @@
+// Widget types
+
+// End types
+
+LayoutChildHorizontalFirst := 0
+LayoutChildVerticalFirst := 1
+
+Size := struct {
+	min_width: int,
+	max_width: int,
+	min_height: int,
+	max_height: int,
+}
+
+Widget := struct {
+	size: Size,
+	clickable: bool,
+	layout: u8,
+	a: bool,
+}
\ No newline at end of file
diff --git a/sysdata/libraries/ignim/src/application.hb b/sysdata/libraries/ignim/src/application.hb
index f3f22d8..4837740 100644
--- a/sysdata/libraries/ignim/src/application.hb
+++ b/sysdata/libraries/ignim/src/application.hb
@@ -7,7 +7,7 @@ ApplicationInfo := struct {
 	pNext: ^int,
 	application_name: ^u8,
 	application_version: int,
-	engine_name: int,
+	engine_name: ^u8,
 	engine_version: int,
 	api_version: int,
 }
diff --git a/sysdata/libraries/intouch/src/keycodes.hb b/sysdata/libraries/intouch/src/keycodes.hb
index b5fbc3d..f0273bd 100644
--- a/sysdata/libraries/intouch/src/keycodes.hb
+++ b/sysdata/libraries/intouch/src/keycodes.hb
@@ -64,4 +64,4 @@ RightSuper := KeyCode.(312)
 Mode := KeyCode.(313)
 
 /* Multi-key compose key */
-Compose := KeyCode.(314)
+Compose := KeyCode.(314)
\ No newline at end of file
diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml
index e4bd86f..b05a036 100644
--- a/sysdata/system_config.toml
+++ b/sysdata/system_config.toml
@@ -35,11 +35,11 @@ path = "boot:///render_example.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]
+path = "boot:///horizon.hbf"
 
-# [boot.limine.ableos.modules.horizon_testing_program]
-# path = "boot:///horizon_testing_program.hbf"
+[boot.limine.ableos.modules.horizon_testing_program]
+path = "boot:///horizon_testing_program.hbf"
 
 # [boot.limine.ableos.modules.dt_buffer_test]
 # path = "boot:///dt_buffer_test.hbf"