Class Framebuffer
Constructors
constructor
-
Parameters
- index: number
- width: number
- height: number
- _sink: PixelSink
Returns Framebuffer
Properties
copiedText
cursor
Where the next read or write on the node starts, in bytes
dropOffset
height
incomingDrop
incomingPaste
Text the user pasted and a drop on the window, waiting for the program to take them (see FBIO_GETPASTE)
Readonlyindex
pasteOffset
pixels
pointerCursor
OptionalpointerImage
A cursor image the program drew; it shows in place of pointerCursor until the program sends another or none
presents
stride
width
windowControl
The state of the window the screen is shown in; set by Framebuffers.create
Accessors
closed
-
get closed(): boolean
Returns boolean
path
-
get path(): string
Returns string
size
-
get size(): number
Returns number
Methods
accepts
-
Whether
info(afb_var_screeninfoa program sets) asks for the mode the screen is inParameters
- info: Uint8Array
Returns boolean
close
-
Returns void
fixScreenInfo
-
struct fb_fix_screeninfoas a 32-bit program lays it outReturns Uint8Array
flush
-
Shows the pixels now
Returns void
present
-
Shows the pixels as they are now, soon: changes made in quick succession are one frame
Returns void
read
-
Copies pixels out from the cursor and moves it on; 0 at the end of the screen
Parameters
- into: Uint8Array
Returns number
resize
-
Gives the screen another size: what was drawn stays at the top left (the rest is black) until the program draws again, and the cursor goes to the top
Parameters
- width: number
- height: number
Returns void
seek
-
Moves the cursor as
lseekwould; returns the new positionParameters
- offset: number
- whence: number
Returns number
setCursor
-
The pointer over the window: a CSS cursor name such as
pointerortext, ornoneParameters
- cursor: string
Returns void
setCursorImage
-
setCursorImage(
image?: {
data: Uint8Array;
height: number;
width: number;
x: number;
y: number;
},
): voidParameters
Optionalimage: { data: Uint8Array; height: number; width: number; x: number; y: number }
Returns void
takeClipboardChunk
-
One chunk of text the program sends to the user's clipboard; the last one completes it
Parameters
- chunk: Uint8Array
Returns void
varScreenInfo
-
struct fb_var_screeninfo: 32 bits per pixel, blue in the low byteReturns Uint8Array
waitForFrame
-
Resolves when the next frame has been painted (what
FBIO_WAITFORVSYNCwaits for); at once for a closed screen, and after a short wait when nothing is drawnReturns Promise<void>
write
-
Copies
datain at the cursor (cut short at the end of the screen) and moves the cursor on; returns how much went inParameters
- data: Uint8Array
Returns number
The text the program last put on the clipboard