Linux Windowing Module (linux-windowing)
linux-windowing provides X11-focused wrappers and helpers for creating a
simple window, drawing basic primitives/text, and running an event loop.
x11 := import('linux-windowing')
Returns true when res contains a positive r1 field.
Normalizes success checks for mixed result shapes used by interop calls.
Helpers for managing a raw XEvent-compatible buffer.
openDisplay(displayName?)
rootWindow(display, screen)
blackPixel(display, screen)
whitePixel(display, screen)
createSimpleWindow(display, parent, x, y, width, height, borderWidth, border, background)
destroyWindow(display, window)
storeName(display, window, title)
selectInput(display, window, eventMask)
mapWindow(display, window)
unmapWindow(display, window)
moveWindow(display, window, x, y)
resizeWindow(display, window, width, height)
displayWidth(display, screen)
displayHeight(display, screen)
createGC(display, drawable, valueMask, values)
setForeground(display, gc, color)
drawLine(display, window, gc, x1, y1, x2, y2)
fillRectangle(display, window, gc, x, y, width, height)
drawString(display, window, gc, x, y, text)
nextEvent(display, eventPtr)
pumpWindowEvent(display, eventPtr)
runWindowLoop(display, eventPtr)
runWindowLoop exits with 0 when an X11 ClientMessage or
DestroyNotify event is observed.
openDefaultWindow(title, width, height)
Creates a top-level window and returns:
{
type: :ok
display: <int>
window: <int>
screen: <int>
black: <int>
white: <int>
}
Destroys and closes resources produced by openDefaultWindow.
See samples/linux-window.oak and
samples/linux-draw.oak for runnable examples.