1
0
Fork 0
forked from AbleOS/ableos
ableos-idl/sysdata/libraries/horizon_api/src/lib.hb
2024-10-15 20:30:24 -05:00

47 lines
950 B
Plaintext

stn := @use("../../stn/src/lib.hb");
.{string, memory, buffer, log} := stn
render := @use("../../../libraries/render/src/lib.hb")
input := @use("../../intouch/src/lib.hb")
widgets := @use("widgets.hb")
WindowID := struct {
host_id: int,
window_id: int,
}
VoidWindowID := WindowID.(0, 0)
create_window := fn(channel: int): ^render.Surface {
// 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")
mem_buf := memory.request_page(1)
if windowing_system_buffer == 0 {
return 0
} else {
// msg := "\{01}\0"
// msg_length := 2
// @as(void, @eca(3, windowing_system_buffer, msg, msg_length))
x := 0
loop if x > 1000 break else x += 1
ret := buffer.recv(windowing_system_buffer, mem_buf, 4096)
if ret == 0 {
log.info("No messages\0")
}
if *mem_buf == 0 {
log.info("No messages\0")
}
return 0
}
}