Horizon API work

This commit is contained in:
Able 2024-09-13 16:40:05 -05:00
parent cd369b39d5
commit 40cc412ab3
12 changed files with 81 additions and 24 deletions

View file

@ -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)
}

View file

@ -1,3 +0,0 @@
FrameID := struct {
}

View file

@ -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
}

View file

@ -1,3 +0,0 @@
ui_lisp_text_example := "(text id_1)\0";

View file

@ -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.

View file

@ -0,0 +1,11 @@
[package]
name = "horizon"
authors = ["able"]
[dependants.libraries]
[dependants.binaries]
hblang.version = "1.0.0"
[build]
command = "hblang src/main.hb"

View file

@ -0,0 +1,6 @@
alias HostID = u64;
struct WindowID {
host_id: HostID,
window_id: u64
}

View file

@ -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
}

View file

@ -0,0 +1 @@
# horizon_testing_program

View file

@ -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"

View file

@ -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
}

View file

@ -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"