1
0
Fork 0
forked from AbleOS/ableos
ableos/sysdata/libraries/horizon_api/src/lib.hb

43 lines
919 B
Plaintext
Raw Normal View History

2024-09-18 03:38:49 -05:00
stn := @use("../../stn/src/lib.hb");
2024-10-15 20:30:24 -05:00
.{string, memory, buffer, log} := stn
render := @use("../../../libraries/render/src/lib.hb")
2024-09-13 16:40:05 -05:00
2024-09-18 03:38:49 -05:00
input := @use("../../intouch/src/lib.hb")
2024-09-17 19:26:37 -05:00
2024-11-06 20:11:36 -06:00
widgets := @use("widgets/widgets.hb")
2024-11-06 11:43:40 -06:00
ui := @use("ui.hb")
2024-10-13 22:34:33 -05:00
2024-07-20 12:54:58 -05:00
WindowID := struct {
2024-12-22 20:58:28 -06:00
host_id: uint,
window_id: uint,
2024-07-20 12:54:58 -05:00
}
2024-10-13 22:34:33 -05:00
VoidWindowID := WindowID.(0, 0)
2024-12-22 20:58:28 -06:00
create_window := fn(channel: uint): ^render.Surface {
2024-09-13 16:40:05 -05:00
// get the horizon buffer
// request a new window and provide the callback buffer
// wait to recieve a message
2024-12-22 20:58:28 -06:00
windowing_system_buffer := buffer.search("XHorizon")
2024-10-15 20:30:24 -05:00
mem_buf := memory.request_page(1)
2024-09-13 16:40:05 -05:00
if windowing_system_buffer == 0 {
2024-10-25 10:37:38 -05:00
return @as(^render.Surface, idk)
2024-09-13 16:40:05 -05:00
} else {
2024-10-15 20:30:24 -05:00
x := 0
loop if x > 1000 break else x += 1
ret := buffer.recv([4096]u8, windowing_system_buffer, mem_buf)
2024-11-03 16:31:53 -06:00
if ret == null {
2024-12-22 20:58:28 -06:00
log.info("No messages")
2024-10-15 20:30:24 -05:00
}
if *mem_buf == 0 {
2024-12-22 20:58:28 -06:00
log.info("No messages")
2024-10-15 20:30:24 -05:00
}
2024-10-13 22:34:33 -05:00
2024-10-25 10:37:38 -05:00
return @as(^render.Surface, idk)
2024-09-13 16:40:05 -05:00
}
2024-12-22 20:58:28 -06:00
}