2018-04-12 09:38:49 +10:00
|
|
|
-- 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.
|
|
|
|
|
2018-04-12 20:26:31 +10:00
|
|
|
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
|
|
|
|
|
2018-04-12 09:38:49 +10:00
|
|
|
-- This is released into
|
|
|
|
the public domain.
|
|
|
|
-- No warranty is provided,
|
|
|
|
implied or otherwise.
|
|
|
|
|