forked from AbleOS/ableos
43 lines
919 B
Plaintext
43 lines
919 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/widgets.hb")
|
|
ui := @use("ui.hb")
|
|
|
|
WindowID := struct {
|
|
host_id: uint,
|
|
window_id: uint,
|
|
}
|
|
|
|
VoidWindowID := WindowID.(0, 0)
|
|
|
|
create_window := fn(channel: uint): ^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")
|
|
mem_buf := memory.request_page(1)
|
|
|
|
if windowing_system_buffer == 0 {
|
|
return @as(^render.Surface, idk)
|
|
} else {
|
|
x := 0
|
|
loop if x > 1000 break else x += 1
|
|
|
|
ret := buffer.recv([4096]u8, windowing_system_buffer, mem_buf)
|
|
if ret == null {
|
|
log.info("No messages")
|
|
}
|
|
|
|
if *mem_buf == 0 {
|
|
log.info("No messages")
|
|
}
|
|
|
|
return @as(^render.Surface, idk)
|
|
}
|
|
} |