The croatoan Reference Manual

This is the croatoan Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sat Dec 03 21:10:22 2022 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.0.1

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

de.anvi.croatoan.


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/dialog.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.9 croatoan/menu.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.10 croatoan/form.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.11 croatoan/field.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.12 croatoan/textarea.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

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/addch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.18 croatoan/add_wch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.19 croatoan/addstr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

add-string (function).


3.1.20 croatoan/attr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.21 croatoan/beep.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

alert (function).


3.1.22 croatoan/bkgd.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

3.1.23 croatoan/bkgrnd.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

3.1.24 croatoan/border.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.25 croatoan/border_set.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

draw-wide-border (function).


3.1.26 croatoan/clear.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.27 croatoan/color.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

3.1.28 croatoan/delch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

delete-char (function).


3.1.29 croatoan/deleteln.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.30 croatoan/getch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.31 croatoan/define_key.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

define-function-key (function).


3.1.32 croatoan/get_wch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.33 croatoan/getstr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

get-string (function).


3.1.34 croatoan/initscr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.35 croatoan/inopts.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

3.1.36 croatoan/inch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

extract-char (function).


3.1.37 croatoan/in_wch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

extract-wide-char (function).


3.1.38 croatoan/inwstr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

extract-wide-string (function).


3.1.39 croatoan/inchstr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

extract-complex-string (function).


3.1.40 croatoan/insch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

insert-char (function).


3.1.41 croatoan/ins_wch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.42 croatoan/insstr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

insert-string (function).


3.1.43 croatoan/instr.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

extract-string (function).


3.1.44 croatoan/kernel.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Internals

set-cursor-visibility (function).


3.1.45 croatoan/mouse.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface
Internals

3.1.46 croatoan/move.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.47 croatoan/refresh.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.48 croatoan/scroll.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

scroll (function).


3.1.49 croatoan/touch.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

touch (generic function).


3.1.50 croatoan/util.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

3.1.51 croatoan/wresize.lisp

Source

croatoan.asd.

Parent Component

croatoan (system).

Public Interface

resize (function).


3.1.52 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
  • crt
  • croatoan
Use List
  • common-lisp.
  • trivial-gray-streams.
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 &body body)

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

As with bind, the keys can be characters, two-char strings in caret notation for control chars and keywords for function keys.

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.

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-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-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-function-key (key-name key-code)

Add a new function key given by the mapping of key name (keyword) <-> key code (integer).

If the alist already contains key-name or key-code this mapping will
be overwritten by the new values.

This operation modifies *key-alist*.

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: 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 is a list of events, bind the handler to each event separately.

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 handler for the default event t is defined, it will handle all events for which no specific event handler has been defined.

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: 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: 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-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: 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: 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: 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-name char-list &key key-code)

Add or replace a new function key defined by the given character sequence.

key-name is the symbol used to represent the key (e.g. :f1).

char-list is the raw 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 (name . code) is added
to the database overwriting any already existing mapping which contains either key-name or key-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 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 m1 n1 rg cg bt bl widths heights)
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: 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: 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: 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-p (number)

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-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.

Package

de.anvi.croatoan.

Source

move.lisp.

Function: get-event (window)

Read a single-byte char from window, return it and its integer code as a second value.

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-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.

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.

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

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

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

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: key-pressed-p (window)
Package

de.anvi.croatoan.

Source

getch.lisp.

Function: key-supported-p (key-char)
Package

de.anvi.croatoan.

Source

getch.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: 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: 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: 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-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-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

field.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: 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.

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-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: 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: 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 is a list of events, remove each event separately from the alist.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: unget-char (chtype)
Package

de.anvi.croatoan.

Source

getch.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)

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

All pre-existing newlines and multiple spaces are removed.

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: 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.

Source

classes.lisp.

Target Slot

bindings.

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))
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

clear.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.

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 Reader: current-item-number (object)
Generic Writer: (setf current-item-number) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: current-item-number ((collection collection))
Writer Method: (setf current-item-number) ((collection collection))

Number (row major mode) of the currently selected item, nil if the list is empty.

Source

classes.lisp.

Target Slot

current-item-number.

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 a mapping croatoan keycode <-> curses integer, if exists

Package

de.anvi.croatoan.

Source

getch.lisp.

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

Take a key code, delete the mapping key name (keyword) <-> key code (number), if it exists.

This operation modifies *key-alist*.

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

Take a key name, delete the mapping key name (keyword) <-> key code (integer), if it exists.

This operation modifies *key-alist*.

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.

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

form.lisp.

Methods
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.

Method: draw ((win extended-window))

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

Method: draw ((form form))

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

Method: draw ((checkbox checkbox))
Method: draw ((button button))
Method: draw ((obj label))
Method: draw ((menu dialog-window))
Source

menu.lisp.

Method: draw ((menu menu-panel))
Source

menu.lisp.

Method: draw ((menu menu-window))

Draw the menu to its content sub-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.

Source

classes.lisp.

Target Slot

code.

Generic Reader: event-key (object)
Package

de.anvi.croatoan.

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

Character or keyword representing a function key, terminal :resize or mouse event.

Source

classes.lisp.

Target Slot

key.

Generic Reader: event-modifiers (object)
Package

de.anvi.croatoan.

Methods
Reader Method: event-modifiers ((mouse-event mouse-event))

A list containing any combination of :ctrl, :shift and :alt

Source

classes.lisp.

Target Slot

modifiers.

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)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: function-keys-enabled-p ((window window))
Generic Function: (setf function-keys-enabled-p) (window)
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)
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)
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.

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 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.

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))

Max number of characters displayed for a single item.

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, can contain strings, symbols, menus) or :checklist.

Source

menu.lisp.

Target Slot

menu-type.

Generic Reader: message-height (object)
Package

de.anvi.croatoan.

Methods
Reader Method: message-height ((dialog-window dialog-window))

Max number of lines reserved for the optional message text.

Source

dialog.lisp.

Target Slot

message-height.

Generic Reader: message-pad (object)
Package

de.anvi.croatoan.

Methods
Reader Method: message-pad ((dialog-window dialog-window))

Passive content window, for example for menu descriptions.

Source

dialog.lisp.

Target Slot

message-pad.

Generic Reader: message-pad-coordinates (object)
Package

de.anvi.croatoan.

Methods
Reader Method: message-pad-coordinates ((dialog-window dialog-window))

List of four coordinates where to refresh/display the message pad: min-y min-x max-y max-x.

Source

dialog.lisp.

Target Slot

message-pad-coordinates.

Generic Reader: message-text (object)
Generic Writer: (setf message-text) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: message-text ((dialog-window dialog-window))
Writer Method: (setf message-text) ((dialog-window dialog-window))

Optional message text to describe the choices in the menu below.

Source

dialog.lisp.

Target Slot

message-text.

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)
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.

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

refresh.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.

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.

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.

Source

stack.lisp.

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 ((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)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: scrolling-enabled-p ((window window))
Generic Function: (setf scrolling-enabled-p) (window)
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-panel))
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 ((menu menu))
Generic Function: select-first-item (collection)
Package

de.anvi.croatoan.

Source

classes.lisp.

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

de.anvi.croatoan.

Source

classes.lisp.

Methods
Method: select-last-item (collection)
Generic Function: select-next-item (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)
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: 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 ((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)
Package

de.anvi.croatoan.

Source

classes.lisp.

Methods
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))
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 sub-window) &key abort)
Source

classes.lisp.

Method: close ((stream menu-window) &key abort)
Source

menu.lisp.

Method: close ((stream window) &key abort)
Source

classes.lisp.

Method: close ((stream dialog-window) &key abort)
Source

dialog.lisp.

Method: close ((stream screen) &key abort)
Source

classes.lisp.

Method: close ((win panel) &key abort)
Source

classes.lisp.

Method: close ((stream form-window) &key abort)
Source

classes.lisp.

Method: close ((stream extended-window) &key abort)
Source

classes.lisp.

Method: initialize-instance :after ((win sub-window) &key)
Source

classes.lisp.

Method: initialize-instance :after ((queue queue) &key)
Source

queue.lisp.

Method: initialize-instance :after ((win menu-window) &key color-pair)
Source

menu.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 ((win dialog-window) &key color-pair center)
Source

dialog.lisp.

Method: initialize-instance :after ((field field) &key)
Source

field.lisp.

Method: initialize-instance :after ((queue simple-queue) &key)
Source

queue.lisp.

Method: initialize-instance :after ((form form) &key layout elements)
Source

classes.lisp.

Method: initialize-instance :after ((win sub-pad) &key)
Source

classes.lisp.

Method: initialize-instance :after ((menu menu) &key)
Source

menu.lisp.

Method: initialize-instance :after ((win pad) &key)
Source

classes.lisp.

Method: initialize-instance :after ((obj collection) &key items)
Source

classes.lisp.

Method: initialize-instance :after ((scr screen) &key color-pair)
Source

classes.lisp.

Method: initialize-instance :after ((keymap keymap) &key bindings-plist)
Source

classes.lisp.

Method: initialize-instance :after ((obj layout) &key grid-gap)
Source

grid.lisp.

Method: initialize-instance :after ((cstr complex-string) &key string attributes fgcolor bgcolor color-pair)
Source

character.lisp.

Method: initialize-instance :after ((obj widget) &key position dimensions geometry)
Source

classes.lisp.

Method: initialize-instance :after ((win panel) &key)
Source

classes.lisp.

Method: initialize-instance :after ((win form-window) &key)
Source

classes.lisp.

Method: initialize-instance :after ((win menu-panel) &key)
Source

menu.lisp.

Method: initialize-instance :after ((msgbox msgbox) &key center message-wrap)
Source

dialog.lisp.

Method: initialize-instance :before ((msgbox msgbox) &key)
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 ((obj grid) &key grid-position grid-dimensions grid-geometry region-dimensions)
Source

grid.lisp.

Method: initialize-instance :after ((obj element) &key padding border-width)
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: 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 queue) stream)
Source

queue.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 complex-char) (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: print-object ((obj job-error) stream)
Source

queue.lisp.

Method: print-object ((ch complex-char) 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 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 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
Class: collection

A collection is a list keeping track of the currently selected item.

Methods on collecion 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)

Readers

current-item-number.

Writers

(setf current-item-number).

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: dialog-window

A dialog is a decorated menu with a title, a message and items.

Package

de.anvi.croatoan.

Source

dialog.lisp.

Direct superclasses

menu-window.

Direct methods
Direct slots
Slot: message-pad

Passive content window, for example for menu descriptions.

Type

(or null de.anvi.croatoan:pad)

Readers

message-pad.

Writers

This slot is read-only.

Slot: message-text

Optional message text to describe the choices in the menu below.

Type

(or null string)

Initargs

:message-text

Readers

message-text.

Writers

(setf message-text).

Slot: message-height

Max number of lines reserved for the optional message text.

Type

integer

Initform

0

Initargs

:message-height

Readers

message-height.

Writers

This slot is read-only.

Slot: message-pad-coordinates

List of four coordinates where to refresh/display the message pad: min-y min-x max-y max-x.

Type

(or null cons)

Readers

message-pad-coordinates.

Writers

This slot is read-only.

Class: event
Package

de.anvi.croatoan.

Source

classes.lisp.

Direct subclasses

mouse-event.

Direct methods
Direct slots
Slot: key

Character or keyword representing a function key, terminal :resize or mouse event.

Type

(or null keyword character)

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.

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: 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
Package

de.anvi.croatoan.

Source

classes.lisp.

Direct superclasses
Direct subclasses

msgbox.

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: 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.

Type

(or null cons)

Initargs

:bindings

Readers

bindings.

Writers

(setf bindings).

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, can contain strings, symbols, menus) 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 information is useful for positioning the cursor on the current item after displaying the menu.

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

string

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: max-item-length

Max number of characters displayed for a single item.

Type

integer

Initform

15

Initargs

:max-item-length

Readers

max-item-length.

Writers

(setf max-item-length).

Class: menu-item

A menu contains of a list of menu items.

Package

de.anvi.croatoan.

Source

menu.lisp.

Direct superclasses

checkbox.

Direct methods

format-title.

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 de.anvi.croatoan:menu-panel function number)

Class: menu-panel

A menu-panel is a panel providing a list of items to be selected by the user.

Package

de.anvi.croatoan.

Source

menu.lisp.

Direct superclasses
Direct methods
Class: menu-window

A menu-window is an extended window displaying a menu in its sub-window.

Package

de.anvi.croatoan.

Source

menu.lisp.

Direct superclasses
Direct subclasses

dialog-window.

Direct methods
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 methods

event-modifiers.

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

Slot: modifiers

A list containing any combination of :ctrl, :shift and :alt

Type

(or null cons)

Initargs

:modifiers

Readers

event-modifiers.

Writers

This slot is read-only.

Class: msgbox

A msgbox is a form-window presenting the user a message and an OK button to accept it.

Package

de.anvi.croatoan.

Source

dialog.lisp.

Direct superclasses

form-window.

Direct methods
Direct Default Initargs
InitargValue
:enable-function-keyst
:input-blockingt
:bordert
Direct slots
Slot: message

Message to display to the user.

Type

(or null string)

Initargs

:message

Slot: msg-area

An inactive textarea containing the user message. Since the area is inactive, the message can not be scrolled. The size is calculated automatically from the msgbox dimensions.

Type

(or null de.anvi.croatoan:textarea)

Slot: ok-button

The OK button below the message allows the user to accept and exit the dialog.

Type

(or null de.anvi.croatoan:button)

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 subclasses

menu-panel.

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: 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: *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: *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: acs-map-array
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: %defcar (alist (k v))

Push a single key-value list to the alist.

If value v is a symbol, first convert it to a function object.

The key can be a lisp character, a two-char string in caret notation for control chars and a keyword for function keys.

If the key is given as a caret notation string, first convert it to the corresponding control char.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Macro: %defcdr (alist &body body)

Take an alist 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-title (win &optional title)

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: 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 removed.

Package

de.anvi.croatoan.

Source

croatoan.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: 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: calculate-positions (layout)

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

Package

de.anvi.croatoan.

Source

grid.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: 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: 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)
Package

de.anvi.croatoan.

Source

grid.lisp.

Function: collect-width-hints (nodes)

Take a list of plists or objects, return a list of their widths.

If the width is nil for a node, it will be calculated by split-size.

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-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: 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)

Draw the top line of a table at the current position using ANSI drawing characters.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: draw-table-row-separator (win widths)
Package

de.anvi.croatoan.

Source

menu.lisp.

Function: draw-table-top (win widths)

Draw the top line of a table at the current position using ANSI drawing characters.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: emptyp (queue)
Package

de.anvi.croatoan.

Source

queue.lisp.

Function: enable-8bit-char-input (window flag)
Package

de.anvi.croatoan.

Source

inopts.lisp.

Function: escape-sequence-delay (window flag)
Package

de.anvi.croatoan.

Source

inopts.lisp.

Function: external-dimensions (element)
Package

de.anvi.croatoan.

Source

form.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: 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-on-interrupt (window flag)
Package

de.anvi.croatoan.

Source

inopts.lisp.

Function: format-menu-item (menu item selectedp)

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.

Function: funcall-make-cchar_t (fn window char attributes color-pair n)

Assemble a cchar_t out of a char, attributes and a color-pair.

Then apply the fn to window and the assembled cchar_t.

char can be a lisp character, an ACS keyword, an integer code point or a complex char.

attributes should be a list of valid attribute keywords.

color-pair should be a list of a foreground and background color keyword.

attributes and color-pair can be nil.

If char is a complex char, attributes and color-pair are ignored.

Package

de.anvi.croatoan.

Source

add_wch.lisp.

Function: funcall-make-cchar_t-ptr (fn winptr char attr_t color-pair-number count)

Create a cchar_t and apply function fn count times to winptr and cchar_t.

cchar_t is a C struct representing a wide complex-char in ncurses.

This function is a wrapper around setcchar and should not be used elsewhere.

Package

de.anvi.croatoan.

Source

add_wch.lisp.

Function: funcall-make-chtype (fn window char attributes color-pair n)

Assemble a chtype out of a char, attributes and a color-pair.

Apply low-level ncurses function fn count times to window and chtype.

chtype is a 32-bit integer representing a non-wide complex-char in ncurses.

char can be a lisp character, an ACS keyword, an integer code point or a complex char.

attributes should be a list of valid attribute keywords.

color-pair should be a list of a foreground and background color keyword.

attributes and color-pair can be nil.

If char is a complex char, attributes and color-pair are ignored.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: function-arity (fn)

Return the number of required arguments of the function fn.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: function-lambda-list (fn)

Return the lambda list of the function object fn.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: gen-unused-key-code ()

Generate and return an unused key code.

Used by define-function-key when a new escape sequence is added.

To avoid conflicts with existing ncurses code numbers, new numbers start at 1024.

Package

de.anvi.croatoan.

Source

getch.lisp.

Function: get-background-cchar_t (window)

Return the wide complex char that is the background character of the window.

Package

de.anvi.croatoan.

Source

bkgrnd.lisp.

Function: get-background-char (window)

Return the complex char that is the background character of the window.

Package

de.anvi.croatoan.

Source

bkgd.lisp.

Function: get-bitmask (attribute)

Returns an ncurses attr/chtype representing the attribute keyword.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: get-catch-tag (object)

Sets the proper catch tag for exiting the event loop.

If the object is an element in a form, use the form object as the catch tag.

If the object is used outside a form, use the object itself as the catch tag.

Package

de.anvi.croatoan.

Source

form.lisp.

Function: get-event-handler (object event)

Take an object and an event, return the object’s handler for that event.

The key bindings alist is stored in the bindings slot of the object.

An external keymap can be defined so several objects can share the same set of bindings.

Object-local bindings override the external keymap. The local bindings
are checked first for a handler, then the external keymap.

If no handler is defined for the event, the default event handler t is tried. If not even a default handler is defined, the event is ignored.

If input-blocking is nil, we receive nil events in case no real events occur. In that case, the handler for the nil event is returned, if defined.

The event pairs are added by the bind function as conses: (event . #’handler).

An event should be bound to the pre-defined function exit-event-loop.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: get-geometry-plist (plist)
Package

de.anvi.croatoan.

Source

classes.lisp.

Function: gray-to-rgb (sgr)

Take a sgr gray color number 232-255, return a list of three RGB integers 0-255.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: handle-events (object args)

Read a single event from the user, lookup a handler and apply it.

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: hex-to-rgb (hex)

Take a 24bit integer (RGB hex triplet), return a list of three 8bit (0-255) RGB values.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: hex-to-sgr (hex)

Takes a RGB hex triplet, returns the exact or most appropriate SGR color code 0-255.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: init-screen ()

Initializes the curses mode. Returns the main window.

Package

de.anvi.croatoan.

Source

initscr.lisp.

Function: input-pointer-x (area)

Take an input pointer (integer) and a textarea buffer (list of characters),

return the number of columns between the pointer and the first newline before the pointer.

Package

de.anvi.croatoan.

Source

textarea.lisp.

Function: io-queue-flush (flag)
Package

de.anvi.croatoan.

Source

inopts.lisp.

Function: keyword-to-bitmask (keys alist)

Take a key list and an alist, return a bitmask combining the values of the keys.

The values in alist should be 32bit integers with only one single bit switched on.

Package

de.anvi.croatoan.

Source

mouse.lisp.

Function: label-text (label)

Decide what text to display in a label.

If the label title was given, display the label title.

If no title was given, display the title or name of the referenced element.

Otherwise display the label name.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: lead-byte-p (octet)

Return t if octet is one of the leading bytes of an UTF-8 sequence, nil otherwise.

Allowed leading byte patterns are 0xxx xxxx, 110x xxxx, 1110 xxxx and 1111 0xxx.

Package

de.anvi.croatoan.

Source

utf8.lisp.

Function: list2array (list dimensions)

Example: (list2array ’(a b c d e f) ’(3 2)) => #2A((A B) (C D) (E F))

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: make-chtype (char attributes color-pair)

Assemble a chtype out of a char, attributes and a color-pair.

char can be a lisp character, an ACS keyword, or an integer code point.

attributes should be a list of valid attribute keywords.

color-pair should be a list of a foreground and background color keyword.

attributes and color-pair can be nil.

If char is a complex char, and the attributes and color-pair are passed, they override the attributes and the color-of the complex char.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: multi-byte-p (octet)

Return t if octet is a part of a multi-byte UTF-8 sequence.

The multibyte pattern is 1xxx xxxx.

A multi-byte can be either a lead byte or a trail byte.

Package

de.anvi.croatoan.

Source

utf8.lisp.

Function: multiplep (a b)
Package

de.anvi.croatoan.

Source

textarea.lisp.

Function: n-trail-bytes (octet)

Take a leading utf-8 byte, return the number of continuation bytes 1-3.

Package

de.anvi.croatoan.

Source

utf8.lisp.

Function: new-terminal (type out-fd in-fd)

Use instead of init-screen when you want more than one terminal.

Package

de.anvi.croatoan.

Source

initscr.lisp.

Function: next-item-p (collection)

Return t if a next item can be selected, nil otherwise.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: number-to-pair (number)

Take a pair number, return a color pair in a 2 element list of keywords.

Package

de.anvi.croatoan.

Source

attr.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: plist2alist (plist)

Take a plist in the form (k1 v1 k2 v2 ...), return an alist ((k1 . v1) (k2 . v2) ...)

Package

de.anvi.croatoan.

Source

croatoan.lisp.

Function: previous-char= (area char)

Return t if char is the previous char in the buffer of textarea.

Package

de.anvi.croatoan.

Source

textarea.lisp.

Function: previous-item-p (collection)

Return t if a previous item can be selected, nil otherwise.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: previous-line-length (buf ptr)
Package

de.anvi.croatoan.

Source

textarea.lisp.

Function: queue-items (queue)
Package

de.anvi.croatoan.

Source

queue.lisp.

Function: reset-menu (menu)

After the menu is closed reset it to its initial state.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: rgb-to-hex (rgb-list)

Take a list of three 8bit (0-255) RGB values, return a 24bit integer (RGB hex triplet).

Package

de.anvi.croatoan.

Source

color.lisp.

Function: rgb-to-rgb6 (rgb-list)

Take a list of three RGB integers 0-255, return a list of three RGB integers 0-5.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: rgb6-to-rgb (rgb6-list)

Take a list of three RGB integers 0-5, return a list of three RGB integers 0-255 of the xterm color palette.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: rgb6-to-sgr (rgb6-list)

Take a list of three RGB integers 0-5, return an 8bit SGR color code 16-231.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: right-padding (str total-size &key padding-char)
Package

de.anvi.croatoan.

Source

character.lisp.

Function: rmi2sub (dimensions rmi)

Take array dimensions and an index in row-major order, return two subscripts.

This works analogous to cl:row-major-aref.

Example: (rmi2sub ’(2 3) 5) => (1 2)

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: rotate (list count)
Package

de.anvi.croatoan.

Source

stack.lisp.

Function: run-hook (object hook)

Run functions contained in the hook in the order they were added.

The following hooks are available:

before-event-hook: run before a non-nil event is handled by event-case and run-event-loop.

after-event-hook: run after a non-nil event is handled by event-case and run-event-loop.

Package

de.anvi.croatoan.

Source

hook.lisp.

Function: select-next-element (form)
Package

de.anvi.croatoan.

Source

form.lisp.

Function: select-previous-element (form)
Package

de.anvi.croatoan.

Source

form.lisp.

Function: set-attributes (winptr attributes)

Takes a list of keywords and sets the appropriate attributes.

Overwrites any previous attribute settings including the color.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: set-background-cchar_t (window char &optional apply)

Set a wide complex character as the background of a window.

The attribute part of the background character is combined with simple characters added to the window.

If apply is t, the background setting is immediately applied to all cells in the window.

Otherwise, it is applied only to newly added simple characters.

Setting the background char after setting the window attributes overrides the window attributes.

Package

de.anvi.croatoan.

Source

bkgrnd.lisp.

Function: set-background-char (winptr xchar &optional apply)

Set a complex single-byte character as the background of a window.

The attribute part of the background character is combined with simple characters in the window.

If apply is t, the background setting is immediately applied to all cells in the window.

Otherwise, it is applied only to newly added simple characters.

Package

de.anvi.croatoan.

Source

bkgd.lisp.

Function: set-color-pair (winptr color-pair)

Sets the color attribute of the window only.

Package

de.anvi.croatoan.

Source

attr.lisp.

Function: set-current-terminal (new-screen)

Sets new-screen as the current terminal. Returns the old screen.

Package

de.anvi.croatoan.

Source

initscr.lisp.

Function: set-cursor-visibility (status)
Package

de.anvi.croatoan.

Source

kernel.lisp.

Function: set-default-color-pair (use-terminal-colors-p)
Package

de.anvi.croatoan.

Source

attr.lisp.

Function: set-enable-fkeys (window flag)

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

inopts.lisp.

Function: set-equal (list-a list-b &key test key)

Compare if every element of list-a is contained in list-b.

The order of elements in lists does not matter, so the lists are actually treated as sets.

The items of the set are extracted using function ’key’ and compared using predicate ’test’.

Package

de.anvi.croatoan.

Source

character.lisp.

Function: set-geometry-plist (plist yxhw)

Take a plist and a (y x h w) geometry list, return the updated plist.

Package

de.anvi.croatoan.

Source

classes.lisp.

Function: set-input-blocking (winptr status)

Set the window input blocking behavior.

Possible values are t, nil and a blocking duration in (positive integer) miliseconds.

Package

de.anvi.croatoan.

Source

inopts.lisp.

Function: set-input-echoing (flag)

Set whether chars will be echoed on input.

Package

de.anvi.croatoan.

Source

inopts.lisp.

Function: set-input-mode (input-buffering process-control-chars)
Package

de.anvi.croatoan.

Source

inopts.lisp.

Function: sgr-to-hex (sgr)

Take a SGR color code 0-255, return a 24bit hex triplet.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: sgr-to-rgb6 (sgr)

Take a 8bit SGR color code 16-231, return a list of three RGB integers 0-5.

Package

de.anvi.croatoan.

Source

color.lisp.

Function: split-size (hints parent-size)

Take a list of size hints of one dimension, return a complete list.

The missing elements are denoted by nil, their size is evenly split.

Package

de.anvi.croatoan.

Source

grid.lisp.

Function: style-char (style)

Take a plist describing a character style, return a complex-char with the same properties.

The supported properties are :simple-char, :fgcolor, :bgcolor and :attributes.

The separate properties :fgcolor and :bgcolor can be passed together as a :color-pair.

Package

de.anvi.croatoan.

Source

character.lisp.

Function: sub2rmi (dimensions subs)

Take array dimensions and two subscripts, return an index in row-major order.

This works analogous to cl:array-row-major-index.

Example: (sub2rmi ’(2 3) ’(1 2)) => 5

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: sync-collection-grid (obj)

Sync the position in 1D collection list with the yx position in a 2D grid.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: sync-grid-collection (obj)

Set the 2D yx grid position from the 1D position in the collection list.

Package

de.anvi.croatoan.

Source

menu.lisp.

Function: test-utf-8 ()
Package

de.anvi.croatoan.

Source

utf8.lisp.

Function: textarea-add-char (area event)

Add a character to the current cursor position in textarea, then move the cursor forward.

Currently only graphic characters and newline are supported.

Package

de.anvi.croatoan.

Source

textarea.lisp.

Function: toggle-checkbox (checkbox)
Package

de.anvi.croatoan.

Source

form.lisp.

Function: trail-byte-p (octet)

Return t if octet is the continuation byte of an UTF-8 sequence.

The allowed continuation byte pattern is 10xx xxxx.

Package

de.anvi.croatoan.

Source

utf8.lisp.

Function: type-ahead-fd (fd)
Package

de.anvi.croatoan.

Source

inopts.lisp.

Function: unicode-to-utf-8 (int)

Take a unicode code point, return a list of one to four UTF-8 encoded bytes (octets).

Package

de.anvi.croatoan.

Source

utf8.lisp.

Function: utf-8-to-unicode (byte-list)

Take a list of one to four utf-8 encoded bytes (octets), return a code point.

Since this decoder will only used for reading keyboard input, the sequences are not checked for illegal bytes.

Since security is not considered, this decoder should not be used for anything else.

Package

de.anvi.croatoan.

Source

utf8.lisp.

Function: vector-not-empty-p (v)
Package

de.anvi.croatoan.

Source

character.lisp.

Function: visible-dimensions (element)
Package

de.anvi.croatoan.

Source

form.lisp.

Function: visible-grid-columns (grid)
Package

de.anvi.croatoan.

Source

grid.lisp.

Function: visible-grid-rows (grid)
Package

de.anvi.croatoan.

Source

grid.lisp.

Function: xchar2chtype (ch)

Convert a croatoan complex char to an integral ncurses chtype.

Package

de.anvi.croatoan.

Source

attr.lisp.


5.2.4 Generic functions

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: border-width-bottom (object)
Generic Writer: (setf border-width-bottom) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: border-width-bottom ((element element))
Writer Method: (setf border-width-bottom) ((element element))
Source

classes.lisp.

Target Slot

border-width-bottom.

Generic Reader: border-width-left (object)
Generic Writer: (setf border-width-left) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: border-width-left ((element element))
Writer Method: (setf border-width-left) ((element element))
Source

classes.lisp.

Target Slot

border-width-left.

Generic Reader: border-width-right (object)
Generic Writer: (setf border-width-right) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: border-width-right ((element element))
Writer Method: (setf border-width-right) ((element element))
Source

classes.lisp.

Target Slot

border-width-right.

Generic Reader: border-width-top (object)
Generic Writer: (setf border-width-top) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: border-width-top ((element element))
Writer Method: (setf border-width-top) ((element element))
Source

classes.lisp.

Target Slot

border-width-top.

Generic Function: content-position (element)
Package

de.anvi.croatoan.

Source

form.lisp.

Methods
Method: content-position ((obj menu))

Return the inner position of the content area of the menu.

content position = widget position + border + padding

Method: content-position ((element element))

Return the inner position of the content area of the element.

content position = widget position + border + padding

Generic Function: copy-complex-string (complex-string)
Package

de.anvi.croatoan.

Methods
Method: copy-complex-string (complex-string)
Source

character.lisp.

Generic Reader: current-item-position (object)
Generic Writer: (setf current-item-position) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: current-item-position ((menu menu))
Writer Method: (setf current-item-position) ((menu menu))

Position (y x) of the current item in the window.
This information is useful for positioning the cursor on the current item after displaying the menu.

Source

menu.lisp.

Target Slot

current-item-position.

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 Reader: display-pointer (object)
Generic Writer: (setf display-pointer) (object)
Package

de.anvi.croatoan.

Methods
Reader Method: display-pointer ((textarea textarea))
Writer Method: (setf display-pointer) ((textarea textarea))

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.

Source

textarea.lisp.

Target Slot

display-pointer.

Reader Method: display-pointer ((field field))
Writer Method: (setf display-pointer) ((field field))

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.

Source

field.lisp.

Target Slot

display-pointer.

Generic Function: external-height (element)
Package

de.anvi.croatoan.

Source

form.lisp.

Methods
Method: external-height ((obj element))

external-width = content width + padding + border-width