mirror of
https://github.com/20kdc/OC-KittenOS.git
synced 2024-12-27 19:38:06 +11:00
61 lines
1.4 KiB
Plaintext
61 lines
1.4 KiB
Plaintext
-- x.neo.pub.window @ sys-everest --
|
|
|
|
This API is the reference definition
|
|
of how the windowing system works in
|
|
KittenOS NEO.
|
|
|
|
Implementing this API, by definition,
|
|
makes your process the controller of
|
|
windowing on the system, which means
|
|
you control Icecap security dialogs.
|
|
|
|
...and that's why r.neo.* access is
|
|
heavily restricted unless the user
|
|
uses the Advanced Settings panel.
|
|
|
|
The API gives you a function:
|
|
(w, h, title) -> window
|
|
|
|
This function creates a window.
|
|
|
|
Window fields:
|
|
|
|
id: Window ID.
|
|
setSize(w, h): Changes the size of
|
|
the window, and sends the line
|
|
events (even if the size doesn't
|
|
change)
|
|
getDepth(): Returns the depth of the
|
|
screen the window is on.
|
|
span(x, y, text, bg, fg): Draws a
|
|
span onto the screen.
|
|
This function will error if the
|
|
Everest instance is dead.
|
|
(Others won't.)
|
|
recommendPalette(pal): If the window
|
|
is focused, sets the first #pal
|
|
palette entries to the given RGB
|
|
values.
|
|
This is meant only as a hint to
|
|
Everest, and may be ignored.
|
|
Returns 0.
|
|
close(): Close the window.
|
|
|
|
Events:
|
|
|
|
api, id, "key", ka, kc, down
|
|
api, id, "touch"/"drag"/"drop",
|
|
lx, ly, ix, iy, button
|
|
api, id, "scroll",
|
|
lx, ly, ix, iy, amount
|
|
api, id, "clipboard", text
|
|
api, id, "close"
|
|
api, id, "focus", hasFocus
|
|
api, id, "line", lineIndex
|
|
|
|
-- This is released into
|
|
the public domain.
|
|
-- No warranty is provided,
|
|
implied or otherwise.
|
|
|