You are looking at historical revision 38133 of this page. It may differ significantly from its current revision.

chicken-termbox

Chicken Scheme bindings for the library termbox.

Author

Justin Meiners

API

[procedure] (termbox-init)

Initializes the termbox library.== chicken-termbox

Chicken Scheme bindings for the library termbox.

Author

Justin Meiners

API

[procedure] (termbox-init)

Initializes the termbox library. This function should be called before any other functions.

[procedure] (termbox-shutdown)

Shutdown termbox.

[procedure] (termbox-width) -> integer
[procedure] (termbox-height) -> integer

Returns the size of the internal back buffer (which is the same as

terminal's window size in characters).
[procedure] (termbox-clear)

Clears the internal back buffer using default color or the

color/attributes set by termbox-set-clear function.

chicken-termbox

Chicken Scheme bindings for the library termbox.

Author

Justin Meiners

API

[procedure] (termbox-init)

Initializes the termbox library. This function should be called before any other functions.

[procedure] (termbox-shutdown)

Shutdown termbox.

[procedure] (termbox-width) -> integer
[procedure] (termbox-height) -> integer

Returns the size of the internal back buffer (which is the same as

terminal's window size in characters).
[procedure] (termbox-clear)

Clears the internal back buffer using default color or the

color/attributes set by termbox-set-clear function.
[procedure] (termbox-set-clear [fg u16] [bg u16] )

Specifies the values that will be applied when calling termbox-clear.

[procedure] (termbox-present)

Synchronizes the internal back buffer with the terminal. In other words, presents changes to the terminal.

[procedure] (termbox-change-cell [x integer] [y integer] [c char] [fg u16] [bg u16])

Changes cell's parameters in the internal back buffer at the specified position.

[procedure] (termbox-set-cursor [x integer] [y integer])

Sets the position of the cursor. Upper-left character is (0, 0). Cursor is hidden by default.

[procedure] (termbox-hide-cursor)

Hides the cursor. Cursor can be shown again by calling termbox-set-cursor.

[procedure] (termbox-poll-event) -> list

Wait for an event forever and fill the 'event' structure with it, when the event is available. An event is a list containing the following: (TYPE MOD KEY CHAR W H X Y).

[procedure] (termbox-peek-event [timeout-millis integer]) -> list

Wait for an event up to 'timeout' milliseconds and return the event when available.

[procedure] (termbox-copy-buffer [char-buffer u32vector] [fg-buffer u32vector] [bg-vector u32vector])

Copy data from vectors into the internal buffer. The char-buffer is the character codes for the characters.

[procedure] (termbox-blit [x integer] [y integer] [char-buffer u32vector] [fg-buffer u32vector] [bg-vector u32vector])

Copy data from vectors into a part of the internal buffer at a specific location. The char-buffer is the character codes for the characters.

[procedure] (termbox-select-input-mode [mode integer])

Sets the termbox input mode. Termbox has two input modes: 1. Esc input mode. When ESC sequence is in the buffer and it doesn't match any known ESC sequence => ESC means tb/key/esc.

2. Alt input mode. When ESC sequence is in the buffer and it doesn't match any known sequence => ESC enables tb/mod/alt modifier for the next keyboard event.

You can also apply tb/input/mouse via bitwise OR operation to either of the modes (e.g. tb/input/esc | tb/input/mouse). If none of the main two modes were set, but the mouse mode was, tb/input/esc mode is used. If for some reason you've decided to use (tb/input/esc | tb/input/alt) combination, it will behave as if only tb/input/esc was selected.

If 'mode' is tb/input/current, it returns the current input mode. Default termbox input mode is tb/input/esc.

[procedure] (termbox-select-output-mode [mode integer])

Sets the termbox output mode. Termbox has three output options: 1. `tb/output/normal` => [1..8] This mode provides 8 different colors: black, red, green, yellow, blue, magenta, cyan, white

Shortcut: tb/color/black, tb/color/red, ...

    Attributes: tb/attrib/bold, tb/attrib/underline, tb/attrib/reverse
    Example usage:
        (tb-change-cell x  y #\@ (bitwise-ior tb/color/black tb/attrib/bold) tb/color/red)

2. tb/output/256 => [0..256] In this mode you can leverage the 256 terminal mode:

Example usage:

   tb_change_cell(x, y, '@', 184, 240);
   tb_change_cell(x, y, '@', 0xb8, 0xf0);

3. tb/output/216 => [0..216] This mode supports the 3rd range of the 256 mode only. But you don't need to provide an offset.

4. tb/output/grayscale => [0..23] This mode supports the 4th range of the 256 mode only. But you dont need to provide an offset.

If 'mode' is tb/output/current, it returns the current output mode. Default termbox output mode is tb/output/normal

License

MIT license

[procedure] (termbox-set-clear [fg u16] [bg u16] )

Specifies the values that will be applied when calling termbox-clear.

[procedure] (termbox-present)

Synchronizes the internal back buffer with the terminal. In other words, presents changes to the terminal.

[procedure] (termbox-change-cell [x integer] [y integer] [c char] [fg u16] [bg u16])

Changes cell's parameters in the internal back buffer at the specified position.

[procedure] (termbox-set-cursor [x integer] [y integer])

Sets the position of the cursor. Upper-left character is (0, 0). Cursor is hidden by default.

[procedure] (termbox-hide-cursor)

Hides the cursor. Cursor can be shown again by calling termbox-set-cursor.

[procedure] (termbox-poll-event) -> list

Wait for an event forever and fill the 'event' structure with it, when the event is available. An event is a list containing the following: (TYPE MOD KEY CHAR W H X Y).

[procedure] (termbox-peek-event [timeout-millis integer]) -> list

Wait for an event up to 'timeout' milliseconds and return the event when available.

[procedure] (termbox-copy-buffer [char-buffer u32vector] [fg-buffer u32vector] [bg-vector u32vector])

Copy data from vectors into the internal buffer. The char-buffer is the character codes for the characters.

[procedure] (termbox-blit [x integer] [y integer] [char-buffer u32vector] [fg-buffer u32vector] [bg-vector u32vector])

Copy data from vectors into a part of the internal buffer at a specific location. The char-buffer is the character codes for the characters.

[procedure] (termbox-select-input-mode [mode integer])

Sets the termbox input mode. Termbox has two input modes: 1. Esc input mode. When ESC sequence is in the buffer and it doesn't match any known ESC sequence => ESC means tb/key/esc.

2. Alt input mode. When ESC sequence is in the buffer and it doesn't match any known sequence => ESC enables tb/mod/alt modifier for the next keyboard event.

You can also apply tb/input/mouse via bitwise OR operation to either of the modes (e.g. tb/input/esc | tb/input/mouse). If none of the main two modes were set, but the mouse mode was, tb/input/esc mode is used. If for some reason you've decided to use (tb/input/esc | tb/input/alt) combination, it will behave as if only tb/input/esc was selected.

If 'mode' is tb/input/current, it returns the current input mode. Default termbox input mode is tb/input/esc.

[procedure] (termbox-select-output-mode [mode integer])

Sets the termbox output mode. Termbox has three output options: 1. `tb/output/normal` => [1..8] This mode provides 8 different colors: black, red, green, yellow, blue, magenta, cyan, white

Shortcut: tb/color/black, tb/color/red, ...

    Attributes: tb/attrib/bold, tb/attrib/underline, tb/attrib/reverse
    Example usage:
        (tb-change-cell x  y #\@ (bitwise-ior tb/color/black tb/attrib/bold) tb/color/red)

2. tb/output/256 => [0..256] In this mode you can leverage the 256 terminal mode:

Example usage:

   tb_change_cell(x, y, '@', 184, 240);
   tb_change_cell(x, y, '@', 0xb8, 0xf0);

3. tb/output/216 => [0..216] This mode supports the 3rd range of the 256 mode only. But you don't need to provide an offset.

4. tb/output/grayscale => [0..23] This mode supports the 4th range of the 256 mode only. But you dont need to provide an offset.

If 'mode' is tb/output/current, it returns the current output mode. Default termbox output mode is tb/output/normal

License

MIT license

This function should be called before any other functions.

[procedure] (termbox-shutdown)

Shutdown termbox.

[procedure] (termbox-width) -> integer
[procedure] (termbox-height) -> integer

Returns the size of the internal back buffer (which is the same as

terminal's window size in characters).
[procedure] (termbox-clear)

Clears the internal back buffer using default color or the

color/attributes set by termbox-set-clear function.

chicken-termbox

Chicken Scheme bindings for the library termbox.

Author

Justin Meiners

API

[procedure] (termbox-init)

Initializes the termbox library. This function should be called before any other functions.

[procedure] (termbox-shutdown)

Shutdown termbox.

[procedure] (termbox-width) -> integer
[procedure] (termbox-height) -> integer

Returns the size of the internal back buffer (which is the same as

terminal's window size in characters).
[procedure] (termbox-clear)

Clears the internal back buffer using default color or the

color/attributes set by termbox-set-clear function.
[procedure] (termbox-set-clear [fg u16] [bg u16] )

Specifies the values that will be applied when calling termbox-clear.

[procedure] (termbox-present)

Synchronizes the internal back buffer with the terminal. In other words, presents changes to the terminal.

[procedure] (termbox-change-cell [x integer] [y integer] [c char] [fg u16] [bg u16])

Changes cell's parameters in the internal back buffer at the specified position.

[procedure] (termbox-set-cursor [x integer] [y integer])

Sets the position of the cursor. Upper-left character is (0, 0). Cursor is hidden by default.

[procedure] (termbox-hide-cursor)

Hides the cursor. Cursor can be shown again by calling termbox-set-cursor.

[procedure] (termbox-poll-event) -> list

Wait for an event forever and fill the 'event' structure with it, when the event is available. An event is a list containing the following: (TYPE MOD KEY CHAR W H X Y).

[procedure] (termbox-peek-event [timeout-millis integer]) -> list

Wait for an event up to 'timeout' milliseconds and return the event when available.

[procedure] (termbox-copy-buffer [char-buffer u32vector] [fg-buffer u32vector] [bg-vector u32vector])

Copy data from vectors into the internal buffer. The char-buffer is the character codes for the characters.

[procedure] (termbox-blit [x integer] [y integer] [char-buffer u32vector] [fg-buffer u32vector] [bg-vector u32vector])

Copy data from vectors into a part of the internal buffer at a specific location. The char-buffer is the character codes for the characters.

[procedure] (termbox-select-input-mode [mode integer])

Sets the termbox input mode. Termbox has two input modes: 1. Esc input mode. When ESC sequence is in the buffer and it doesn't match any known ESC sequence => ESC means tb/key/esc.

2. Alt input mode. When ESC sequence is in the buffer and it doesn't match any known sequence => ESC enables tb/mod/alt modifier for the next keyboard event.

You can also apply tb/input/mouse via bitwise OR operation to either of the modes (e.g. tb/input/esc | tb/input/mouse). If none of the main two modes were set, but the mouse mode was, tb/input/esc mode is used. If for some reason you've decided to use (tb/input/esc | tb/input/alt) combination, it will behave as if only tb/input/esc was selected.

If 'mode' is tb/input/current, it returns the current input mode. Default termbox input mode is tb/input/esc.

[procedure] (termbox-select-output-mode [mode integer])

Sets the termbox output mode. Termbox has three output options: 1. `tb/output/normal` => [1..8] This mode provides 8 different colors: black, red, green, yellow, blue, magenta, cyan, white

Shortcut: tb/color/black, tb/color/red, ...

    Attributes: tb/attrib/bold, tb/attrib/underline, tb/attrib/reverse
    Example usage:
        (tb-change-cell x  y #\@ (bitwise-ior tb/color/black tb/attrib/bold) tb/color/red)

2. tb/output/256 => [0..256] In this mode you can leverage the 256 terminal mode:

Example usage:

   tb_change_cell(x, y, '@', 184, 240);
   tb_change_cell(x, y, '@', 0xb8, 0xf0);

3. tb/output/216 => [0..216] This mode supports the 3rd range of the 256 mode only. But you don't need to provide an offset.

4. tb/output/grayscale => [0..23] This mode supports the 4th range of the 256 mode only. But you dont need to provide an offset.

If 'mode' is tb/output/current, it returns the current output mode. Default termbox output mode is tb/output/normal

License

MIT license

[procedure] (termbox-set-clear [fg u16] [bg u16] )

Specifies the values that will be applied when calling termbox-clear.

[procedure] (termbox-present)

Synchronizes the internal back buffer with the terminal. In other words, presents changes to the terminal.

[procedure] (termbox-change-cell [x integer] [y integer] [c char] [fg u16] [bg u16])

Changes cell's parameters in the internal back buffer at the specified position.

[procedure] (termbox-set-cursor [x integer] [y integer])

Sets the position of the cursor. Upper-left character is (0, 0). Cursor is hidden by default.

[procedure] (termbox-hide-cursor)

Hides the cursor. Cursor can be shown again by calling termbox-set-cursor.

[procedure] (termbox-poll-event) -> list

Wait for an event forever and fill the 'event' structure with it, when the event is available. An event is a list containing the following: (TYPE MOD KEY CHAR W H X Y).

[procedure] (termbox-peek-event [timeout-millis integer]) -> list

Wait for an event up to 'timeout' milliseconds and return the event when available.

[procedure] (termbox-copy-buffer [char-buffer u32vector] [fg-buffer u32vector] [bg-vector u32vector])

Copy data from vectors into the internal buffer. The char-buffer is the character codes for the characters.

[procedure] (termbox-blit [x integer] [y integer] [char-buffer u32vector] [fg-buffer u32vector] [bg-vector u32vector])

Copy data from vectors into a part of the internal buffer at a specific location. The char-buffer is the character codes for the characters.

[procedure] (termbox-select-input-mode [mode integer])

Sets the termbox input mode. Termbox has two input modes: 1. Esc input mode. When ESC sequence is in the buffer and it doesn't match any known ESC sequence => ESC means tb/key/esc.

2. Alt input mode. When ESC sequence is in the buffer and it doesn't match any known sequence => ESC enables tb/mod/alt modifier for the next keyboard event.

You can also apply tb/input/mouse via bitwise OR operation to either of the modes (e.g. tb/input/esc | tb/input/mouse). If none of the main two modes were set, but the mouse mode was, tb/input/esc mode is used. If for some reason you've decided to use (tb/input/esc | tb/input/alt) combination, it will behave as if only tb/input/esc was selected.

If 'mode' is tb/input/current, it returns the current input mode. Default termbox input mode is tb/input/esc.

[procedure] (termbox-select-output-mode [mode integer])

Sets the termbox output mode. Termbox has three output options: 1. `tb/output/normal` => [1..8] This mode provides 8 different colors: black, red, green, yellow, blue, magenta, cyan, white

Shortcut: tb/color/black, tb/color/red, ...

    Attributes: tb/attrib/bold, tb/attrib/underline, tb/attrib/reverse
    Example usage:
        (tb-change-cell x  y #\@ (bitwise-ior tb/color/black tb/attrib/bold) tb/color/red)

2. tb/output/256 => [0..256] In this mode you can leverage the 256 terminal mode:

Example usage:

   tb_change_cell(x, y, '@', 184, 240);
   tb_change_cell(x, y, '@', 0xb8, 0xf0);

3. tb/output/216 => [0..216] This mode supports the 3rd range of the 256 mode only. But you don't need to provide an offset.

4. tb/output/grayscale => [0..23] This mode supports the 4th range of the 256 mode only. But you dont need to provide an offset.

If 'mode' is tb/output/current, it returns the current output mode. Default termbox output mode is tb/output/normal

License

MIT license