ableos/sysdata/libraries/horizon_api/src/lib.hb

31 lines
649 B
Plaintext
Raw Normal View History

2024-09-18 03:38:49 -05:00
stn := @use("../../stn/src/lib.hb");
2024-09-13 16:40:05 -05:00
.{string, memory, buffer} := stn
2024-09-18 03:38:49 -05:00
input := @use("../../intouch/src/lib.hb")
2024-09-17 19:26:37 -05:00
2024-10-13 22:34:33 -05:00
widgets := @use("widgets.hb")
2024-07-20 12:54:58 -05:00
WindowID := struct {
host_id: int,
window_id: int,
}
2024-10-13 22:34:33 -05:00
VoidWindowID := WindowID.(0, 0)
create_window := fn(channel: int): WindowID {
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
windowing_system_buffer := buffer.search("XHorizon\0")
if windowing_system_buffer == 0 {
2024-10-13 22:34:33 -05:00
return VoidWindowID
2024-09-13 16:40:05 -05:00
} else {
msg := "\{01}\0"
msg_length := 2
2024-10-13 22:34:33 -05:00
@as(void, @eca(3, windowing_system_buffer, msg, msg_length))
return WindowID.(1, 0)
2024-09-13 16:40:05 -05:00
}
2024-07-21 06:47:25 -05:00
}