The croatoan Reference Manual

This is the croatoan Reference Manual, version 0.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 17:49:42 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 croatoan

High-level Lisp CLOS bindings for the ncurses terminal library.

Author

Anton Vidovic <>

License

MIT

Version

0.3

Dependencies
  • croatoan-ncurses (system).
  • trivial-gray-streams (system).
  • bordeaux-threads (system).
  • sb-introspect (system)., required, for feature :sbcl
Source

croatoan.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 croatoan/croatoan.asd

Source

croatoan.asd.

Parent Component

croatoan (system).

ASDF Systems

croatoan.


3.1.2 croatoan/package.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Packages

3.1.3 croatoan/character.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.4 croatoan/stack.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

rotate (function).


3.1.5 croatoan/grid.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.6 croatoan/classes.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.7 croatoan/croatoan.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.8 croatoan/menu.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.9 croatoan/form.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.10 croatoan/field.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.11 croatoan/textarea.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.12 croatoan/dropdown.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

update-cursor-position (method).


3.1.13 croatoan/hook.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

hook (function).

Internals

run-hook (function).


3.1.14 croatoan/queue.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.15 croatoan/gray_streams.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.16 croatoan/utf8.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

3.1.17 croatoan/dialog.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.18 croatoan/addch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.19 croatoan/add_wch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.20 croatoan/addstr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

add-string (function).


3.1.21 croatoan/attr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.22 croatoan/beep.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

alert (function).


3.1.23 croatoan/bkgd.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

3.1.24 croatoan/bkgrnd.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

3.1.25 croatoan/border.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.26 croatoan/border_set.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

draw-wide-border (function).


3.1.27 croatoan/clear.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.28 croatoan/color.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

3.1.29 croatoan/delch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

delete-char (function).


3.1.30 croatoan/deleteln.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.31 croatoan/getch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.32 croatoan/define_key.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

define-function-key (function).


3.1.33 croatoan/get_wch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.34 croatoan/getstr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

get-string (function).


3.1.35 croatoan/initscr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.36 croatoan/inopts.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

3.1.37 croatoan/inch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

extract-char (function).


3.1.38 croatoan/in_wch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

extract-wide-char (function).


3.1.39 croatoan/inwstr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

extract-wide-string (function).


3.1.40 croatoan/inchstr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

extract-complex-string (function).


3.1.41 croatoan/insch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

insert-char (function).


3.1.42 croatoan/ins_wch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.43 croatoan/insstr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

insert-string (function).


3.1.44 croatoan/instr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

extract-string (function).


3.1.45 croatoan/kernel.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

set-cursor-visibility (function).


3.1.46 croatoan/keybound.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

function-key-definition (function).


3.1.47 croatoan/key_defined.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

function-key-code (function).


3.1.48 croatoan/keyok.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

enable-function-key (function).


3.1.49 croatoan/mouse.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.50 croatoan/move.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.51 croatoan/refresh.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.52 croatoan/scroll.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

scroll (function).


3.1.53 croatoan/slk.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.54 croatoan/terminfo.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

tigetstr (function).


3.1.55 croatoan/touch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

touch (generic function).


3.1.56 croatoan/util.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.57 croatoan/wresize.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

resize (function).


3.1.58 croatoan/shape.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

4 Packages

Packages are listed by definition order.


4.1 de.anvi.croatoan

High-level Lisp interface to the basic CFFI Ncurses API.

Source

package.lisp.

Nicknames
  • croatoan
  • crt
Use List
  • common-lisp.
  • trivial-gray-streams.
Used By List

de.anvi.croatoan.dialog.

Public Interface
Internals

4.2 de.anvi.croatoan.soft-labels

Soft labels for the function keys F1-F12 in the bottom screen line.

Source

package.lisp.

Nicknames
  • soft-labels
  • slk
Use List

common-lisp.

Public Interface
Internals

4.3 de.anvi.croatoan.dialog

Dialog windows allow simple user input.

Source

package.lisp.

Nicknames
  • dialog
  • dlg
Use List
Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *ansi-color-list*
Package

de.anvi.croatoan.

Source

attr.lisp.

Special Variable: *main-stack*

Global window stack. Windows can be added upon initialization with :stacked t or (setf (stackedp win) t).

(setf (visiblep win) nil) prevents a stacked window from being refreshed and thus displayed.

Package

de.anvi.croatoan.

Source

stack.lisp.


5.1.2 Macros

Macro: complex-string-format ((control-string &rest args) &key attributes fgcolor bgcolor)

Use ‘control-string’ to build a ‘complex-string’ with the help of ‘format’ function.

Package

de.anvi.croatoan.

Source

character.lisp.

Macro: define-keymap (name (&rest parent) &body body)

Register a keymap given its name and (key function) pairs.

As a second argument, optionally a parent keymap can be given.

Keys can be characters, key structs for function keys with modifiers or a keyword for a function key without modifiers, which will implicitely converted to a struct.

In addition to single chars or keys, emacs-style specs like ’C-x 2’ or ’C-M-S-<home>’ can be given as strings, which will be parsed to char and key lists and then bound to the given event.

If a keymap with the same name already exists, it will be deleted before the new one is added.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Macro: dogrid (((i y0 h) (j x0 w)) &body body)

Loop over a 2D grid in row major order.

The grid is specified by position coordinates y0 x0 and dimensions height width.

Example: ((i 10 2) (j 10 3)) produces:

10 10, 10 11, 10 12
11 10, 11 11, 11 12

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Macro: event-case ((window event) &body body)

Window event loop, events are handled by an implicit case form.

For now, it is limited to events generated in a single window. So events from multiple windows have to be handled separately.

In order for event handling to work, input-buffering has to be nil. Several control character events can only be handled when process-control-chars is also nil.

Allowed values for keys are lisp characters, function key names as keywords, t for all events or (nil) for the idle event.

Key structs or emacs-style key specs are not supported, because the underlying lisp eql can not test for structs and strings.

If input-blocking is nil, we can handle the (nil) event, i.e. what happens between key presses.

If input-blocking is t, the (nil) event is never returned.

The main window event loop name is hard coded to event-case to be used with return-from.

Instead of ((nil) nil), which eats 100% CPU, use input-blocking t.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Macro: save-excursion (window &body body)

After executing body, return the cursor in window to its initial position.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Macro: submit (&body body)

Submit BODY from a producer thread to a job queue to be processed by the main thread.

The main thread should be the only one interfacing ncurses directly,
and should be running in a terminal.

SUBMIT uses a thread-safe FIFO queue to queue up jobs which should be
evaluated inside the terminal thread.

For this to work PROCESS has to be called from inside the terminal
thread to pop requests from the FIFO queue and evaluate them.

When a condition is signaled while the body of SUBMIT is evaluated, it
is handled by PROCESS and put inside a JOB-ERROR which also contains
the failed form.

The condition is then signaled again from within a restart which
allows skipping the failed form and continue evaluating requests.

In practice, this allows for calls to ncurses forms from SLIME to be
performed without IO glitches that tend to occur when ncurses code is
called from the SLIME repl thread directly.

Package

de.anvi.croatoan.

Source

queue.lisp.

Macro: with-screen ((screen &key bind-debugger-hook input-buffering process-control-chars enable-newline-translation input-blocking frame-rate input-echoing enable-function-keys enable-soft-labels enable-scrolling insert-mode enable-colors use-terminal-colors cursor-visible stacked fgcolor bgcolor color-pair background) &body body)

Create a screen, evaluate the forms in the body, then cleanly close the screen.

Pass any arguments besides BIND-DEBUGGER-HOOK to the initialisation of the
screen object. The screen is cleared immediately after initialisation.

This macro will bind *DEBUGGER-HOOK* so that END-SCREEN gets called before the condition is printed. This will interfere with SWANK as it also binds *DEBUGGER-HOOK*. To prevent WITH-SCREEN from binding *DEBUGGER-HOOK*, set BIND-DEBUGGER-HOOK to NIL.

This macro is the main entry point for writing ncurses programs with the croatoan library. Do not run more than one screen at the same time.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Macro: with-window ((win &rest options) &body body)

Create a window, evaluate the forms in the body, then cleanly close the window.

Pass any arguments to the initialisation of the window object.

Example:

(with-window (win :input-echoing t
body)

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Macro: with-windows (bindings &body body)

Create one or more windows, evaluate the forms in the body, then cleanly close the windows.

Pass any arguments to the initialisation of the window objects.

Example:

(with-windows ((win1 :input-echoing t)
(win2 :input-echoing t))
body)

Package

de.anvi.croatoan.

Source

croatoan.lisp.


5.1.3 Ordinary functions

Function: accept (object)

Exit the event loop of a form or form element.

The first return value is t, emphasizing that the user has accepted the form.

The element name is returned as a second value.

Bind this function to an event (key binding or button).

Package

de.anvi.croatoan.

Source

form.lisp.

Function: accept-selection (menu)

Return the value of the currently selected item or all checked items.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: acs (char-name)

Take a symbol, return the integer representing the acs char.

Package

de.anvi.croatoan.

Source

addch.lisp.

Function: add (window object &rest keys &key &allow-other-keys)

Add the text object to the window, then advance the cursor.

Currently supported text objects are characters (simple and complex), characters given by integer codes or keywords, and strings
(simple and complex).

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the object.

The position can also be passed in form of a two-element list.

If n is given for a char, write n chars. If n is -1, add as many chars as will fit on the line.

If n is given for a string, add at most n chars from the string. If n is -1, add as many chars from the string as will fit on the line.

Package

de.anvi.croatoan.

Source

addch.lisp.

Function: add-attributes (win attributes)

Takes a list of keywords and turns the appropriate attributes on.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: add-attributes (attributes)

Add attributes to the rendition of the soft labels.

The default attribute used to highlight soft labels is :standout.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: add-char (window char &key attributes fgcolor bgcolor color-pair style y x position n)

Add the narrow (single-byte) char to the window, then advance the cursor.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the character.

The position can also be passed in form of a two-element list.

If n is given for a char, write n chars. If n is -1, add as many chars as will fit on the line.

Example: (add-char scr #a :attributes ’(:bold) :color-pair ’(:red :yellow))

Package

de.anvi.croatoan.

Source

addch.lisp.

Function: add-child (parent child)

Append an element to parent’s children list.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: add-function-key (key code)

Add a new mapping (code . key) to *key-alist*.

The codes and keys have to be unique, so if the alist already contains either the key or the code, any existing mapping will be replaced by the new one.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: add-string (window string &key attributes fgcolor bgcolor color-pair style y x position n)

Add the unrendered string to the window.

If n is given, add at most n chars from the string. If n is -1, as many chars will be added that will fit on the line.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the object.

The position can also be passed in form of a two-element list.

Package

de.anvi.croatoan.

Source

addstr.lisp.

Function: add-wide-char (window char &key attributes fgcolor bgcolor color-pair style y x position n)

Add the wide (multi-byte) char to the window, then advance the cursor.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the character.

The position can also be passed in form of a two-element list.

If n is given for a char, write n chars. If n is -1, add as many chars as will fit on the line.

If char is a complex-char, its own style overrides any style parameters.

If a style is passed, it overrides attributes and color-pair.

Package

de.anvi.croatoan.

Source

add_wch.lisp.

Function: add-wide-char-utf-8 (window char &key attributes color-pair y x position n)

Add the wide (multi-byte) char to the window, then advance the cursor.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the character.

The position can also be passed in form of a two-element list.

If n is given, write n chars. If n is -1, as many chars will be added as will fit on the line.

Package

de.anvi.croatoan.

Source

add_wch.lisp.

Function: alert (&optional type)
Package

de.anvi.croatoan.

Source

beep.lisp.

Function: angle-line (y0 x0 theta length &key char)

Draw a line of the given length in the bearing theta from the origin.

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: append-item (collection item)

Append the item at the end of the collection list.

This does not change the current item number.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: attributes ()

Return a list of attributes used for the rendition of soft labels.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: attrs2chtype (attrs)

Take a list of attribute keywords, return a chtype with the attribute bits set.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: bind (object event handler)

Bind the handler to the event in the bindings alist of the object.

The object can be a croatoan object (like window or form) or a keymap.

If event argument is a list, bind the handler to the whole sequence of events (key chain).

The handler can be a function object, a fbound symbol or a keymap.

The handler function will be called by the run-event-loop when keyboard or mouse events occur. The functions have two mandatory arguments, object and event.

If a keymap is bound to a key, this allows keys to be defined as prefix keys, so event sequences like ’^X a’ can be chained together and handled like a single event.

For every event-loop, at least an event to exit the event loop should be assigned, by associating it with the predefined function exit-event-loop.

If a default event handler (for the event t) is defined, it will handle all events for which no specific event handler has been defined.

If the handler for an event is the symbol t, the event is ignored. If the event was part of an event sequence, the handler t cancels the input sequence.

Bind adds t as the default handler to all implicitly created sub-keymaps, which cancels the input sequence of a key chain in case an unknown key is typed.

If input-blocking of the window is set to nil, a handler for the nil event can be defined, which will be called at a specified frame-rate between keypresses. Here the main application state can be updated.

Alternatively, to achieve the same effect, input-blocking can be set to a specific delay in miliseconds.

Example use: (bind scr #q (lambda (win event) (throw scr :quit)))

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: box (window &optional hline-char vline-char)

Draw a border around the window.

If any parameter is nil or zero, the default ACS char will be used.

Package

de.anvi.croatoan.

Source

border.lisp.

Function: calculate-positions (layout)

Recursively set the position (y x) of each of the layout’s children.

Package

de.anvi.croatoan.

Source

grid.lisp.

Function: cancel (object)

Exit the event loop of a form or form element.

The return value is nil, emphasizing that the user has canceled the form.

The element name is returned as a second value.

As a consequence of the cancel, all elements are reset and the input content is discarded.

Bind this function to an event (key binding or button).

Package

de.anvi.croatoan.

Source

form.lisp.

Function: center-position (window)

Return the position (y x) of the center of the window.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: change-attributes (win n attributes &key color-pair y x position)

Change the attributes of n chars starting at the current cursor position.

If n is -1, as many chars will be added as will fit on the line.

If the destination coordinates y and x are given, the attributes are changed from the given point without moving the cursor position.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: char-width (char)

Return the number of columns required to display the wide char.

If char is not printable, for example a control char, return nil.

In order to get a meaningful result from wcwidth, the locale has to be set, see ‘setlocale’.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: chtype2attrs (ch)

Take a chtype, return a list of used attribute keywords.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: chtype2colors (ch)

Take a chtype or attr_t integer, return a list of two keywords denoting a color pair.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: circle (y0 x0 radius &key filled char)

Return a circle with a given radius, optionally filled.

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: clear ()

Clear labels from the screen. Use restore to restore the labels afterwards.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: clear-rectangle (win &rest args)

Clear the rectangular area of a window by overwriting it with space.

If the background of a window is set, then the background char is used instead.

Package

de.anvi.croatoan.

Source

clear.lisp.

Function: code-key (code)

Return a key struct representing the key code returned by ncurses:getch.

Return nil if the code is unknown.

An existing but unknown code can be added with add-function-key.

A new escape sequence and a new code can be added with define-function-key.

This function is analogous to cl:code-char but for function key structs.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: color-pair ()

Return the color pair used for soft labels.

The color pair is a 2-element list (:foreground :background).

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: (setf color-pair) ()

Set the color pair used for soft labels.

The color pair is a 2-element list (:foreground :background).

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: complete-default-pair (color-pair)

Take a color pair possibly containing nil, return a pair completed from the default color pair 0.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: complex-char= (a b)

Return t if the simple-char, the color pair and the attribute list of a complex-char are equal.

The initial purpose of this function is to be used as the equality test for alexandria:define-constant.

Package

de.anvi.croatoan.

Source

character.lisp.

Function: complex-string->chars-string (complex-string)

Convert a ‘complex-string’ to a ‘string’.

Package

de.anvi.croatoan.

Source

character.lisp.

Function: complex-string-length (complex-string)

Returns the length (in characters units) of a complex string passed as argument ‘complex-string’.

Package

de.anvi.croatoan.

Source

character.lisp.

Function: control-char-p (char)
Package

de.anvi.croatoan.

Source

util.lisp.

Function: copy-key (instance)
Package

de.anvi.croatoan.

Source

classes.lisp.

Function: cumsum-predecessors (nums)

Take a list, return a cumulative sum of previous elements.

For every number, sum the numbers preceding it in the list.

For example, for the list (2 4 3 6) we will get (0 2 6 9).

For example, if (2 4 3 6) is a list of column widths in a table, then (0 2 6 9) is a list of x positions of each column.

Package

de.anvi.croatoan.

Source

grid.lisp.

Function: current-item-number (collection)

Return the current item number of collection.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: (setf current-item-number) (collection)

Set and return the new current item number of the collection.

Run the selection-callback, if it is set.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: default-color-pair (screen)
Package

de.anvi.croatoan.

Source

attr.lisp.

Function: (setf default-color-pair) (screen)

Set the colors which will comprise the default color pair 0.

The default color pair is used when no other colors are specified.

The ncurses default color pair is white on black.

If the terminal can set its own colors, they are named :terminal.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: define-function-key (key definition &key key-code)

Add or replace a function key defined by a character sequence.

The key has to be given by a key struct, which at least has to contain the key-name slot.

The key name is a keyword symbol used to represent the key (e.g. :f1).

The definition of the function key can be passed as a list of characters or as a string.

The definition is the raw (escape) sequence of characters returned by the terminal to identify an event (key pressed, mouse event, etc.).

If key-code is an integer, a new mapping (code . key) is added to the *key-alist* database overwriting any already existing mapping which contains either key or code.

If key-code is nil (default) the mapping is added with an unique, unused, generated keycode.

Package

de.anvi.croatoan.

Source

define_key.lisp.

Function: delete-char (window &key y x)

Delete the character under the cursor.

All characters to the right of the cursor on the same line are moved to the left one position and the last character on the line is filled with a blank. The cursor position does not change after moving
to (y,x), if specified.

Package

de.anvi.croatoan.

Source

delch.lisp.

Function: delete-line (window &key n)

Delete n lines starting with the one under the cursor.

The remaining lines are moved up. The bottom n lines are cleared.

The current cursor position does not change.

Package

de.anvi.croatoan.

Source

deleteln.lisp.

Function: draw-border (window &key left right top bottom top-left top-right bottom-left bottom-right)

Draw a border around the window using single-byte line-drawing characters.

If no border chars are given, the default ncurses ACS chars will be used.

Package

de.anvi.croatoan.

Source

border.lisp.

Function: draw-hline (win y x length &optional char &rest keys &key &allow-other-keys)
Package

de.anvi.croatoan.

Source

border.lisp.

Function: draw-line (win start end &optional char)

Draw a line in window from start (y1 x1) to end (y2 x2) position using the Bresenham algorithm.

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: draw-menu (win y x menu)

Draw the menu to the window.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: draw-rectangle (win y x h w &rest keys &key &allow-other-keys)
Package

de.anvi.croatoan.

Source

border.lisp.

Function: draw-shape (window shape &optional squarify)

Draw a shape in the given window.

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: draw-table-lines (win y x m n rg cg bt bl pt pb widths heights borderp &key style)
Package

de.anvi.croatoan.

Source

menu.lisp.

Function: draw-vline (win y x length &optional char &rest keys &key &allow-other-keys)
Package

de.anvi.croatoan.

Source

border.lisp.

Function: draw-wide-border (window &key left right top bottom top-left top-right bottom-left bottom-right)

Draw a border around the window using (wide) unicode line-drawing characters.

If no border chars are given, the default ncurses WACS chars will be used.

Package

de.anvi.croatoan.

Source

border_set.lisp.

Function: echo (window char &rest keys &key &allow-other-keys)

Add one character to the window, then advance the cursor.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the character.

The position can also be passed in form of a two-element list.

If n is given for a char, write n chars. If n is -1, add as many chars as will fit on the line.

If char is a complex-char, its own style overrides any style parameters.

If a style is passed, it overrides attributes and color-pair.

Package

de.anvi.croatoan.

Source

addch.lisp.

Function: echo-char (window char &key attributes fgcolor bgcolor color-pair style y x position)

Add one narrow (single-byte) character to the window, then refresh the window.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then echo the character.

The position can also be passed in form of a two-element list.

The only difference to add-char and a subsequent refresh is a
performance gain if we know that we only need to output a single character.

Package

de.anvi.croatoan.

Source

addch.lisp.

Function: echo-wide-char (window char &key attributes fgcolor bgcolor color-pair style y x position)

Add one wide (multi-byte) character to the window, then refresh the window.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the character.

The position can also be passed in form of a two-element list.

The only difference to add-wide-char and a subsequent refresh is a performance gain if we know that we only need to output a single character.

Package

de.anvi.croatoan.

Source

add_wch.lisp.

Function: edit (object)

Modify a form or form element. Return t if the edit was accepted, nil of it was canceled.

The return values of the event handler are the return values of the event loop and thus also returned by edit.

Package

de.anvi.croatoan.

Source

form.lisp.

Function: empty-stack (stack)

Remove all items from the stack.

Package

de.anvi.croatoan.

Source

stack.lisp.

Function: enable-function-key (code &optional enable)

Enable (default) or disable a function key given by its code.

This function allows to disable specific keys as an alternative to using ncurses:keypad to disable all function keys.

Package

de.anvi.croatoan.

Source

keyok.lisp.

Function: end-screen ()

Clean shutdown of the curses display.

Package

de.anvi.croatoan.

Source

initscr.lisp.

Function: event-position (event)
Package

de.anvi.croatoan.

Source

mouse.lisp.

Function: exit-event-loop (object &optional args)

Associate this function with an event to exit the event loop.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: exit-menu-event-loop (menu)

Associate this function with an event to exit the menu event loop.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: extract-char (window &key y x position)

Extract and return the single-byte complex char from the window.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the character.

The position can also be passed in form of a two-element list.

Package

de.anvi.croatoan.

Source

inch.lisp.

Function: extract-complex-string (window &key y x position n)

Extract and return a complex string from the window.

Start at the current cursor position and end at the right margin of window.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the character.

The position can also be passed in form of a two-element list.

If n is given, read at most n chars.

Package

de.anvi.croatoan.

Source

inchstr.lisp.

Function: extract-string (window &key y x position n)

Extract and return a string from window.

Any attributes are stripped from the characters before the string is returned.

Start at the current cursor position and end at the right margin of window.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the character.

The position can also be passed in form of a two-element list.

If n is given, read at most n chars.

Package

de.anvi.croatoan.

Source

instr.lisp.

Function: extract-wide-char (window &key y x position)

Extract and return a single wide (complex) character from the window.

This includes wide characters (code > 255), and requires the ncursesw library.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the character.

The position can also be passed in form of a two-element list.

Package

de.anvi.croatoan.

Source

in_wch.lisp.

Function: extract-wide-string (window &key y x position n)

Extract and return a string from window.

Any attributes are stripped from the characters before the string is returned.

Start at the current cursor position and end at the right margin of window.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the character.

The position can also be passed in form of a two-element list.

If n is given, read at most n chars.

Package

de.anvi.croatoan.

Source

inwstr.lisp.

Function: field-add-char (field event)

Add char to the current cursor position in the field, then move the cursor forward.

The buffer can be longer than the displayed field width, horizontal scrolling is enabled.

Package

de.anvi.croatoan.

Source

field.lisp.

Function: fill-rectangle (win char &rest args)

Display char in every cell of a rectangular area in a window.

The rectangle is specified by a starting position and its dimensions.

4 arguments: y0 x0 height width
2 arguments: (y0 x0) (h w)

Package

de.anvi.croatoan.

Source

clear.lisp.

Function: fill-shape (shape)

Take a shape that only shows the borders and ’color it out’.

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: find-element (form element-name &key test key)

Return from the given form the element given by its name.

The name should be a keyword, symbol or integer, the default test is eql.

If the name is a string, equal should be used as the test.

Instead of the name, another key can be provided to identify the element.

Package

de.anvi.croatoan.

Source

form.lisp.

Function: find-keymap (keymap-name)

Return a keymap given by its name from the global keymap alist.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: find-node (name1 tree)

Return the first node that matches the name.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: flatten-items (layout)

Take a layout object, return a flattened list of elements to be passed to a form.

Nested layouts are spliced in, nils removed and strings/symbols/numbers converted to labels.

Package

de.anvi.croatoan.

Source

grid.lisp.

Function: flush-input ()

Throw away any typeahead that has been input by the user and has not yet been read by the program.

This can be used to clear the input buffer after a key has been held down for a longer time to prevent that events are handled by the progrem even after the key is released. (That form of intertia can happen in games.)

This ncurses function has the same purpose as cl:clear-input.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: function-key-code (definition)

Take a function key definition, return the ncurses key code.

If the key is defined, return the key code (as returned by getch or get_wch), or nil if the key is not defined.

A key definition is an escape sequence of characters that is generated by the keyboard and recognized by ncurses as a single function key.

The definition can be passed as string or as a list of characters.

Also see: function-key-definition.

Package

de.anvi.croatoan.

Source

key_defined.lisp.

Function: function-key-definition (code)

Take a function key code, return its definition as a string.

The key definition is a escape sequence of characters that is generated by the keyboard and recognized by ncurses as a single function key.

Also see: function-key-code.

Package

de.anvi.croatoan.

Source

keybound.lisp.

Function: function-key-p (code)

Take a single-byte key code returned by get-char, return t if the number is a known function key, or nil if it is either a char or an unknown key.

Used in get-event to check the return value of get-char.

get-wide-char/event has a different way to check for function keys.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: get-bitmask (attribute)

Returns an ncurses attr/chtype representing the attribute keyword.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: get-char (window &key y x)

Read in a C char (single byte) from the keyboard and return it.

If the destination coordinates y (row) and x (column) are given, move the cursor to the destination first and then read a single byte.

The window from which the char is read is automatically refreshed.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: get-direction (direction-name)

Take a keyword name of a direction, return a direction given as a two-element list.

The two-element list is given as (y x), where y is the vertical
direction up (-1) or down (+1) and x is the horizontal direction
left (-1) or right (+1).

Calculated that way, we have 8 possible directions:

-1,-1 -1,0 -1,1
0,-1 0,1
1,-1 1,0 1,1

The direction is a 2D increment (dy dx) that can be added to a
position (y x) to get a new position (y+dy x+dx).

Package

de.anvi.croatoan.

Source

move.lisp.

Function: get-event (window)

Read a single-byte char from window, return an event object.

The object contains the event key (a simple character or a keyword for function keys) and the integer key code.

The following chars can be returned:

1. Regular single-byte control and graphic characters with codes 0-255 are returned as lisp characters.
Multi-byte characters are returned as a sequence of chars/integers. To return a multi-byte char as a single char, use get-wide-event.

2. If input-blocking of the window is set to nil, non-events (idle time when no real events occur) are returned as nil with the code -1.

3. If enable-fkeys is set to t, function keys are converted by ncurses from an escape sequence to an integer >255 and returned by get-event as a lisp keyword name.
If enable-fkeys is nil, the whole sequence is read and returned.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: get-mouse-event ()

Decode and return the mouse event struct as multiple values.

Package

de.anvi.croatoan.

Source

mouse.lisp.

Function: get-string (window n &key y x)

Read a string from the keyboard and return it.

Reading is performed until a newline or carriage return is received. The terminating character is not included in the returned string.

If n is given, read at most n chars, to prevent a possible input buffer overflow.

If the destination coordinates y and x are given, move the cursor there first.

Package

de.anvi.croatoan.

Source

getstr.lisp.

Function: get-wide-char (window &key y x position)

Read in a wide C wchar_t (multi-byte) from the keyboard and return it.

If the destination coordinates y (row) and x (column) are given, move
the cursor to the destination first and then read a multi-byte char.

The window from which the char is read is automatically refreshed.

If the second returned value is t, the char is a function key, nil otherwise.

Package

de.anvi.croatoan.

Source

get_wch.lisp.

Function: goto (window &rest positions)

Move cursor to the window position given as a two-element list (y x).

If more than one position is given, add their coordinates before moving the cursor.

This allows to address element-relative coordinates or cursor movement to a different position.

Package

de.anvi.croatoan.

Source

move.lisp.

Function: hook (object hook function)

Add the function to the object’s hook.

A hook is a list of functions to call on different pre-defined occasions in order to customize the library’s behavior.

The function should take the object as its only argument.

The functions are called to perform side effects, their return values are discarded.

Package

de.anvi.croatoan.

Source

hook.lisp.

Function: initialize (&optional mode)

Initialize soft function-key labels on the bottom screen line.

Soft labels are used to display short titles of the functions bound to the function keys F1 to F12.

The following 4 modes (label layouts) are supported:

Show 8 labels, each with a width of 8 characters:

:mode-3-2-3 - 3 labels left, 2 in the center, 3 right :mode-4-4 - 4 labels left, 4 labels right

Show 12 labels, each with a width of 5 characters:

:mode-4-4-4 - 4 labels left, 4 in the center, 4 right :mode-4-4-4-index - display an line with F1-F12 above the labels.

The single-line 4-4-4 mode without the index line is the default, as most PC keyboards support 12 function keys.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: initialize-leaves (node)

Walk the layout tree given by node and initialize the leaf objects that are given as plists.

Package

de.anvi.croatoan.

Source

grid.lisp.

Function: insert (window object &rest keys &key &allow-other-keys)

Insert char or string into window before the char currently under the cursor.

Currently supported text objects are characters (simple and complex), characters given by integer codes or keywords, and strings
(simple and complex).

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then insert the object.

The position can also be passed in form of a two-element list.

If n is given for a char, insert n chars.

If n is given for a string, add at most n chars from the string.

Package

de.anvi.croatoan.

Source

ins_wch.lisp.

Function: insert-char (window char &key attributes fgcolor bgcolor color-pair style y x position n)

Insert char into window before the character currently under the cursor.

Chars right of the cursor are moved one position to the right.
The rightmost character on the line may be lost. The position of the cursor is not changed.

char can be a simple character or a complex-char with attributes and colors.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the object.

The position can also be passed in form of a two-element list.

If n is given, insert n chars.

Package

de.anvi.croatoan.

Source

insch.lisp.

Function: insert-line (window &key n)

Insert n lines above the current line.

The current line and the lines below are moved down. The n bottom lines are lost.

The current cursor position does not change.

Package

de.anvi.croatoan.

Source

deleteln.lisp.

Function: insert-nth (n element list)

Insert element into list at nth place, increasing the length of the list.

Example: (insert-nth 3 ’x ’(a b c d e)) => (A B C X D E)

Package

de.anvi.croatoan.

Source

field.lisp.

Function: insert-string (window string &key attributes fgcolor bgcolor color-pair style y x position n)

Insert string before the current position in window.

Chars right of the cursor are moved to the right. The rightmost chars on the line may be lost. The cursor position is not changed.

If n is given, insert at most n chars from the string.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the object.

The position can also be passed in form of a two-element list.

Package

de.anvi.croatoan.

Source

insstr.lisp.

Function: insert-wide-char (window char &key attributes fgcolor bgcolor color-pair style y x position n)

Insert char into window before the character currently under the cursor.

Chars right of the cursor are moved one position to the right.
The rightmost character on the line may be lost. The position of the cursor is not changed.

char can be a simple character or a complex-char with attributes and colors.

If the position coordinates y (row) and x (column) are given, move the cursor to the position first and then add the object.

The position can also be passed in form of a two-element list.

If n is given, insert n chars.

Package

de.anvi.croatoan.

Source

ins_wch.lisp.

Function: join-lines (list)

Join a list of strings into a string of lines separated by newline.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: join-strings (list &optional ch)
Package

de.anvi.croatoan.

Source

util.lisp.

Reader: key-alt (instance)
Writer: (setf key-alt) (instance)
Package

de.anvi.croatoan.

Source

classes.lisp.

Target Slot

alt.

Function: key-code (key)

Return the code associated with a function key struct.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: key-code-to-name (code &optional default)

Take an integer representing the function key code, return a keyword representing the function key name.

If a name to the given code is not in the key list, return the value of the optional parameter: ’default’.

Package

de.anvi.croatoan.

Source

getch.lisp.

Reader: key-ctrl (instance)
Writer: (setf key-ctrl) (instance)
Package

de.anvi.croatoan.

Source

classes.lisp.

Target Slot

ctrl.

Reader: key-name (instance)
Writer: (setf key-name) (instance)
Package

de.anvi.croatoan.

Source

classes.lisp.

Target Slot

name.

Function: key-name-to-code (name &optional default)

Return the first code (an integer) from the given keyname (a keyword).

Since we can have more than one key struct with the same name, we can here only return the first code, which would be the key without modifiers.

If the code does not exist, return the value of the optional parameter: ’default’.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: key-p (object)
Package

de.anvi.croatoan.

Source

classes.lisp.

Function: key-pressed-p (window)
Package

de.anvi.croatoan.

Source

getch.lisp.

Reader: key-shift (instance)
Writer: (setf key-shift) (instance)
Package

de.anvi.croatoan.

Source

classes.lisp.

Target Slot

shift.

Function: key-supported-p (code)

Returns t if the code is recognized by the current terminal as a key.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: label (number)

Return the title of the soft label given by the function key number.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: (setf label) (number &optional alignment)

Set the title of the label of the function key given by the number.

Note that since function keys are F1-F12, the numbering starts at 1.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: leaves (root)

Walk the layout tree given by the root node, return a list of leaves.

Package

de.anvi.croatoan.

Source

grid.lisp.

Function: line (y0 x0 y1 x1 &key char)

Return a straight line between two points

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: make-background (color-bg &key color-fg char)

Make an object suitable as a window background.

Use ‘color-bg’ as background color, ‘color-fg’ as foreground color and character ‘char’.

If color-fg is not given, default to ‘color-bg’).

Package

de.anvi.croatoan.

Source

character.lisp.

Function: make-key (&key name ctrl alt shift)
Package

de.anvi.croatoan.

Source

classes.lisp.

Function: mapc-plist (fn &rest plist)

Mapc function of two args (k v) to successive keys and values in plist.

The function is applied for its side effects, the results are not accumulated.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: mark-for-redraw (window &key first-line no-of-lines)

Mark a whole window or a number of lines to be completely redrawn on the next refresh.

It does not redraw, only marks for redrawing by refresh.

It assumes that the display on the terminal has been corrupted.

It is unclear how redrawwin differs from touchwin.

Package

de.anvi.croatoan.

Source

refresh.lisp.

Function: mark-for-refresh ()

Mark the soft labels for a later refresh with refresh-marked.

This allows the soft labes to be refreshed in one sweep with other elements of the screen.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: merge-shapes (&rest shapes)

Create a new shape object by merging the coordinates of a given list of shapes.

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: move (window y x &key relative)

Move cursor to the position given by row y and column x.

If relative is t, move the cursor by y rows and x columns relative to the current cursor position.

Package

de.anvi.croatoan.

Source

move.lisp.

Function: move-direction (window direction &optional n)

Move cursor in the given direction by n cells.

Package

de.anvi.croatoan.

Source

move.lisp.

Function: move-end-of-line (field)

Move the cursor to the last char in the field.

Package

de.anvi.croatoan.

Source

field.lisp.

Function: move-start-of-line (field)

Move the cursor to the first char in the field.

Package

de.anvi.croatoan.

Source

field.lisp.

Function: move-window (window y x &key relative)

Move top left corner of the window to row y and column x.

If relative is t, move the window by y rows and x columns relative to its current position.

Package

de.anvi.croatoan.

Source

move.lisp.

Function: nconcat-complex-string (a b)

Destructively concatenate the ‘complex-string’ ‘a’ and ‘b’

Package

de.anvi.croatoan.

Source

character.lisp.

Function: new-line (window &optional count)

Insert count newline characters into window.

Package

de.anvi.croatoan.

Source

addch.lisp.

Function: nth2d (list dimensions position)

Return the position (i j) of list by assuming grid dimensions (m n) and row major order.

Package

de.anvi.croatoan.

Source

grid.lisp.

Function: pair-plist (keys values &optional plist)

Return a plist constructed out of separate keys and values lists.

This is supposed to work like cl:pairlis but returning a plist instead of an alist.

If an initial plist is provided, the new key-value pairs are prepended to it.

Example 1: (pair-plist ’(a b c) ’(1 2 3)) => (a 1 b 2 c 3)

Example 2: (pair-plist ’(a b) ’(1 2) ’(x 3 y 4)) => (A 1 B 2 X 3 Y 4)

The resulting plist can be again taken apart into keys and values by the reverse function ‘unpair-plist’.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: pair-to-number (pair)

Take a two-element list of colors, return the ncurses pair number.

The colors can be keywords or numbers -1:255.

-1 is the :terminal default color when use-terminal-colors-p is t.

If it is a new color pair, add it to ncurses, then return the new pair number.

If the pair already exists, return its pair number.

If pair is nil, return the default color number, 0.

Example:

(pair-to-number ’(:white :black)) => 0

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: polygon (corners &key filled char)

Return a polygon along a list of corners, optionally filled

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: process ()

Process the contents of the job queue in the current thread, then exit.

Process should be called from the main thread, which should be the only thread interfacing ncurses directly, and should be running in a terminal.

Package

de.anvi.croatoan.

Source

queue.lisp.

Function: push-item (collection item)

Add the item at the front of the collection list.

This increments the current item number.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: put (window y x object &rest keys &key &allow-other-keys)

Add the object to the window at position (y x), then advance the cursor.

put is a thin convenience wrapper around add with the difference that the position arguments (y x) are mandatory.

Package

de.anvi.croatoan.

Source

addch.lisp.

Function: put-char (window y x char &rest keys &key &allow-other-keys)
Package

de.anvi.croatoan.

Source

addch.lisp.

Function: put-string (window y x string &rest keys &key &allow-other-keys)
Package

de.anvi.croatoan.

Source

addch.lisp.

Function: quadrilateral (y0 x0 y1 x1 y2 x2 y3 x3 &key filled char)

Return a quadrilateral (utility wrapper around ‘polygon’).

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: random-position (win)

Return a random valid position (y x) inside the window.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: rectangle (y0 x0 height width &key filled char)

Return a rectangle (utility wrapper around ‘polygon’).

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: ref2d (list dimensions i j)

Return the position (i j) of list by assuming grid dimensions (m n) and row major order.

Package

de.anvi.croatoan.

Source

grid.lisp.

Function: refresh ()

Refresh the soft label line(s).

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: refresh-marked ()

Refresh one or more windows marked for refresh.

If only one window is refreshed, refresh can be called directly.

The goal of this batch refresh is improved efficiency and preventing flicker that might occur if several windows are refreshed in sequence.

Package

de.anvi.croatoan.

Source

refresh.lisp.

Function: remove-attributes (win attributes)

Takes a list of keywords and turns the appropriate attributes off.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: remove-attributes (attributes)

Takes a list of keywords and turns the appropriate attributes off.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: remove-nth (n list)

Remove element at nth place from the list, decreasing the length of the list.

Example: (remove-nth 3 ’(a b c d e)) => (A B C E)

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: replace-nth (n element list)

Replaces element of list at nth place, not increasing the length of the list.

Example: (replace-nth 3 ’x ’(a b c d e)) => (A B C X E)

Package

de.anvi.croatoan.

Source

field.lisp.

Function: reset-form (object)

Reset a parent form from an element callback, for example a button.

Package

de.anvi.croatoan.

Source

form.lisp.

Function: resize (window height width)
Package

de.anvi.croatoan.

Source

wresize.lisp.

Function: restore ()

Restore the labels previously removed by clear.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: return-element-value (object)

Exit the event loop and return the value of the (current) element.

The element name is returned as a second value.

Instead of accept or cancel, which return t or nil, this function allows to exit the form event loop and return any value.

Package

de.anvi.croatoan.

Source

form.lisp.

Function: return-form-values (object)

Return an alist with element names as keys and element values as values.

It is supposed to resemble GET params fname=John&lname=Doe from html forms.

Only active elements are returned.

Only the activated button is returned, other buttons are ignored.

Bind this to an event or element to exit the event loop of a form.

Package

de.anvi.croatoan.

Source

form.lisp.

Function: return-from-menu (menu return-value)

Pop the menu from the menu stack, refresh the remaining menu stack.

If the menu is not a window, clear the menu from the window.

Return the value from select.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: run-event-loop (object &rest args)

Read events from the object, then call predefined event handler functions on the events.

The object has to be a ncurses window or have an associated ncurses window.

The handlers can be added by the bind function, or by directly setting a predefined keymap to the object’s bindings slot.

Args is one or more additional arguments that can be passed to the handlers.

Provide a non-local exit point so we can exit the loop from an event handler.

One of the events must provide a way to exit the event loop by ’throwing’ the object.

The function exit-event-loop is pre-defined to perform this non-local exit.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: scroll (window &optional n)

Scroll the window up or down for n lines relative to its contents.

If n is positive, move the contents up relative to the window.
The line i becomes line i-n. The window view moves n lines down.

If n is negative, move the contents down relative to the window. The line i becomes line i+n. The window view moves n lines up.

Initial Scroll up Scroll down
n = 1 n = -1

1
+—–+ +—–+ +—–+
| 1 | | 2 | | |
| 2 | | 3 | | 1 |
| 3 | | | | 2 |
+—–+ +—–+ +—–+
3

The content lines that leave the scrolled window aren’t buffered and can not be retrieved when moving back, they are lost. (If you need to scroll up and down without losing lines, consider using pad windows instead of simple windows.)

The cursor position in the window is not changed when the contents are scrolled.

Package

de.anvi.croatoan.

Source

scroll.lisp.

Function: set-attributes (attributes color-pair)

Set the attributes and color-pair for the rendition of soft labels.

This function overwrites any previous used attributes including the color. If you only want to set the attributes, you might want to use setf attributes instead.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: set-mouse-event (keys)

Take a list of mouse event keys, activate tracking of those events.

Returns an integer bitmask. An empty list turns off mouse tracking.

Package

de.anvi.croatoan.

Source

mouse.lisp.

Function: shape-extent (shape)

Return min-y, min-x, max-y, and max-x of a shape’s coordinates as multiple values.

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: split-lines (str)

Split a string containing newlines into a list of strings.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: split-string (str &optional ch)

Split the string into a list of words separated by one or more chars.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: stack-empty-p (stack)

Return t if there are no items on the stack, nil otherwise.

Package

de.anvi.croatoan.

Source

stack.lisp.

Function: stack-move (obj-or-n pos-or-dir stack)

Move an object in the stack.

The object can be passed directly and is the compared by eq, or by its position in the stack.

Valid movement directions are :up :down :top and :bottom.

Package

de.anvi.croatoan.

Source

stack.lisp.

Function: stack-pop (stack)

Remove and return the top item off the stack.

Package

de.anvi.croatoan.

Source

stack.lisp.

Function: stack-push (obj stack)

Add the object or objects on top of the stack.

Package

de.anvi.croatoan.

Source

stack.lisp.

Function: string-to-char (str)

Take a string representing a character, return the corresponding character.

The char can be a printable, graphical char or a control char in the caret ^A notation.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: string-width (str)

Return the number of columns required to display the string.

If the string contains a non-printable character, return nil.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: tigetstr (capname)

Take a terminfo capability name, return its string value.

Error return values:

-1 if capname is not a string capability,
0 if it is canceled or absent from the terminal description.

This function is just a thin convenience wrapper around ncurses:tigetstr, so we dont have to deal with C pointers.

Package

de.anvi.croatoan.

Source

terminfo.lisp.

Function: toggle-insert-mode (object)

Toggle the insert mode boolean property of the object.

This applies to window, field and textarea objects, for example.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: toggle-item-checkbox (menu)

Toggle the checked state of the current item, used in checkbox menus.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: touch ()

Force all labels to be output on the next refresh.

Touch marks the label line as changed because refresh only considers changed cells.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: triangle (y0 x0 y1 x1 y2 x2 &key filled char)

Return a triangle (utility wrapper around ‘polygon’).

Package

de.anvi.croatoan.

Source

shape.lisp.

Function: unbind (object event)

Remove the event and the handler function from object’s bindings alist.

If event argument is a list, remove the whole sequence of events (key chain).

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: unget-char (chtype)

Take a simple C chtype and put it back into the read buffer.

It will be read with the next call to get-char.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: unpair-plist (plist)

Separate a plist into two lists, returned as separate values.

The first list contains the keys and the second the values.

Example: (unpair-plist ’(a 1 b 2 c 3)) => (a b c), (1 2 3)

The resulting keys and values can be combined back into the initial plist by the function ‘pair-plist’.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: use-terminal-colors-p (screen)
Package

de.anvi.croatoan.

Source

attr.lisp.

Function: (setf use-terminal-colors-p) (screen)
Package

de.anvi.croatoan.

Source

attr.lisp.

Function: wacs (char-name)

Take a keyword symbol, return the wide unicode integer representing the ACS char.

Package

de.anvi.croatoan.

Source

add_wch.lisp.

Function: wait-for-event (win)

Wait till a valid event (keyboard, mouse or resize) occurs, then return.

If blocking is set to t, wait till any event is read.

If blocking is nil, ignore the nil events and only return when the first non-nil event is read.

The return value is not specified.

Package

de.anvi.croatoan.

Source

get_wch.lisp.

Function: wrap-lines (lines width)

Wrap a list of strings so that no single line exceeds the given width.

Package

de.anvi.croatoan.

Source

util.lisp.

Function: wrap-string (string width &optional split-length)

Insert newlines in the string so that no single line exceeds the width.

All pre-existing newlines and multiple spaces are removed.

Long words (by default >20 chars) are split instead of being wrapped. This avoids large gaps when long urls are wrapped, for example.

Package

de.anvi.croatoan.

Source

util.lisp.


5.1.4 Generic functions

Generic Reader: activep (object)
Generic Writer: (setf activep) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: activep ((element element))
Writer Method: (setf activep) ((element element))

If t (default), the element can be selected. Used to prevent labels from being selected.

Source

classes.lisp.

Target Slot

activep.

Generic Function: attributes (object)
Package

de.anvi.croatoan.

Methods
Method: attributes ((window window))
Source

classes.lisp.

Reader Method: attributes ((complex-char complex-char))

List of keywords denoting attributes.

Source

character.lisp.

Target Slot

attributes.

Generic Function: (setf attributes) (object)
Package

de.anvi.croatoan.

Methods
Method: (setf attributes) ((win window))
Source

classes.lisp.

Writer Method: (setf attributes) ((complex-char complex-char))

List of keywords denoting attributes.

Source

character.lisp.

Target Slot

attributes.

Generic Function: (setf attributes) ()
Package

de.anvi.croatoan.soft-labels.

Methods
Method: (setf attributes) ()

Set the attributes used for the rendition of soft labels.

This function only adds or removes attributes and does not affect the color attributes.

Source

slk.lisp.

Generic Function: background (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: background ((win window))
Generic Function: (setf background) (window &optional apply)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf background) ((window window) &optional apply)
Generic Function: bgcolor (object)
Package

de.anvi.croatoan.

Methods
Method: bgcolor ((win window))
Source

classes.lisp.

Reader Method: bgcolor ((complex-char complex-char))

A keyword denoting the background color of the complex character.

Source

character.lisp.

Target Slot

bgcolor.

Generic Function: (setf bgcolor) (object)
Package

de.anvi.croatoan.

Methods
Method: (setf bgcolor) ((win window))
Source

classes.lisp.

Writer Method: (setf bgcolor) ((complex-char complex-char))

A keyword denoting the background color of the complex character.

Source

character.lisp.

Target Slot

bgcolor.

Generic Reader: bindings (object)
Generic Writer: (setf bindings) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: bindings ((component component))
Writer Method: (setf bindings) ((component component))

Alist of events (characters, keywords or integers) as keys and handler functions as values. Used by the run-event-loop function.

Source

classes.lisp.

Target Slot

bindings.

Reader Method: bindings ((keymap keymap))
Writer Method: (setf bindings) ((keymap keymap))

Alist of events and handler functions (or sub-keymaps).

When the bindings are provided not as an alist, but as an plist for convenience, convert the plist to an alist.

The plist is easier to provide when there is a large number of bindings.

Source

classes.lisp.

Target Slot

bindings.

Generic Reader: border-width (object)
Package

de.anvi.croatoan.

Methods
Reader Method: border-width ((extended-window extended-window))
Source

classes.lisp.

Target Slot

border-width.

Generic Reader: borderp (object)
Package

de.anvi.croatoan.

Methods
Reader Method: borderp ((element element))

Border width, similar to padding, but with a drawn border.

Source

classes.lisp.

Target Slot

borderp.

Reader Method: borderp ((window window))

Draw (t) or don’t draw (nil, default) an initial border around a window. Not redrawn automatically.

Source

classes.lisp.

Target Slot

borderp.

Generic Reader: buffer (object)
Generic Writer: (setf buffer) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: buffer ((textarea textarea))
Writer Method: (setf buffer) ((textarea textarea))

List containing the characters of the textarea.

Source

textarea.lisp.

Target Slot

buffer.

Reader Method: buffer ((field field))
Writer Method: (setf buffer) ((field field))

List containing the characters in the field.

Source

field.lisp.

Target Slot

buffer.

Generic Function: calculate-layout (node)

Recursively calculate the missing geometry parameters for the node’s children.

Package

de.anvi.croatoan.

Source

grid.lisp.

Methods
Method: calculate-layout ((node column-layout))
Method: calculate-layout ((node row-layout))

Recursively calculate the geometries of layout’s children.

If initial widths are not given, evenly split the remaining parent width.

This routine can be used to calculate a layout of windows on a screen and recalculate their geometries for example after a terminal resize.

After the initial calculation, initialize-leaves has to be called in order to initialize the window objects (and call the underlying ncurses functions).

See examples t43, t43a.

Generic Reader: callback (object)
Generic Writer: (setf callback) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: callback ((button button))
Writer Method: (setf callback) ((button button))

Callback function called when the button is activated.

Source

classes.lisp.

Target Slot

callback.

Generic Function: char-to-string (char)

Return a string representing the char.

Control characters are displayed using the ^X notation.

Function keys are not represented by this routine. Use key-to-string instead.

Package

de.anvi.croatoan.

Source

util.lisp.

Methods
Method: char-to-string ((char integer))
Method: char-to-string ((char character))
Generic Reader: checkedp (object)
Generic Writer: (setf checkedp) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: checkedp ((checkbox checkbox))
Writer Method: (setf checkedp) ((checkbox checkbox))

t if the checkbox has been checked, nil if it hasn’t.

Source

classes.lisp.

Target Slot

checkedp.

Generic Reader: children (object)
Generic Writer: (setf children) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: children ((node node))
Writer Method: (setf children) ((node node))

List of children.

Source

classes.lisp.

Target Slot

children.

Generic Function: clear (object &key redraw target)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: clear ((window window) &key redraw target)

Clear the window by overwriting it with blanks.

If the keyword redraw is t, first copy blanks to every position in the window, then set the clear-redraw-flag to have the window redrawn from scratch on the next refresh.

If target is :end-of-line, clear the window from the cursor to the end of the current line.

If target is :bottom, clear the window from the cursor to the end of the current line and all lines below.

Source

clear.lisp.

Method: clear ((obj element) &key)

Clear the element by overwriting the underlying window with the background char.

The default background char is #space.

If the underlying window has a background char, that will be used to
clear the window instead of #space.

The char, attributes and colors can be set by providing the following styles:

:border
:selected-border
:background
:selected-background

If an element is inactive, for example the label, the selected style is not applied.

Source

form.lisp.

Method: clear ((obj menu-window) &key)
Source

menu.lisp.

Method: clear ((obj menu) &key)
Source

menu.lisp.

Generic Function: closed-p (s)

Check whether the screen has been closed without a subsequent call to refresh to reactivate it.

Package

de.anvi.croatoan.

Source

initscr.lisp.

Methods
Method: closed-p ((s screen))
Generic Function: color-pair (object)

Return the color pair of the object as a 2-element list (fg bg).

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: color-pair (object)
Generic Function: (setf color-pair) (object)

Set the color pair of the object by setting the fgcolor and bgcolor properties.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf color-pair) ((win window))
Method: (setf color-pair) (object)
Generic Function: column-widths (obj dimensions)
Package

de.anvi.croatoan.

Source

grid.lisp.

Methods
Method: column-widths ((obj list) dimensions)

Take a list of objects, return a list of max widths of every column.

Method: column-widths ((obj array) dimensions)

Take a table (2D array), return a list of max widths of every column.

Generic Reader: complex-char-array (object)
Generic Writer: (setf complex-char-array) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: complex-char-array ((complex-string complex-string))
Writer Method: (setf complex-char-array) ((complex-string complex-string))

Lisp primitive string type.

Source

character.lisp.

Target Slot

complex-char-array.

Generic Function: concat-complex-string (a b &key color-attributes-contagion)

Return a new ‘complex-string’ that is the result of concatenating ‘a’ and ’b’.

If ‘color-attributes-contagion’ is non nil, ‘b’ will inherit all the attributes and color of the last element of ‘a’.

Package

de.anvi.croatoan.

Source

character.lisp.

Methods
Method: concat-complex-string ((a complex-string) (b complex-string) &key color-attributes-contagion)

Concatenate and return two ‘complex-strings’ ‘a’ and ‘b’.

If ‘color-attributes-contagion’ is non nil ‘b’ will inherit all the attributes and color of the last element of ‘a’.

Method: concat-complex-string ((a sequence) (b complex-string) &key color-attributes-contagion)

Return a complex string that is the result of concatenating ‘a’ (string) and ‘b’ (complex-string).

If ‘color-attributes-contagion’ is non nil, ‘a’ will inherit all the
attributes and color of the first element of ‘b’.

Method: concat-complex-string ((a complex-string) (b sequence) &key color-attributes-contagion)

Return a complex string that is the results of concatenating of ‘a’ (a ‘complex-string’) and ‘b’ (a string).

If ‘color-attributes-contagion’ is non nil ‘b’ will inherit all the
attributes and color of the last element of ‘a’.

Generic Function: convert-char (char result-type)

Take a char and convert it to a char of result-type.

Package

de.anvi.croatoan.

Source

attr.lisp.

Methods
Method: convert-char ((char integer) result-type)
Method: convert-char ((char character) result-type)
Method: convert-char ((char complex-char) result-type)
Generic Reader: coordinates (object)
Generic Writer: (setf coordinates) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: coordinates ((shape shape))
Writer Method: (setf coordinates) ((shape shape))

A list of coordinates relative to the origin that form this shape.

Source

shape.lisp.

Target Slot

coordinates.

Generic Function: current-item (collection)

Return the current object from the collection.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: current-item (collection)
Method: current-item ((obj layout))

If n is the current item number, return the nth leaf of a layout tree.

Source

grid.lisp.

Generic Reader: current-item-mark (object)
Package

de.anvi.croatoan.

Methods
Reader Method: current-item-mark ((menu menu))

A string prefixed to the current item in the menu.

Source

menu.lisp.

Target Slot

current-item-mark.

Generic Function: cursor-position (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: cursor-position ((win window))
Generic Function: (setf cursor-position) (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf cursor-position) ((win window))
Generic Function: cursor-position-x (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Reader Method: cursor-position-x ((textarea textarea))

X position (column) in the textarea window where the next character will be added.

Source

textarea.lisp.

Target Slot

cursor-position-x.

Method: cursor-position-x ((win window))
Generic Function: (setf cursor-position-x) (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Writer Method: (setf cursor-position-x) ((textarea textarea))

X position (column) in the textarea window where the next character will be added.

Source

textarea.lisp.

Target Slot

cursor-position-x.

Method: (setf cursor-position-x) ((win window))
Generic Function: cursor-position-y (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Reader Method: cursor-position-y ((textarea textarea))

Y position (row) in the textarea window where the next character will be added.

Source

textarea.lisp.

Target Slot

cursor-position-y.

Method: cursor-position-y ((win window))
Generic Function: (setf cursor-position-y) (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Writer Method: (setf cursor-position-y) ((textarea textarea))

Y position (row) in the textarea window where the next character will be added.

Source

textarea.lisp.

Target Slot

cursor-position-y.

Method: (setf cursor-position-y) ((win window))
Generic Function: cursor-visible-p (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: cursor-visible-p ((screen screen))
Generic Function: (setf cursor-visible-p) (screen)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf cursor-visible-p) ((screen screen))
Generic Reader: cyclicp (object)
Generic Writer: (setf cyclicp) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: cyclicp ((collection collection))
Writer Method: (setf cyclicp) ((collection collection))

If true, the first element is selected after the last.

Source

classes.lisp.

Target Slot

cyclicp.

Generic Function: delete-function-key (object)

Delete one or more (code . key) mappings from *key-alist*.

Package

de.anvi.croatoan.

Source

getch.lisp.

Methods
Method: delete-function-key ((key key))

Take a key struct, delete the mapping (code . key) from *key-alist*.

Method: delete-function-key ((key-code integer))

Delete the key with the given unique code from *key-alist*.

Method: delete-function-key ((key-name symbol))

Delete all keys with the given keyword name from *key-alist*.

Since more than one key can have the same name, becuse key structs can have different modifier slots, all the keys with the given name are deleted.

Generic Function: delete-next-char (object)

Delete the next char (the char under the cursor), without moving the cursor.

Instead of moving the cursor, the rest of the line is moved one cell to the left.

Package

de.anvi.croatoan.

Source

field.lisp.

Methods
Method: delete-next-char ((area textarea))
Source

textarea.lisp.

Method: delete-next-char ((field field))

Delete the next char (char under the cursor) in the field, not moving the cursor.

Generic Function: delete-previous-char (object)

Delete the previous char, moving the cursor to the left.

Package

de.anvi.croatoan.

Source

field.lisp.

Methods
Method: delete-previous-char ((area textarea))
Source

textarea.lisp.

Method: delete-previous-char ((field field))

Delete the previous char in the field, moving the cursor to the left.

Generic Function: dequeue (queue)
Package

de.anvi.croatoan.

Source

queue.lisp.

Methods
Method: dequeue ((queue simple-queue))

Pop of the first element of queue and return it, returns NIL when queue is empty.

Method: dequeue ((queue queue))

Pop of the first element of queue and return it, returns NIL when queue is empty

Generic Function: dimensions (object)

Return a two-element list with the height and width of the object.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: dimensions (object)
Generic Function: (setf dimensions) (object)

Take a list (height width) and an object, set its height and width.

The default method just sets the slots height and width of a widget, so call-next-method should be called for ncurses-based widgets in addition to underlying ncurses calls.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf dimensions) ((win window))
Method: (setf dimensions) (object)
Generic Function: draw (object)

Draw objects (form, field, menu) to their associated window.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: draw ((obj dropdown))
Source

dropdown.lisp.

Method: draw ((area textarea))
Source

textarea.lisp.

Method: draw ((field field))

Clear and redraw the field and its contents and background.

Source

field.lisp.

Method: draw ((win form-window))

Draw the the border and the title, then the form.

Source

form.lisp.

Method: draw ((win extended-window))

Draw the background window, and the title and the border if they are given.

Source

form.lisp.

Method: draw ((form form))

Draw the form by drawing the elements, then moving the cursor to the current element.

Source

form.lisp.

Method: draw ((checkbox checkbox))
Source

form.lisp.

Method: draw ((button button))
Source

form.lisp.

Method: draw ((obj label))
Source

form.lisp.

Method: draw ((menu menu-window))

Draw the menu to position (0 0) of its window.

Source

menu.lisp.

Method: draw ((menu menu))

Draw the menu to its associated window.

Source

menu.lisp.

Generic Function: elements (obj)
Package

de.anvi.croatoan.

Methods
Method: elements ((obj form))
Source

classes.lisp.

Generic Function: (setf elements) (obj)
Package

de.anvi.croatoan.

Methods
Method: (setf elements) ((obj form))
Source

classes.lisp.

Generic Function: enqueue (item queue)
Package

de.anvi.croatoan.

Source

queue.lisp.

Methods
Method: enqueue (item (queue simple-queue))

Push a new item onto the tail of the queue, return the new item.

Method: enqueue (item (queue queue))

Push a new item onto the tail of the queue, return the new item.

Generic Reader: event-code (object)
Package

de.anvi.croatoan.

Methods
Reader Method: event-code ((event event))

Integer code representing the character or function key as returned by ncurses:getch or get_wch.

Source

classes.lisp.

Target Slot

code.

Generic Reader: event-key (object)
Package

de.anvi.croatoan.

Methods
Reader Method: event-key ((event event))

Lisp character representing a character key or key struct representing a function key or mouse button.

Source

classes.lisp.

Target Slot

key.

Generic Function: fgcolor (object)
Package

de.anvi.croatoan.

Methods
Method: fgcolor ((win window))
Source

classes.lisp.

Reader Method: fgcolor ((complex-char complex-char))

A keyword denoting the foreground color of the complex character.

Source

character.lisp.

Target Slot

fgcolor.

Generic Function: (setf fgcolor) (object)
Package

de.anvi.croatoan.

Methods
Method: (setf fgcolor) ((win window))
Source

classes.lisp.

Writer Method: (setf fgcolor) ((complex-char complex-char))

A keyword denoting the foreground color of the complex character.

Source

character.lisp.

Target Slot

fgcolor.

Generic Function: frame-rate (obj)

Set the frame rate of the event loop in fps (frames per second).

If the widget is a window, this sets the input-blocking duration of the window.

If the widget is not a window (for example a menu, form or element), setting the frame rate essentially sets the input-blocking duration of its associated window.

We have the following relation between the frame rate and the blocking duration:

If the frame rate is nil (default) or 0, input blocking is t (default).

If the frame rate is an integer below 2000, the blocking is 1000/rate miliseconds.

If the frame rate is greater or equal than 2000 fps, the blocking is nil.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: frame-rate ((win window))

Return the frame-rate of a window from its input blocking delay.

blocking frame-rate
t nil
nil 2000
100 1000/100

Method: frame-rate (obj)

If the object is not a window, return the frame rate of its underlying window.

Generic Function: (setf frame-rate) (obj)

Set the frame rate of a window or a widget.

A non-nil frame rate implies non-blocking delayed input.

Setting the frame rate sets the input-blocking delay of a window.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf frame-rate) ((win window))

Set the input blocking by setting the frame rate in fps (frames per second).

If the frame rate is nil or 0, input blocking is t.

If the frame rate is a number below 2000, the blocking delay is 1000/rate ms.

If the frame rate is greater or equal than 2000, the blocking is nil.

frame-rate blocking
nil,0 t
<2000 1000/frame-rate
>=2000 nil

Method: (setf frame-rate) (obj)

If the widget is not a window, set the delay of its associated window.

Generic Function: function-keys-enabled-p (window)

If t, function keys will be recognized when returned by get-char.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: function-keys-enabled-p ((window window))
Generic Function: (setf function-keys-enabled-p) (window)

If flag is t, bind function keys to known codes when returned by get-char.

If flag is nil, F keys will be system-dependent multi-character escape codes.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf function-keys-enabled-p) ((window window))
Generic Function: geometry (object)

Return the geometry of the object as a list (y x width height).

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: geometry ((object window))

Return the geometry (y x h w) as returned by ncurses, not the slots.

Method: geometry ((object layout))
Method: geometry (object)
Generic Function: (setf geometry) (object)

Set the geometry (y x width height) of the object.

The default method sets the slots of the object.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf geometry) ((win window))
Method: (setf geometry) ((object layout))
Method: (setf geometry) (object)
Generic Function: get-wide-event (object)

Return a single user input event and its code as a second value.

If the object is not a window, the event is read from the object’s associated window.

An event can be a lisp character or a keyword representing a function or mouse key.

If input-blocking is nil for the window, return nil if no key was typed.

Package

de.anvi.croatoan.

Source

get_wch.lisp.

Methods
Method: get-wide-event ((object form-window))
Method: get-wide-event ((object window))

Return a single user input event and its code as a second value.

An event can be a lisp character or a keyword representing a function or mouse key.

If input-blocking is nil for the window, return nil if no key was typed.

Method: get-wide-event (object)

Default method: Read an event from the window associated with object.

Generic Function: height (object)

Return the height of the object.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Reader Method: height ((textarea textarea))

The height (number of visible lines) of the textarea. The area can be scrolled vertically.

Source

textarea.lisp.

Target Slot

height.

Method: height ((obj field))
Source

field.lisp.

Method: height ((obj menu))
Source

menu.lisp.

Method: height ((obj symbol))
Method: height ((obj number))
Method: height ((obj string))
Method: height ((obj (eql nil)))
Method: height ((obj label))

If the label was given an explicit height, return the given height.

Otherwise calculate the height from the displayed text.

Method: height ((obj button))
Method: height ((window window))
Method: height (object)
Method: height ((obj layout))

The height of a layout consists of the max heights of the rows and the gaps between them.

Source

grid.lisp.

Generic Function: (setf height) (object)

Resize the object to have the new height.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Writer Method: (setf height) ((textarea textarea))

The height (number of visible lines) of the textarea. The area can be scrolled vertically.

Source

textarea.lisp.

Target Slot

height.

Method: (setf height) ((win window))
Method: (setf height) (object)

The default method sets the height slot of the object.

Generic Reader: hooks (object)
Generic Writer: (setf hooks) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: hooks ((component component))
Writer Method: (setf hooks) ((component component))

Alist of hooks registered with the object.

Source

classes.lisp.

Target Slot

hooks.

Generic Function: input-blocking (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: input-blocking ((window window))
Generic Function: (setf input-blocking) (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf input-blocking) ((window window))
Generic Function: input-buffering-p (screen)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: input-buffering-p ((screen screen))
Generic Function: (setf input-buffering-p) (screen)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf input-buffering-p) ((screen screen))
Generic Function: input-echoing-p (screen)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: input-echoing-p ((screen screen))
Generic Function: (setf input-echoing-p) (screen)

Set whether chars will be echoed on input.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf input-echoing-p) ((screen screen))
Generic Reader: insert-mode-p (object)
Generic Writer: (setf insert-mode-p) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: insert-mode-p ((textarea textarea))
Writer Method: (setf insert-mode-p) ((textarea textarea))

Printing a new char will insert (t, default) it before the character under the cursor instead of overwriting it (nil).

Source

textarea.lisp.

Target Slot

insert-mode-p.

Reader Method: insert-mode-p ((field field))
Writer Method: (setf insert-mode-p) ((field field))

Printing a new char will insert (t) it before the character under the cursor instead of overwriting it (nil, default).

Source

field.lisp.

Target Slot

insert-mode-p.

Reader Method: insert-mode-p ((window window))
Writer Method: (setf insert-mode-p) ((window window))

Printing a new char will insert (t) it before the character under the cursor instead of overwriting it (nil, default).

Source

classes.lisp.

Target Slot

insert-mode-p.

Generic Function: items (object)
Package

de.anvi.croatoan.

Methods
Method: items ((obj collection))

The children of a collection can be accessed as items.

Source

classes.lisp.

Reader Method: items ((stack stack))

List containing the items.

Source

stack.lisp.

Target Slot

items.

Generic Function: (setf items) (object)
Package

de.anvi.croatoan.

Methods
Method: (setf items) ((obj collection))

The children of a collection can be accessed as items.

Source

classes.lisp.

Writer Method: (setf items) ((stack stack))

List containing the items.

Source

stack.lisp.

Target Slot

items.

Generic Function: key-to-string (key)

Return a string representing the key.

The key can be a printable character, a control character or a function key.

In particular:

- A printable character becomes a string containing that character (e.g. #a -> "a");

- A control character becomes a string with the (upcased) character prefixed with the caret character (#^). (e.g Control-j -> "^J")

- A keyword becomes a string.
Note that the key names returned by ncurses in general do not correspond to the key names used by croatoan.

KEY_LEFT vs LEFT
KEY_F(1) vs F1
kLFT5 vs CTRL-LEFT

See: https://en.wikipedia.org/wiki/Control_character#How_control_characters_map_to_keyboards

Package

de.anvi.croatoan.

Source

util.lisp.

Methods
Method: key-to-string ((key integer))

Take the integer code representing a character, return a string representing that character in ncurses/terminfo.

Method: key-to-string ((key character))

Take a lisp character, return a string representing that character in ncurses/terminfo.

Control characters are represented in caret notation, for example ^J.

Method: key-to-string ((key-name symbol))

Take a keyword representing a croatoan function key name, return the corresponding ncurses/terminfo name as a string.

Method: key-to-string ((key key))

Take a key struct, return the ncurses/terminfo name as a string.

Generic Reader: keymap (object)
Generic Writer: (setf keymap) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: keymap ((component component))
Writer Method: (setf keymap) ((component component))

Keymap containing the key bindings to be used by run-event-loop instead
of the object’s own bindings. If using an instance-local binding isn’t sufficient, we can create an external keymap and reference it in the object.

Source

classes.lisp.

Target Slot

keymap.

Generic Reader: layout (object)
Generic Writer: (setf layout) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: layout ((form form))
Writer Method: (setf layout) ((form form))

The elements of a form can be passed in a layout object.

Source

classes.lisp.

Target Slot

layout.

Generic Function: mark-for-refresh (win &rest args)

Mark a window for a later refresh.

Copy a window to the virtual screen, but do not display it on the visible physical screen.

After all windows are marked, call refresh-marked to display all marked refreshes.

refresh = mark + refresh-marked

The goal of this batch refresh is improved efficiency and preventing flicker that might occur if several refreshes are called in sequence.

Package

de.anvi.croatoan.

Source

refresh.lisp.

Methods
Method: mark-for-refresh ((win panel) &rest args)

Refreshing a panel also refreshes its shadow and border, if existing.

Method: mark-for-refresh ((win pad) &rest args)

A pad requires 6 additional arguments to be refreshed.

The additional arguments are required to specify which part of the pad should be displayed and on which position on the screen.

All 6 arguments have to be given, otherwise an error is signalled. We don’t have default arguments.

Method: mark-for-refresh ((win window) &rest args)

A window does not require any additional arguments to be refreshed.

Generic Reader: max-buffer-length (object)
Generic Writer: (setf max-buffer-length) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: max-buffer-length ((field field))
Writer Method: (setf max-buffer-length) ((field field))

Max length of the field buffer. If nil, it will be initialized to field width. Horizontal scrolling is then disabled.

Source

field.lisp.

Target Slot

max-buffer-length.

Generic Reader: max-item-length (object)
Generic Writer: (setf max-item-length) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: max-item-length ((menu menu))
Writer Method: (setf max-item-length) ((menu menu))

If the variable column width is nil, this is the default width of all items.

If the variable column width is t, the width of every column is calculated from the item titles and the columns exceeding max item length are ellipsized or truncated.

Source

menu.lisp.

Target Slot

max-item-length.

Generic Reader: menu-type (object)
Generic Writer: (setf menu-type) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: menu-type ((menu menu))
Writer Method: (setf menu-type) ((menu menu))

Types of menus: :selection (default) or :checklist.

Source

menu.lisp.

Target Slot

menu-type.

Generic Function: move-down (obj)

Move the current grid position one cell downwards.

Package

de.anvi.croatoan.

Source

grid.lisp.

Methods
Method: move-down ((obj menu))
Source

menu.lisp.

Method: move-down ((grid grid))
Generic Function: move-left (obj)

Move the current grid position one cell to the left.

Package

de.anvi.croatoan.

Source

grid.lisp.

Methods
Method: move-left ((obj menu))
Source

menu.lisp.

Method: move-left ((grid grid))
Generic Function: move-next-char (object)

Move the cursor to the next char.

Package

de.anvi.croatoan.

Source

form.lisp.

Methods
Method: move-next-char ((area textarea))

Move the cursor to the next char in the textarea.

Source

textarea.lisp.

Method: move-next-char ((field field))

Move the cursor to the next char in the field.

Source

field.lisp.

Method: move-next-char (object)

The default method does nothing.

Generic Function: move-previous-char (object)

Move the cursor to the previous character.

Package

de.anvi.croatoan.

Source

form.lisp.

Methods
Method: move-previous-char ((area textarea))

Move the cursor to the previous char in the textarea.

Source

textarea.lisp.

Method: move-previous-char ((field field))

Move the cursor to the previous char in the field.

Source

field.lisp.

Method: move-previous-char (object)

The default method does nothing.

Generic Function: move-right (obj)

Move the current grid position one cell to the right.

Package

de.anvi.croatoan.

Source

grid.lisp.

Methods
Method: move-right ((obj menu))
Source

menu.lisp.

Method: move-right ((grid grid))
Generic Function: move-up (obj)

Move the current grid position one cell upwards.

Package

de.anvi.croatoan.

Source

grid.lisp.

Methods
Method: move-up ((obj menu))
Source

menu.lisp.

Method: move-up ((grid grid))
Generic Reader: name (object)
Package

de.anvi.croatoan.

Methods
Reader Method: name ((component component))

Optional unique name by which the object can be identified and accessed. If the title is t, the name is displayed instead of the title.

Source

classes.lisp.

Target Slot

name.

Generic Function: newline-translation-enabled-p (screen)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: newline-translation-enabled-p ((screen screen))
Generic Function: (setf newline-translation-enabled-p) (screen)

If status is t, enable translation of RET to NL on input, and NL to RET and LF on output.

It is enabled by default.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf newline-translation-enabled-p) ((screen screen))
Generic Reader: origin-x (object)
Generic Writer: (setf origin-x) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: origin-x ((shape shape))
Writer Method: (setf origin-x) ((shape shape))

The x coordinate of this shape’s point of origin.

Source

shape.lisp.

Target Slot

origin-x.

Generic Reader: origin-y (object)
Generic Writer: (setf origin-y) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: origin-y ((shape shape))
Writer Method: (setf origin-y) ((shape shape))

The y coordinate of this shape’s point of origin.

Source

shape.lisp.

Target Slot

origin-y.

Generic Reader: parent (object)
Generic Writer: (setf parent) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: parent ((node node))
Writer Method: (setf parent) ((node node))

Pointer to the parent object.

Source

classes.lisp.

Target Slot

parent.

Reader Method: parent ((element element))
Writer Method: (setf parent) ((element element))

Parent form of the element. Added to every element upon the initialization of the form.

Source

classes.lisp.

Target Slot

parent.

Reader Method: parent ((keymap keymap))
Writer Method: (setf parent) ((keymap keymap))

Parent keymaps given as a symbol name or keymap object.

Source

classes.lisp.

Target Slot

parent.

Generic Reader: plot-char (object)
Generic Writer: (setf plot-char) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: plot-char ((shape shape))
Writer Method: (setf plot-char) ((shape shape))

The character to use for plotting.

Source

shape.lisp.

Target Slot

plot-char.

Generic Function: position-x (object)

Return the x position (column) of the top left corner of the widget.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: position-x ((win sub-window))
Method: position-x ((win window))
Method: position-x (object)
Generic Function: (setf position-x) (object)

Set the x position (column) of the top left corner of the widget.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf position-x) ((win window))
Method: (setf position-x) (object)
Generic Function: position-y (object)

Return the y position (row) of the top left corner of the widget.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: position-y ((win sub-window))
Method: position-y ((win window))
Method: position-y (object)
Generic Function: (setf position-y) (object)

Set the y position (row) of the top left corner of the widget.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf position-y) ((win window))
Method: (setf position-y) (object)
Generic Function: process-control-chars-p (screen)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: process-control-chars-p ((screen screen))
Generic Function: (setf process-control-chars-p) (screen)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf process-control-chars-p) ((screen screen))
Generic Function: refresh (obj &rest args)

Redisplay the object after changes have been made to it.

Copy the object to the virtual screen, then updates the visible physical screen by the contents of the virtual screen.

Package

de.anvi.croatoan.

Source

stack.lisp.

Methods
Method: refresh ((pad pad) &rest args)

A pad requires 6 additional arguments to be refreshed.

The additional arguments are required to specify which part of the pad should be displayed and on which position on the screen.

The top-left corner of the rectangular area of the pad to be displayed.

1. pad-min-y
2. pad-min-x

The top-left and bottom-right corner of the screen where the pad should be displayed.

3. screen-min-y
4. screen-min-x

5. screen-max-y
6. screen-max-y

All 6 arguments have to be given, otherwise an error is signalled. There are no default arguments.

Source

refresh.lisp.

Method: refresh ((win window) &rest args)

Redisplay the window after changes have been made to it.

Copies a window to the virtual screen, then updates the visible physical screen by the contents of the virtual screen.

Only updates the changed parts of the window. In order to redraw the whole window, it has to be explicitely touched or marked for redraw.

A window does not require any additional arguments to be refreshed. Any provided additional arguments are ignored.

Source

refresh.lisp.

Method: refresh ((win panel) &rest args)
Source

classes.lisp.

Method: refresh ((stack stack) &rest args)

Touch and refresh visible windows in the window stack.

The windows are refreshed in the order they are added, so that if the windows overlap, the window added last will be displayed on top.

Generic Function: remove-item (collection &optional number)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: remove-item ((obj collection) &optional number)

Remove the item given by its number from the collection list.

If the item number is not given, remove the current element.

Current number is decreased when we remove an item before the current or when we remove the last item, when it is current.

Generic Function: reset (object)

Clear user-editable form elements and reset its internal buffers and pointers.

Package

de.anvi.croatoan.

Source

form.lisp.

Methods
Method: reset ((obj dropdown))
Source

dropdown.lisp.

Method: reset ((area textarea))

Clear the textarea and reset its internal buffers and pointers.

Source

textarea.lisp.

Method: reset ((field field))
Source

field.lisp.

Method: reset ((form form))
Generic Function: row-heights (obj dimensions)
Package

de.anvi.croatoan.

Source

grid.lisp.

Methods
Method: row-heights ((obj list) dimensions)

Take a list of objects, return a list of max heights of every row.

Method: row-heights ((obj array) dimensions)
Generic Function: scrolling-enabled-p (window)

If t, scrolling is enabled.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: scrolling-enabled-p ((window window))
Generic Function: (setf scrolling-enabled-p) (window)

Enables and disables window scrolling.

If flag is t, when the curses moves below the bottom line of a window or scrolling region, the window/region is scrolled.

If flag is nil, the cursor is left on the bottom line.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf scrolling-enabled-p) ((window window))
Generic Function: scrolling-region (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: scrolling-region ((window window))
Generic Function: (setf scrolling-region) (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf scrolling-region) ((window window))
Generic Function: select (obj)
Package

de.anvi.croatoan.

Source

menu.lisp.

Methods
Method: select ((menu menu-window))

Display the menu, let the user select an item, return the selected item.

If the selected item is a menu object, recursively display the sub menu.

Method: select ((obj menu))
Generic Function: select-first-item (collection)

Select the first item in the collection.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: select-first-item (collection)
Generic Function: select-last-item (collection)

Select the last item in the collection.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: select-last-item (collection)
Generic Function: select-next-item (collection)

Select the next item in the collection.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: select-next-item ((form form))

Select the next element in a form’s element list.

Source

form.lisp.

Method: select-next-item (collection)
Method: select-next-item ((obj layout))
Source

grid.lisp.

Generic Function: select-previous-item (collection)

Select the previous item in the collection.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: select-previous-item ((form form))

Select the previous element in a form’s element list.

Source

form.lisp.

Method: select-previous-item (collection)
Method: select-previous-item ((obj layout))
Source

grid.lisp.

Generic Reader: selectedp (object)
Generic Writer: (setf selectedp) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: selectedp ((element element))
Writer Method: (setf selectedp) ((element element))

Flag denoting whether the element is currently selected in a form.

Source

classes.lisp.

Target Slot

selectedp.

Generic Reader: selection-callback (object)
Generic Writer: (setf selection-callback) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: selection-callback ((collection collection))
Writer Method: (setf selection-callback) ((collection collection))

Function called when a new item is selected.

Source

classes.lisp.

Target Slot

selection-callback.

Generic Reader: simple-char (object)
Generic Writer: (setf simple-char) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: simple-char ((complex-char complex-char))
Writer Method: (setf simple-char) ((complex-char complex-char))

Lisp primitive character type, like #a.

Source

character.lisp.

Target Slot

simple-char.

Generic Function: (setf source-position) (sub-window)

Set the position of the parent window that will be mirrored in the sub-window.

By default it is identical to the position of the sub-window.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf source-position) ((w sub-window))
Generic Function: stackedp (win)
Package

de.anvi.croatoan.

Methods
Method: stackedp ((win window))
Source

classes.lisp.

Generic Function: (setf stackedp) (win)
Package

de.anvi.croatoan.

Methods
Method: (setf stackedp) ((win window))

Add or remove the window to the global window stack.

Source

classes.lisp.

Generic Function: style (object)
Package

de.anvi.croatoan.

Methods
Method: style ((element element))

If the element’s style slot is empty, check whether a default style has been defined in the parent form.

Source

classes.lisp.

Reader Method: style ((component component))

A style is a plist with properties relevant to the rendering of an object.

The basic style corresponds to the slots of a complex-char:
:fgcolor, :bgcolor, :attributes and :simple-char

Currently, the compound styles for the following objects can be set:

form:
A plist of default styles for each form element type.

menu (styles of the menu items)
:foreground, :background, :selected-foreground, :selected-background

The default style of the selected item is the attribute :reverse,
and nil for other items.

button, checkbox:
:foreground and :selected-foreground.

field, textarea:
:foreground, :background, :selected-foreground, :selected-background.

Source

classes.lisp.

Target Slot

style.

Generic Function: (setf style) (object)
Package

de.anvi.croatoan.

Methods
Method: (setf style) ((win panel))
Source

classes.lisp.

Method: (setf style) ((win extended-window))
Source

classes.lisp.

Method: (setf style) ((win window))
Source

classes.lisp.

Writer Method: (setf style) ((component component))

A style is a plist with properties relevant to the rendering of an object.

The basic style corresponds to the slots of a complex-char:
:fgcolor, :bgcolor, :attributes and :simple-char

Currently, the compound styles for the following objects can be set:

form:
A plist of default styles for each form element type.

menu (styles of the menu items)
:foreground, :background, :selected-foreground, :selected-background

The default style of the selected item is the attribute :reverse,
and nil for other items.

button, checkbox:
:foreground and :selected-foreground.

field, textarea:
:foreground, :background, :selected-foreground, :selected-background.

Source

classes.lisp.

Target Slot

style.

Generic Reader: sub-window (object)
Package

de.anvi.croatoan.

Methods
Reader Method: sub-window ((extended-window extended-window))

Subwindow for content, for example a menu or a form.

Source

classes.lisp.

Target Slot

sub-window.

Generic Function: text-ellipsize (object len &key truncate-string)

If object length is bigger than ‘len’, cut the last characters out.

Also replaces the last n characters (where n is the length of ‘truncate-string’) of the shortened string with ‘truncate-string’.

It defaults to ..., but can be nil or the empty string.

Package

de.anvi.croatoan.

Source

character.lisp.

Methods
Method: text-ellipsize ((object complex-string) len &key truncate-string)
Method: text-ellipsize ((object string) len &key truncate-string)
Generic Function: text-right-pad (object total-size &key padding-char)

Prepend a number of copies of ‘padding-char’ to ‘object’ so that the latter has a length equals to ‘total-size’

Package

de.anvi.croatoan.

Source

character.lisp.

Methods
Method: text-right-pad ((object complex-string) (total-size number) &key padding-char)
Method: text-right-pad ((object string) (total-size number) &key padding-char)
Generic Function: text-slice (object start &optional end)

Returns a sub-sequence of ‘object’ starting from ‘start‘ and terminating at ‘end’.

If end in nil the the sub sequence ends alt the last element of the sequence.

Package

de.anvi.croatoan.

Source

character.lisp.

Methods
Method: text-slice ((object complex-string) start &optional end)
Method: text-slice ((object string) start &optional end)
Generic Function: text-width (object)

Returns the length (in characters units) of a complex string passed as argument ‘complex-string’.

Package

de.anvi.croatoan.

Source

character.lisp.

Methods
Method: text-width ((object complex-string))
Method: text-width ((object string))
Generic Reader: title (object)
Generic Writer: (setf title) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: title ((component component))
Writer Method: (setf title) ((component component))

Title of the object to be displayed to the user. If nil, no title is displayed. If the title is t, the name is displayed.

Source

classes.lisp.

Target Slot

title.

Generic Function: touch (win)

Touching a window marks all its cells as changed.

This makes the next call to refresh rewrite whe whole window instead of only the cells that have actually been changed.

The combination of touch and refresh is required to raise overlapping windows.

Package

de.anvi.croatoan.

Source

touch.lisp.

Methods
Method: touch ((win panel))

Touching a panel also touches its shadow and border window, if existing.

Method: touch ((win window))
Generic Function: value (object)
Package

de.anvi.croatoan.

Methods
Method: value ((obj dropdown))
Source

dropdown.lisp.

Method: value ((area textarea))

If the buffer is empty, return nil, otherwise return the buffer as a string.

Source

textarea.lisp.

Method: value ((field field))

If the field buffer is empty, return nil, otherwise return the buffer as a string.

Source

field.lisp.

Method: value ((checklist checklist))

Return the list of values of the checked items.

Source

menu.lisp.

Method: value ((menu menu))

Return the value of the selected item.

Source

menu.lisp.

Reader Method: value ((element element))

Value of the element, mostly the result of the form editing.

Source

classes.lisp.

Target Slot

value.

Generic Function: (setf value) (object)
Package

de.anvi.croatoan.

Methods
Method: (setf value) ((area textarea))

Set the buffer of the area to the string new-value.

Source

textarea.lisp.

Method: (setf value) ((field field))
Source

field.lisp.

Writer Method: (setf value) ((element element))

Value of the element, mostly the result of the form editing.

Source

classes.lisp.

Target Slot

value.

Generic Reader: visiblep (object)
Generic Writer: (setf visiblep) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: visiblep ((window window))
Writer Method: (setf visiblep) ((window window))

If visible is nil, do not refresh the stacked window when refreshing the window stack.

Source

classes.lisp.

Target Slot

visiblep.

Generic Function: widget-position (object)

Return the position (y x) of the top left corner of the widget.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: widget-position ((win sub-window))
Method: widget-position ((win window))
Method: widget-position (object)

The default method returns the values of the y and x slots in a two-element list.

If both y and x slots are nil, nil is returned instead of (nil nil).

Generic Function: (setf widget-position) (object)

Set the position (y x) of the top left corner of the widget.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf widget-position) ((win window))
Method: (setf widget-position) (object)

The default method sets the values of the y and x slots from a two-element list.

If position is nil, both y and x are set to nil.

Generic Function: width (object)

Return the width of the object.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: width ((obj dropdown))
Source

dropdown.lisp.

Reader Method: width ((textarea textarea))

The width (number of columns) of the textarea. The area can not be scrolled horizontally. Lines exceeding the width are soft-wrapped to the next line.
(This corresponds to the emacs behavior when truncate-lines is set to nil.)

Source

textarea.lisp.

Target Slot

width.

Reader Method: width ((field field))

The width of the field. The default buffer length is equal the width.

Source

field.lisp.

Target Slot

width.

Method: width ((obj menu))

content width = column-widths + item marks + item padding + checkbox

Source

menu.lisp.

Method: width ((obj symbol))
Method: width ((obj number))
Method: width ((obj string))
Reader Method: width ((obj label))
Target Slot

width.

Method: width ((obj (eql nil)))
Method: width ((obj button))
Method: width ((window window))
Method: width (object)
Method: width ((obj layout))

The width of a layout consists of the max widths of the columns and gaps between them.

Source

grid.lisp.

Generic Function: (setf width) (object)

Resize the object to have the new width.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Writer Method: (setf width) ((textarea textarea))

The width (number of columns) of the textarea. The area can not be scrolled horizontally. Lines exceeding the width are soft-wrapped to the next line.
(This corresponds to the emacs behavior when truncate-lines is set to nil.)

Source

textarea.lisp.

Target Slot

width.

Writer Method: (setf width) ((field field))

The width of the field. The default buffer length is equal the width.

Source

field.lisp.

Target Slot

width.

Method: (setf width) ((win window))
Method: (setf width) (object)

The default method sets the width slot of the object.

Writer Method: (setf width) ((label label))

The width of the label.

Target Slot

width.

Generic Function: window (object)
Package

de.anvi.croatoan.

Methods
Method: window ((element element))

Return the window associated with an element, which can optionally be part of a form.

If there is no window asociated with the element, return the window associated with the parent form.

Source

classes.lisp.

Reader Method: window ((form form))

Window created separately and then associated with the form.

Source

classes.lisp.

Target Slot

window.

Generic Function: (setf window) (object)
Package

de.anvi.croatoan.

Methods
Method: (setf window) ((element element))
Source

classes.lisp.

Writer Method: (setf window) ((form form))

Window created separately and then associated with the form.

Source

classes.lisp.

Target Slot

window.

Generic Function: window-position (window)

Deprecated but kept for backward compatibility, use the inherited widget-position instead.

Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: window-position ((win window))
Generic Function: (setf window-position) (window)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: (setf window-position) ((win window))
Generic Reader: winptr (object)
Package

de.anvi.croatoan.

Methods
Reader Method: winptr ((window window))

Pointer to a C/ncurses WINDOW structure after the window is created.

Source

classes.lisp.

Target Slot

winptr.


5.1.5 Standalone methods

Method: close ((stream menu-window) &key abort)
Source

menu.lisp.

Method: close ((stream sub-window) &key abort)
Source

classes.lisp.

Method: close ((stream window) &key abort)
Source

classes.lisp.

Method: close ((stream form-window) &key abort)
Source

classes.lisp.

Method: close ((win panel) &key abort)
Source

classes.lisp.

Method: close ((stream screen) &key abort)
Source

classes.lisp.

Method: close ((stream extended-window) &key abort)
Source

classes.lisp.

Method: initialize-instance :after ((form form) &key elements)
Source

classes.lisp.

Method: initialize-instance :after ((queue simple-queue) &key)
Source

queue.lisp.

Method: initialize-instance :after ((queue queue) &key)
Source

queue.lisp.

Method: initialize-instance :after ((obj layout) &key grid-gap)
Source

grid.lisp.

Method: initialize-instance ((obj msgbox) &rest initargs &key message buttons wrap-message)
Source

dialog.lisp.

Method: initialize-instance :after ((xch complex-char) &key color-pair)

If color-pair is passed as a keyword, set fgcolor and bgcolor.

Source

character.lisp.

Method: initialize-instance :after ((win menu-window) &key color-pair)
Source

menu.lisp.

Method: initialize-instance :after ((obj collection) &key items)
Source

classes.lisp.

Method: initialize-instance :after ((obj dropdown) &key items)
Source

dropdown.lisp.

Method: initialize-instance :after ((win pad) &key)
Source

classes.lisp.

Method: initialize-instance :after ((menu menu) &key item-padding)
Source

menu.lisp.

Method: initialize-instance :after ((win sub-window) &key)
Source

classes.lisp.

Method: initialize-instance :around ((win window) &key frame-rate)
Source

classes.lisp.

Method: initialize-instance :after ((win window) &key color-pair)
Source

classes.lisp.

Method: initialize-instance :after ((obj grid) &key grid-position grid-dimensions grid-geometry region-dimensions)
Source

grid.lisp.

Method: initialize-instance :after ((keymap keymap) &key)
Source

classes.lisp.

Method: initialize-instance :after ((obj widget) &key position dimensions geometry)
Source

classes.lisp.

Method: initialize-instance :after ((field field) &key)
Source

field.lisp.

Method: initialize-instance :after ((win form-window) &key)
Source

classes.lisp.

Method: initialize-instance :after ((cstr complex-string) &key string attributes fgcolor bgcolor color-pair)
Source

character.lisp.

Method: initialize-instance :after ((win sub-pad) &key)
Source

classes.lisp.

Method: initialize-instance :after ((win panel) &key)
Source

classes.lisp.

Method: initialize-instance :after ((scr screen) &key color-pair)
Source

classes.lisp.

Method: initialize-instance :after ((obj component) &key frame-rate)
Source

classes.lisp.

Method: initialize-instance :after ((win extended-window) &key)
Source

classes.lisp.

Method: initialize-instance :after ((obj element) &key margin padding border-width)
Source

classes.lisp.

Method: initialize-instance ((obj checklist) &rest initargs &key message buttons wrap-message choices)
Source

dialog.lisp.

Method: initialize-instance ((obj menubox) &rest initargs &key message buttons wrap-message choices)
Source

dialog.lisp.

Method: initialize-instance ((obj inputbox) &rest initargs &key message buttons wrap-message fields)
Source

dialog.lisp.

Method: initialize-instance :after ((obj dialog) &key center)
Source

dialog.lisp.

Method: make-load-form ((key key) &optional env)
Source

classes.lisp.

Method: make-load-form ((object complex-char) &optional environment)

Describe how complex-char objects can be serialized and loaded by the compiler.

Source

character.lisp.

Method: print-object ((obj job-error) stream)
Source

queue.lisp.

Method: print-object ((obj queue) stream)
Source

queue.lisp.

Method: print-object ((ch complex-char) stream)
Source

classes.lisp.

Method: print-object ((ch complex-char) (stream window))
Source

classes.lisp.

Method: print-object ((cstr complex-string) (stream window))
Source

classes.lisp.

Method: print-object ((str string) (stream window))
Source

classes.lisp.

Method: print-object ((ch character) (stream window))
Source

classes.lisp.

Method: print-object ((cstr complex-string) stream)
Source

classes.lisp.

Method: stream-line-column ((stream window))
Package

sb-gray.

Source

gray_streams.lisp.

Method: stream-read-char ((stream window))
Package

sb-gray.

Source

gray_streams.lisp.

Method: stream-unread-char ((stream window) (ch character))
Package

sb-gray.

Source

gray_streams.lisp.

Method: stream-write-char ((stream window) (ch complex-char))
Package

sb-gray.

Source

gray_streams.lisp.

Method: stream-write-char ((stream window) (ch character))
Package

sb-gray.

Source

gray_streams.lisp.


5.1.6 Conditions

Condition: job-error
Package

de.anvi.croatoan.

Source

queue.lisp.

Direct superclasses

error.

Direct methods

print-object.

Direct slots
Slot: form

The form that failed to execute

Initform

(quote (error "form required"))

Initargs

:form

Slot: error

The error that was signaled when form was executed

Package

common-lisp.

Initform

(quote (error "error required"))

Initargs

:error


5.1.7 Structures

Structure: key

Stuct representing a function key or a mouse button with modifier keys.

A key struct is associated with an escape sequence which is parsed by ncurses and returned from getch or get_wch as an integer code.

Every combination of a key name and the modifiers is represented by a separate code.

Supported modifiers are ctrl (C), alt (M) and shift (S).

In bindings, emacs notation is used to specify the keys which are then parsed to structs, for example C-S-M-<left>, C-<button-1-click>.

Also see: ‘bind’.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: name
Type

keyword

Readers

key-name.

Writers

(setf key-name).

Slot: ctrl
Type

boolean

Readers

key-ctrl.

Writers

(setf key-ctrl).

Slot: alt
Type

boolean

Readers

key-alt.

Writers

(setf key-alt).

Slot: shift
Type

boolean

Readers

key-shift.

Writers

(setf key-shift).


5.1.8 Classes

Class: button

An element that can call a function by pressing enter (or in future, with a mouse click).

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

element.

Direct subclasses

dropdown.

Direct methods
Direct Default Initargs
InitargValue
:keymap(quote button-map)
Direct slots
Slot: callback

Callback function called when the button is activated.

Type

(or null symbol function)

Initargs

:callback

Readers

callback.

Writers

(setf callback).

Class: checkbox

A boolean element that can be checked (t) or unchecked (nil)

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

element.

Direct subclasses

menu-item.

Direct methods
Direct Default Initargs
InitargValue
:keymap(quote checkbox-map)
Direct slots
Slot: checkedp

t if the checkbox has been checked, nil if it hasn’t.

Type

boolean

Initargs

:checked

Readers

checkedp.

Writers

(setf checkedp).

Class: checklist

A checklist is a multi-selection menu with checkable items.

Package

de.anvi.croatoan.

Source

menu.lisp.

Direct superclasses

menu.

Direct methods
Direct Default Initargs
InitargValue
:menu-typechecklist
:keymap(quote checklist-map)
Class: checklist
Package

de.anvi.croatoan.dialog.

Source

dialog.lisp.

Direct superclasses

dialog.

Direct methods

initialize-instance.

Class: collection

A collection is a list keeping track of the currently selected item.

Methods on collection objects allow selecting the previous item, next item, etc. The main use is keeping track of the currently selected element in a form or a layout.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

node.

Direct subclasses
Direct methods
Direct slots
Slot: current-item-number

Number (row major mode) of the currently selected item, nil if the list is empty.

Type

(or null integer)

Slot: selection-callback

Function called when a new item is selected.

Type

(or null symbol function)

Initargs

:selection-callback

Readers

selection-callback.

Writers

(setf selection-callback).

Slot: cyclicp

If true, the first element is selected after the last.

Type

boolean

Initargs

:cyclic

Readers

cyclicp.

Writers

(setf cyclicp).

Class: column-layout

A container of widgets organized in one column.

Package

de.anvi.croatoan.

Source

grid.lisp.

Direct superclasses

layout.

Direct methods

calculate-layout.

Direct Default Initargs
InitargValue
:grid-columns1
Class: complex-char

A complex char consists of a simple char, a list of attribute keywords and a pair of color keywords.

Package

de.anvi.croatoan.

Source

character.lisp.

Direct methods
Direct slots
Slot: simple-char

Lisp primitive character type, like #a.

Type

(or null integer character keyword)

Initargs

:simple-char

Readers

simple-char.

Writers

(setf simple-char).

Slot: attributes

List of keywords denoting attributes.

Type

(or null cons)

Initform

(quote nil)

Initargs

:attributes

Readers

attributes.

Writers

(setf attributes).

Slot: fgcolor

A keyword denoting the foreground color of the complex character.

Type

(or null keyword integer list)

Initargs

:fgcolor

Readers

fgcolor.

Writers

(setf fgcolor).

Slot: bgcolor

A keyword denoting the background color of the complex character.

Type

(or null keyword integer list)

Initargs

:bgcolor

Readers

bgcolor.

Writers

(setf bgcolor).

Class: complex-string

A complex string consists of an array of complex characters.

Package

de.anvi.croatoan.

Source

character.lisp.

Direct methods
Direct slots
Slot: complex-char-array

Lisp primitive string type.

Type

vector

Initform

(make-array 0 :element-type (quote de.anvi.croatoan:complex-char) :fill-pointer 0 :adjustable t)

Initargs

:complex-char-array

Readers

complex-char-array.

Writers

(setf complex-char-array).

Class: dropdown

A drop-down menu is a button that calls a menu-window when activated.

The selected item becomes the new title of the button and the value of the widget.

Package

de.anvi.croatoan.

Source

dropdown.lisp.

Direct superclasses

button.

Direct methods
Direct Default Initargs
InitargValue
:keymap(quote dropdown-map)
Direct slots
Slot: default-title

A string displayed as a prompt before an item is selected.

Type

string

Initform

"select..."

Slot: menu

Menu window that is displayed when the button is activated.

Type

(or null de.anvi.croatoan:menu-window)

Class: event

And event represents characters, function keys, mouse buttons and terminal resize events.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct subclasses

mouse-event.

Direct methods
Direct slots
Slot: key

Lisp character representing a character key or key struct representing a function key or mouse button.

Type

(or null integer keyword character de.anvi.croatoan:key)

Initargs

:key

Readers

event-key.

Writers

This slot is read-only.

Slot: code

Integer code representing the character or function key as returned by ncurses:getch or get_wch.

Type

(or null integer)

Initargs

:code

Readers

event-code.

Writers

This slot is read-only.

Class: field

A field is an editable part of the screen for user input. Can be part of a form.

Package

de.anvi.croatoan.

Source

field.lisp.

Direct superclasses

element.

Direct methods
Direct Default Initargs
InitargValue
:keymap(quote field-map)
Direct slots
Slot: width

The width of the field. The default buffer length is equal the width.

Type

(or null integer)

Initargs

:width

Readers

width.

Writers

(setf width).

Slot: insert-mode-p

Printing a new char will insert (t) it before the character under the cursor instead of overwriting it (nil, default).

Type

boolean

Initargs

:insert-mode

Readers

insert-mode-p.

Writers

(setf insert-mode-p).

Slot: buffer

List containing the characters in the field.

Type

(or null list)

Readers

buffer.

Writers

(setf buffer).

Slot: max-buffer-length

Max length of the field buffer. If nil, it will be initialized to field width. Horizontal scrolling is then disabled.

Type

(or null integer)

Initargs

:max-buffer-length

Readers

max-buffer-length.

Writers

(setf max-buffer-length).

Slot: display-pointer

Position in the input buffer from which n=width characters are displayed.
When max-buffer-length is greater than width, display-pointer can be greater than zero. Horizontal scrolling is then enabled.

Type

(or null integer)

Initform

0

Readers

display-pointer.

Writers

(setf display-pointer).

Slot: input-pointer

The position in the input buffer to which the next character will be written.

Type

integer

Initform

0

Readers

input-pointer.

Writers

(setf input-pointer).

Class: form

A form is a collection of elements like fields, textareas, checkboxes, menus and buttons.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses
Direct subclasses

form-window.

Direct methods
Direct Default Initargs
InitargValue
:keymap(quote form-map)
:cyclict
Direct slots
Slot: layout

The elements of a form can be passed in a layout object.

Type

(or null de.anvi.croatoan:layout)

Initargs

:layout

Readers

layout.

Writers

(setf layout).

Slot: window

Window created separately and then associated with the form.

Type

(or null de.anvi.croatoan:window)

Initargs

:window

Readers

window.

Writers

(setf window).

Class: form-window

A form window is an extended window displaying a form.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses
Direct subclasses

dialog.

Direct methods
Class: grid

Utility to track the display of items in a scrollable mxn grid, like a layout or a menu.

Package

de.anvi.croatoan.

Source

grid.lisp.

Direct subclasses

layout.

Direct methods
Direct slots
Slot: grid-row
Type

integer

Initform

0

Initargs

:grid-row

Slot: grid-column
Type

integer

Initform

0

Initargs

:grid-column

Slot: grid-rows
Type

(or null integer)

Initargs

:grid-rows

Slot: grid-columns
Type

(or null integer)

Initargs

:grid-columns

Slot: cyclicp
Type

boolean

Initargs

:cyclic

Slot: scrolling-enabled-p
Type

boolean

Initargs

:enable-scrolling

Slot: region-start-row
Type

(or null integer)

Initargs

:region-start-row

Slot: region-start-column
Type

(or null integer)

Initargs

:region-start-column

Slot: region-rows
Type

(or null integer)

Initargs

:region-rows

Slot: region-columns
Type

(or null integer)

Initargs

:region-columns

Class: inputbox

An input box provides one or more input fields and buttons to accept or cancel the input.

Package

de.anvi.croatoan.dialog.

Source

dialog.lisp.

Direct superclasses

dialog.

Direct methods

initialize-instance.

Direct Default Initargs
InitargValue
:buttons(quote ((ok . t) (cancel)))
:fields(quote (input))
Class: keymap

A keymap contains an alist of events as keys and event handlers or chained keymaps as values.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct methods
Direct slots
Slot: bindings

Alist of events and handler functions (or sub-keymaps).

When the bindings are provided not as an alist, but as an plist for convenience, convert the plist to an alist.

The plist is easier to provide when there is a large number of bindings.

Type

(or null cons)

Initargs

:bindings

Readers

bindings.

Writers

(setf bindings).

Slot: parent

Parent keymaps given as a symbol name or keymap object.

Type

(or null de.anvi.croatoan:keymap)

Initargs

:parent

Readers

parent.

Writers

(setf parent).

Class: label

A single-line string displayed at the specified position.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

element.

Direct methods
Direct slots
Slot: reference

If the name of a reference element is specified, the element’s title will be displayed instead of the label’s. If a title for the label is explicitely provided, it overrides the title of the reference element.

Type

(or null symbol keyword string)

Initargs

:reference

Readers

reference.

Writers

(setf reference).

Slot: width

The width of the label.

Type

(or null integer)

Initargs

:width

Readers

width.

Writers

(setf width).

Slot: activep

Labels are by default not active and can not be selected when cycling through the elements.

Class: layout

A layout is a container widget containing items positioned in a grid. Layouts can be nested.

Package

de.anvi.croatoan.

Source

grid.lisp.

Direct superclasses
Direct subclasses
Direct methods
Direct slots
Slot: grid-row-gap

Gap between rows in a grid.

Type

integer

Initform

0

Initargs

:grid-row-gap

Slot: grid-column-gap

Gap between columns in a grid.

Type

integer

Initform

0

Initargs

:grid-column-gap

Class: menu

A menu is a list of items displayed in a grid that can be selected by the user.

Item types can be strings, symbols, numbers, other menus or callback functions.

Package

de.anvi.croatoan.

Source

menu.lisp.

Direct superclasses
Direct subclasses
Direct methods
Direct Default Initargs
InitargValue
:keymap(quote menu-map)
Direct slots
Slot: menu-type

Types of menus: :selection (default) or :checklist.

Type

keyword

Initform

:selection

Initargs

:menu-type

Readers

menu-type.

Writers

(setf menu-type).

Slot: current-item-position

Position (y x) of the current item in the window.

This can be used to position the cursor on the current item after the menu is drawn.

Type

(or null cons)

Initargs

:current-item-position

Readers

current-item-position.

Writers

(setf current-item-position).

Slot: current-item-mark

A string prefixed to the current item in the menu.

Type

(or string cons)

Initform

""

Initargs

:current-item-mark

Readers

current-item-mark.

Writers

This slot is read-only.

Slot: tablep

If t, table row and column lines are drawn between the items.

Type

boolean

Initargs

:table

Readers

tablep.

Writers

This slot is read-only.

Slot: item-padding-top

Additional space added to the top of the item title, with the same background style.

Type

integer

Initform

0

Initargs

:item-padding-top

Slot: item-padding-bottom

Additional space added below the item title, with the same background style.

Type

integer

Initform

0

Initargs

:item-padding-bottom

Slot: item-padding-left

Additional space added to the left of the item title, with the same background style.

Type

integer

Initform

0

Initargs

:item-padding-left

Slot: item-padding-right

Additional space added to the right of the item title, with the same background style.

Type

integer

Initform

0

Initargs

:item-padding-right

Slot: variable-column-width-p

If t, columns widths are calculated from the items.

If nil (default), use max-item-length as the width for every column.

Type

boolean

Initargs

:variable-column-width

Readers

variable-column-width-p.

Writers

This slot is read-only.

Slot: align

Set how the item titles and thus the menu columns are aligned.

Items can be aligned if they are shorter than the max-item-length or the calculated column width.

Possible values are :left (default) or :right.

Type

keyword

Initform

:left

Initargs

:align

Slot: draw-stack-p

Redraw all menus in the stack when a submenu is quit/entered, so we see the whole stack.

If nil, only one direct parent/child is redrawn, so we move through the stack one by one.

At the moment, this setting applies only to stacks of simple (non-window) menus).

Type

boolean

Initform

t

Initargs

:draw-stack

Readers

draw-stack-p.

Writers

This slot is read-only.

Slot: max-item-length

If the variable column width is nil, this is the default width of all items.

If the variable column width is t, the width of every column is calculated from the item titles and the columns exceeding max item length are ellipsized or truncated.

Type

integer

Initform

15

Initargs

:max-item-length

Readers

max-item-length.

Writers

(setf max-item-length).

Slot: ellipsis

Ellipsis/truncation string for too long item titles.

If an item title is longer than max-item-length shorten the title by replacing the last characters with the ellipsis string.

If the ellipsis is an empty string, the title will simply be truncated.

The default value is the unicode ellipsis character (of length 1), #horizontal_ellipsis (code point #x2026).

Type

string

Initform

"…"

Initargs

:ellipsis

Slot: save-selected-item-p

If nil (default) the selected item will be reset when exited.

Type

boolean

Initargs

:save-selected-item

Class: menu-item

A menu contains of a list of menu items.

Package

de.anvi.croatoan.

Source

menu.lisp.

Direct superclasses

checkbox.

Direct methods
Direct slots
Slot: value

The value of an item can be a string, a number, a sub menu or a function to be called when the item is selected.

Type

(or symbol keyword string de.anvi.croatoan:menu de.anvi.croatoan:menu-window function number)

Class: menu-window

A menu-window is a window displaying a menu.

Package

de.anvi.croatoan.

Source

menu.lisp.

Direct superclasses
Direct methods
Direct Default Initargs
InitargValue
:keymap(quote menu-window-map)
Class: menubox
Package

de.anvi.croatoan.dialog.

Source

dialog.lisp.

Direct superclasses

dialog.

Direct methods

initialize-instance.

Class: mouse-event

The class represents the ncurses MEVENT struct as returned by getmouse.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

event.

Direct slots
Slot: position-y

The y coordinate (row) of mouse event.

Type

(or null integer)

Initargs

:y

Slot: position-x

The x coordinate (column) of the mouse event.

Type

(or null integer)

Initargs

:x

Class: msgbox

A message box displays a (wrapped) message and one default OK button.

The message is wrapped by default, but the wrapping can be disabled to display a pre-formatted text, for example.

The title of the activated button is returned, or its value, if provided.

Package

de.anvi.croatoan.

Source

dialog.lisp.

Direct superclasses

dialog.

Direct methods

initialize-instance.

Direct Default Initargs
InitargValue
:buttons(quote ((ok . t)))
Class: node

Base class for objects that can be organized in a tree, like layouts.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct subclasses

collection.

Direct methods
Direct slots
Slot: parent

Pointer to the parent object.

Initargs

:parent

Readers

parent.

Writers

(setf parent).

Slot: children

List of children.

Type

(or null cons)

Initargs

:children

Readers

children.

Writers

(setf children).

Class: pad

A pad is a window without a specified position on screen, which is specified dynamically during refresh.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

window.

Direct subclasses

sub-pad.

Direct methods
Class: panel

A panel is a window displaying the main content decorated by a background window for the border, title and other decorations and a second window providing a shadow.

The border and the shadow are displayed outside of the content window, so they change the absolute position and dimensions of the panel.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

window.

Direct methods
Direct slots
Slot: border-width
Type

integer

Initform

1

Initargs

:border-width

Slot: border-win

A border window for decorations like title, border, scroll bar.

Type

(or null de.anvi.croatoan:window)

Slot: shadowp

Draw (t) or don’t draw (nil, default) a shadow behind the panel.

Type

boolean

Initargs

:shadow

Slot: shadow-win

A window to provide the shadow.

Type

(or null de.anvi.croatoan:window)

Class: queue

A thread-safe FIFO queue.

Package

de.anvi.croatoan.

Source

queue.lisp.

Direct methods
Direct slots
Slot: head

Pointer to the first cons of the elements list.

Slot: tail

Pointer to the last cons of the elements list.

Slot: lock

A mutex that ensures thread-safe access to the queue from multiple threads.

Class: row-layout

A container of widgets organized in one column.

Package

de.anvi.croatoan.

Source

grid.lisp.

Direct superclasses

layout.

Direct methods

calculate-layout.

Direct Default Initargs
InitargValue
:grid-rows1
Class: screen

Represents the main window created upon screen initialisation.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

window.

Direct methods
Direct slots
Slot: colors-enabled-p

Enable (t) or disable (nil) display of colors, if the terminal supports it.

Type

boolean

Initargs

:enable-colors

Slot: use-terminal-colors-p

Use (t) colors set by the terminal (named :terminal) as the default instead of the ncurses default white on black.

Type

boolean

Initargs

:use-terminal-colors

Slot: cursor-visible-p

Enable (t) or disable (nil) the display of a visible cursor.

Type

boolean

Initform

t

Initargs

:cursor-visible

Slot: input-echoing-p

Enable (t) or disable (nil) echoing of chars during keyboard input.

Type

boolean

Initform

t

Initargs

:input-echoing

Slot: input-buffering-p

Set whether typed characters will be returned immediately when they are typed (nil, default) or buffered until Return is typed (t).

Type

boolean

Initargs

:input-buffering

Slot: process-control-chars-p

If input-buffering is nil, set whether some control characters like ^C, ^S, ^Q, ^D will be processed (t, default) or passed directly to the program (nil).
When input-buffering is t, control chars are always processed and this option has no effect.

Type

boolean

Initform

t

Initargs

:process-control-chars

Slot: newline-translation-enabled-p

If t (default), the #return character (CR ^M r) is automatically translated to newline (NL) on input, and NL is translated to CR LF on output.
NL is the standard, system independent, portable way to end a line.
It can be either #linefeed (LF ^J n) on Linux, carriage #return on MacOS, CRLF rn on Windows. Setting newline translation to nil is necessary to be able to detect the #return key.

Type

boolean

Initform

t

Initargs

:enable-newline-translation

Slot: soft-labels-enabled-p

Use the bottom line of the terminal to display short descriptions
of the function keys F1-F12.

The default label layout is 4-4-4, which means 12 labels of 5 characters, 4 on the left, 4 in the center, 4 on the right.

Type

boolean

Initargs

:enable-soft-labels

Slot: soft-labels-layout
Type

keyword

Initform

:mode-4-4-4

Initargs

:soft-labels-layout

Slot: closed-p

Check whether the screen has been closed, without a subsequent call to refresh to reactivate it.

Type

boolean

Class: shape

A shape is a list of coordinates, relative to an origin, that can be plotted in a window.

Package

de.anvi.croatoan.

Source

shape.lisp.

Direct methods
Direct slots
Slot: origin-x

The x coordinate of this shape’s point of origin.

Type

integer

Initform

0

Initargs

:x0

Readers

origin-x.

Writers

(setf origin-x).

Slot: origin-y

The y coordinate of this shape’s point of origin.

Type

integer

Initform

0

Initargs

:y0

Readers

origin-y.

Writers

(setf origin-y).

Slot: coordinates

A list of coordinates relative to the origin that form this shape.

Type

(or null cons)

Readers

coordinates.

Writers

(setf coordinates).

Slot: plot-char

The character to use for plotting.

Type

(or null character keyword de.anvi.croatoan:complex-char)

Initform

(make-instance (quote de.anvi.croatoan:complex-char) :simple-char #\x :color-pair (quote (:white :black)) :attributes nil)

Initargs

:char

Readers

plot-char.

Writers

(setf plot-char).

Class: simple-queue

A simple FIFO queue (not thread-safe).

Package

de.anvi.croatoan.

Source

queue.lisp.

Direct methods
Direct slots
Slot: head

Pointer to the first cons of the elements list.

Slot: tail

Pointer to the last cons of the elements list.

Class: stack

Stack implementation of ncurses panels, allows management of overlapping windows.

Package

de.anvi.croatoan.

Source

stack.lisp.

Direct methods
Direct slots
Slot: items

List containing the items.

Type

(or null cons)

Initargs

:items

Readers

items.

Writers

(setf items).

Class: sub-pad

A sub-pad shares the memory and the display with a parent pad and has to be contained within it.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

pad.

Direct methods

initialize-instance.

Direct slots
Slot: parent

The parent pad which will contain the sub-pad.

Type

(or null de.anvi.croatoan:pad)

Initargs

:parent

Class: sub-window

A sub-window shares the memory and the display with and has to be contained within a parent window.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

window.

Direct methods
Direct slots
Slot: parent

The parent window which will contain the sub-window.

Type

(or null de.anvi.croatoan:window)

Initargs

:parent

Slot: relativep

The position of the sub-window is relative to the parent window (t) or to the screen (nil, default).

Type

boolean

Initargs

:relative

Slot: source-position

Position (y x) of the area of the parent window, which is mapped to the subwindow. By default it is identical to the position of the subwindow.

Type

(or null cons)

Initargs

:source-position

Class: textarea

A textarea is a multiline field for display and editing of texts including newlines. For now, control characters other than newline are not interpreted.
The main difference to a window is the ability to scroll the buffer.

Package

de.anvi.croatoan.

Source

textarea.lisp.

Direct superclasses

element.

Direct methods
Direct Default Initargs
InitargValue
:keymap(quote textarea-map)
Direct slots
Slot: width

The width (number of columns) of the textarea. The area can not be scrolled horizontally. Lines exceeding the width are soft-wrapped to the next line.
(This corresponds to the emacs behavior when truncate-lines is set to nil.)

Type

(or null integer)

Initargs

:width

Readers

width.

Writers

(setf width).

Slot: height

The height (number of visible lines) of the textarea. The area can be scrolled vertically.

Type

(or null integer)

Initargs

:height

Readers

height.

Writers

(setf height).

Slot: insert-mode-p

Printing a new char will insert (t, default) it before the character under the cursor instead of overwriting it (nil).

Type

boolean

Initform

t

Initargs

:insert-mode

Readers

insert-mode-p.

Writers

(setf insert-mode-p).

Slot: buffer

List containing the characters of the textarea.

Type

(or null list)

Initargs

:buffer

Readers

buffer.

Writers

(setf buffer).

Slot: display-pointer

When the area contains more lines than can be shown on screen because they exceed the given height, this points to the first line that is displayed.

Type

(or null integer)

Initform

0

Readers

display-pointer.

Writers

(setf display-pointer).

Slot: input-pointer

The row-major index in the input buffer to which the next character will be written. Can not be greater than the row-major length of the current buffer content.

Type

(or null integer)

Initform

0

Readers

input-pointer.

Writers

(setf input-pointer).

Slot: cursor-position-y

Y position (row) in the textarea window where the next character will be added.

Type

(or null integer)

Initform

0

Readers

cursor-position-y.

Writers

(setf cursor-position-y).

Slot: cursor-position-x

X position (column) in the textarea window where the next character will be added.

Type

(or null integer)

Initform

0

Readers

cursor-position-x.

Writers

(setf cursor-position-x).

Class: widget

A widget is a visible component defined by its dimensions (h w) and displayed at a given position (y x).

It represents a visible region on the screen, either a window, or a form element like a button or input field.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses

component.

Direct subclasses
Direct methods

initialize-instance.

Direct slots
Slot: position-y

The y coordinate (row) of the top left corner.

Type

integer

Initform

0

Initargs

:y

Slot: position-x

The x coordinate (column) of the top left corner.

Type

integer

Initform

0

Initargs

:x

Slot: width

The width (second, horizontal, x dimension), number of columns.

Type

(or null integer)

Initargs

:width

Slot: height

The height (first, vertical, y dimension), number of rows.

Type

(or null integer)

Initargs

:height

Slot: initial-dimension-hint

Internal variable to hold the initial dimension hint for layouts whose geometry is recalculated.

It can be either a width or height, which is interpreted by whether it is part of a row or column layout.

Type

(or null integer)

Initargs

:initial-dimension-hint

Class: window

A curses window object as returned by newwin.

Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses
  • fundamental-character-input-stream.
  • fundamental-character-output-stream.
  • widget.
Direct subclasses
Direct methods
Direct slots
Slot: cursor-position

The current cursor position coordinates in the form (y x).

Type

cons

Initform

(quote (0 0))

Slot: input-blocking

Input mode: blocking (t), non-blocking (nil) or blocking duration in (positive integer) miliseconds.

Type

(or boolean integer)

Initform

t

Initargs

:input-blocking

Slot: function-keys-enabled-p

Enable (t) or disable (nil) support for function keys.

Type

boolean

Initargs

:enable-function-keys

Slot: scrolling-enabled-p

Enable (t) or disable (nil) support for window scrolling.

Type

boolean

Initargs

:enable-scrolling

Slot: scrolling-region

When scrolling is enabled, only scroll the window region from line y1 to y2 given as the list (y1 y2).

Type

(or null cons)

Initargs

:scrolling-region

Slot: insert-mode-p

Printing a new char will insert (t) it before the character under the cursor instead of overwriting it (nil, default).

Type

boolean

Initargs

:insert-mode

Readers

insert-mode-p.

Writers

(setf insert-mode-p).

Slot: background

Sets a complex char with its attributes and colors as the default style of unrendered text and empty cells of the window.

Complex chars with pre-existing attributes and colors are not changed.

If the background char with attributes is set after the foreground attributes, the background attributes override the foreground attributes. To prevent this, set the background char with attributes before the foreground attributes.

Type

(or null de.anvi.croatoan:complex-char)

Initargs

:background

Slot: attributes

A list of keywords denoting attributes of new characters added to a window.

Type

(or null cons)

Initargs

:attributes

Slot: fgcolor

A keyword denoting the foreground color of new characters added to the window.

Type

(or null keyword integer list)

Initargs

:fgcolor

Slot: bgcolor

A keyword denoting the background color of new characters added to the window.

Type

(or null keyword integer list)

Initargs

:bgcolor

Slot: borderp

Draw (t) or don’t draw (nil, default) an initial border around a window. Not redrawn automatically.

Type

boolean

Initargs

:border

Readers

borderp.

Writers

This slot is read-only.

Slot: stackedp

If stacked is t, the window is added to the global window stack, so overlapping windows can be refreshed in the stacking order.

Type

boolean

Initargs

:stacked

Slot: visiblep

If visible is nil, do not refresh the stacked window when refreshing the window stack.

Type

boolean

Initform

t

Initargs

:visible

Readers

visiblep.

Writers

(setf visiblep).

Slot: winptr

Pointer to a C/ncurses WINDOW structure after the window is created.

Readers

winptr.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Special variables

Special Variable: *bitmask-alist*
Package

de.anvi.croatoan.

Source

attr.lisp.

Special Variable: *color-pair-alist*
Package

de.anvi.croatoan.

Source

attr.lisp.

Special Variable: *default-color-pair*
Package

de.anvi.croatoan.

Source

attr.lisp.

Special Variable: *extended-key-caps*
Package

de.anvi.croatoan.

Source

getch.lisp.

Special Variable: *job-queue*

A queue of functions (consed to their form for debugging purposes) to be processed by the main thread to interface with ncurses.

Package

de.anvi.croatoan.

Source

queue.lisp.

Special Variable: *key-alist*
Package

de.anvi.croatoan.

Source

getch.lisp.

Special Variable: *keymaps*

An alist of available keymaps.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Special Variable: *menu-stack*
Package

de.anvi.croatoan.

Source

menu.lisp.

Special Variable: *missing-xterm-cap-sequences*
Package

de.anvi.croatoan.

Source

getch.lisp.

Special Variable: *missing-xterm-fkey-sequences*
Package

de.anvi.croatoan.

Source

getch.lisp.

Special Variable: *mouse-button-event-bitmask-alist*
Package

de.anvi.croatoan.

Source

mouse.lisp.

Special Variable: *mouse-event-bitmask-alist*
Package

de.anvi.croatoan.

Source

mouse.lisp.

Special Variable: *valid-attributes*
Package

de.anvi.croatoan.

Source

attr.lisp.

Special Variable: *xterm-color-hex-list*
Package

de.anvi.croatoan.

Source

color.lisp.

Special Variable: *xterm-color-name-list*
Package

de.anvi.croatoan.

Source

attr.lisp.

Special Variable: acs-alist
Package

de.anvi.croatoan.

Source

addch.lisp.

Special Variable: wide-acs-alist
Package

de.anvi.croatoan.

Source

add_wch.lisp.


5.2.2 Macros

Macro: %defcdr (keymap &body body)

Take a keymap and populate it with key-value pairs given in the body.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Macro: access-alist (key find-fn test-fn get-value-fn default)

Helper macro for ’key-name-to-code’ and ’key-code-to-name’.

Package

de.anvi.croatoan.

Source

getch.lisp.

Macro: mouse-bitmask (button event)
Package

de.anvi.croatoan.

Source

mouse.lisp.


5.2.3 Ordinary functions

Function: add-attribute (attribute)

Add a single attribute to the rendition of soft labels.

The labels maybe have to be touched for attribute changes to take effect.

Package

de.anvi.croatoan.soft-labels.

Source

slk.lisp.

Function: add-extended-function-keys ()

Check if common extended function keys are supported by the terminal.

In most cases these extended keys are existing function keys with additional modifiers.

If the keys are supported, add them to the key alist, so they can be returned as valid events.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: add-function-key-cap (cap key)

Check if a terminal supports an extended function key capability and add it to key-alist.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: add-title (win)

Draw a title to the first line of a window.

Usually, this will be an extended-window with a border and the title on the top border.

When title is t instead of a title string, display the symbol name of the widget.

Package

de.anvi.croatoan.

Source

form.lisp.

Function: alist2plist (alist)

Take an alist ((k1 . v1) (k2 . v2)), return a plist (k1 v1 kv v2).

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: apply-handler (handler object event args)

Determine and pass the correct arguments to each event handler.

The number of the arguments passed to the handler the arity (number of required arguments) of the handler function.

This allows handlers with the following lambda lists to be defined:

(lambda () ...)
(lambda (object) ...)
(lambda (object event) ...)

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: array-slice (array start &optional end)
Package

de.anvi.croatoan.

Source

character.lisp.

Function: ascii-byte-p (octet)

Return t if octet is a single-byte 7-bit ASCII char.

The most significant bit is 0, so the allowed pattern is 0xxx xxxx.

Package

de.anvi.croatoan.

Source

utf8.lisp.

Function: assoc-merge (&rest alists)

Merge alists then return an alist with duplicate entries removed.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: assoc-unique (alist)

Return a copy of alist with duplicate entries (keys) removed.

Only the first (newest) unique key is kept, others are discarded.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: bitmask-to-keyword (bitmask alist)

Take a bitmask and an alist, return a list of keys with bits matching the mask.

The bitmask should be a 32bit integer.

The values in alist should be 32bit integers with only one single bit switched on.

Package

de.anvi.croatoan.

Source

mouse.lisp.

Function: call-button-function (button event)
Package

de.anvi.croatoan.

Source

form.lisp.

Function: char-style (char)

Take a complex char, return a plist of its properties.

Package

de.anvi.croatoan.

Source

character.lisp.

Function: char2chtype (char)

Take a character in different forms, return a chtype containing that character.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: check-string-char (char)

If char is a string convert it to a character.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: checked-items (menu)

Take a menu, return a list of checked menu items.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: chtype2xchar (ch)

Converts a ncurses chtype to croatoan complex-char.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: closest-gray (rgb)

Take an integer 0-255 denoting a gray color intensity, return the closest gray from the xterm palette.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: collect-height-hints (nodes)

Take a list of plists or objects, return a list of their initial heights.

Package

de.anvi.croatoan.

Source

grid.lisp.

Function: collect-width-hints (nodes)

Take a list of plists or objects, return a list of their initial widths.

The initial widths can be given directly in the initial plist.
Is is then passed as an initial-dimension-hint to the later object.

The list of initial width hints is used by split-size in calculate-layout to calculate the widths which are still nil.

The call to initialize-leaves makes objects from the plists.

The initial-dimension-hint is then used by subsequent calls to calculate layout to recalculate all widths.

Package

de.anvi.croatoan.

Source

grid.lisp.

Function: color-1k-to-8bit (integer)

Convert the ncurses color intensity 0-1000 to the 8bit range 0-255.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: color-8bit-to-1k (integer)

Convert the 8bit range 0-255 to the ncurses color intensity 0-1000.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: color-name-to-number (color-name)

Take a keyword denoting a color name, return the color number.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: color-to-number (color)

Takes a color in various notations, converts that notation to the exact or most appropriate color number.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: colors2chtype (color-pair)

Take a list of a color pair, return a chtype with the color attribute set.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: complete-pair (window pair)

If either the foreground or background color is nil, complete the pair for the given window.

Return the completed pair.

Try to complete the missing colors in the following order:

1. window color pair.
2. window background character color pair.
3. ncurses default color pair 0 (white on black or the terminal default color pair).

If both colors are missing, they are substituted in the following order:

1. window color pair.
2. ncurses default color pair 0 (white on black or the terminal default color pair).

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: complex-string-first-char-attributes (complex-string)

Returns the attributes of the first character of ‘complex-string’ as three values: attributes, background color and foreground color.

Package

de.anvi.croatoan.

Source

character.lisp.

Function: complex-string-last-char-attributes (complex-string)

Returns the attributes of the last character of ‘complex-string’ as three values: attributes, background color and foreground color

Package

de.anvi.croatoan.

Source

character.lisp.

Function: concat-complex-string-no-contagion (a b)

Concatenate two ‘complex-strings’: the args ‘b’ does not inherit the color and attributes of ‘a’.

Package

de.anvi.croatoan.

Source

character.lisp.

Function: concat-complex-string-with-contagion (string-1 string-2)

Concatenate two ‘complex-strings’.

The args ‘string-2’ does not inherit the color and attributes of ‘string-1’.

Package

de.anvi.croatoan.

Source

character.lisp.

Function: convert-strings (bindings-plist)

Loop over a bindings plist, convert strings to characters.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: copy-complex-char (complex-char)
Package

de.anvi.croatoan.

Source

character.lisp.

Function: copy-complex-char-array (a)

Make a (non deep) copy of ‘complex-char’ array ‘a’

Package

de.anvi.croatoan.

Source

character.lisp.

Function: count-lines (str)

Take a string, return the number of lines it will need to be displayed without wrapping.

It is basically the number of newline characters plus one.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: debug-print-field-buffer (object)
Package

de.anvi.croatoan.

Source

field.lisp.

Function: debug-textarea (yy xx area)
Package

de.anvi.croatoan.

Source

textarea.lisp.

Function: distance-to-bottom (window)

Return the number of lines from the cursor position to the bottom of the window.

Package

de.anvi.croatoan.

Source

addch.lisp.

Function: distance-to-eol (window)

Return the number of columns from the cursor position to the end of the line in the window.

Package

de.anvi.croatoan.

Source

addch.lisp.

Function: distance-to-newline (area)
Package

de.anvi.croatoan.

Source

textarea.lisp.

Function: draw-table-bottom (win widths &key style)

Draw the top line of a table at the current position using ANSI drawing characters.

The bottom line is only drawn when border is t.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: draw-table-row-separator (win widths borderp &key style)

Draw the horizontal line between table cells.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: draw-table-top (win widths &key style)

Draw the top line of a table at the current position using ANSI drawing characters.

The top line is only drawn when border is t.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: emptyp (queue)
Package

de.anvi.croatoan.

Source

queue.lisp.

Function: external-dimensions (element)
Package

de.anvi.croatoan.

Source

form.lisp.

Function: format-menu-item (menu item selectedp width)

Take a menu and return item item-number as a properly formatted string.

If the menu is a checklist, return [ ] or [X] at the first position.

If a mark is set for the current item, display the mark at the second position. Display the same number of spaces for other items.

At the third position, display the item given by item-number.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: funcall-get-cchar_t (fn window)

Call function fn to read a cchar_t from window and return it as a wide complex char.

Package

de.anvi.croatoan.

Source

bkgrnd.lisp.