The calm Reference Manual

This is the calm Reference Manual, version 1.1.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:32:32 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 calm

CALM - Canvas Aided Lisp Magic

Author

Vito Van

License

GNU General Public License, version 2

Version

1.1.2

Dependencies
  • sdl2 (system).
  • sdl2-mixer (system).
  • sdl2-image (system).
  • str (system).
  • swank (system).
  • bt-semaphore (system).
  • cl-cairo2 (system).
  • cl-gobject-introspection (system).
Source

calm.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 calm/calm.asd

Source

calm.asd.

Parent Component

calm (system).

ASDF Systems

calm.


3.1.2 calm/package.lisp

Source

calm.asd.

Parent Component

calm (system).

Packages

3.1.3 calm/config.lisp

Dependency

package.lisp (file).

Source

calm.asd.

Parent Component

calm (system).

Internals

3.1.4 calm/events.lisp

Dependency

config.lisp (file).

Source

calm.asd.

Parent Component

calm (system).

Internals

3.1.5 calm/utils.lisp

Dependency

events.lisp (file).

Source

calm.asd.

Parent Component

calm (system).

Public Interface

3.1.6 calm/c.lisp

Dependency

utils.lisp (file).

Source

calm.asd.

Parent Component

calm (system).

Public Interface
Internals

3.1.7 calm/cairo.lisp

Dependency

c.lisp (file).

Source

calm.asd.

Parent Component

calm (system).


3.1.8 calm/fontconfig.lisp

Dependency

cairo.lisp (file).

Source

calm.asd.

Parent Component

calm (system).

Public Interface

3.1.9 calm/calm.lisp

Dependency

fontconfig.lisp (file).

Source

calm.asd.

Parent Component

calm (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 fontconfig

Source

package.lisp.

Use List

common-lisp.

Public Interface

4.2 calm

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

4.3 calm-utils

Source

package.lisp.

Use List

common-lisp.

Public Interface

4.4 c

Source

package.lisp.

Use List
  • cl-cairo2.
  • common-lisp.
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 Macros

Macro: calm-log (control-string &rest rest)
Package

calm-utils.

Source

utils.lisp.

Macro: calm-log-fancy (control-string &rest rest)
Package

calm-utils.

Source

utils.lisp.

Macro: keq (key &rest scancodes)

Key Event in JSCL + WebAssembly returns scancode value, since it has to be primitive values. But on desktop, we use SCANCODE directly, so here is a macro to unify this behaviour.

Package

c.

Source

c.lisp.

Macro: with-state (&body body)
Package

c.

Source

c.lisp.


5.1.2 Ordinary functions

Function: calm-init ()
Package

calm.

Source

calm.lisp.

Function: calm-load-and-start ()

Load canvas.lisp and then start

Package

calm.

Source

calm.lisp.

Function: calm-start ()

Start the window

Package

calm.

Source

calm.lisp.

Function: copy-dir (from to)

Let’s just cut the shit of loading ‘cl-fad’ and writing
yet another clumsy common lisp utility function
to recursively copy file system directories and lost all the file attributes. Just use the ‘cp’ command for whoever’s sake

Package

calm-utils.

Source

utils.lisp.

Function: copy-file (from to)

‘uiop:copy-file’ will remove some file attributes, so let’s use the platform command

Package

calm-utils.

Source

utils.lisp.

Function: destroy-pattern (pattern)
Package

fontconfig.

Source

fontconfig.lisp.

Function: exec (command &key expected-exit-code ignore-error-status)
Package

calm-utils.

Source

utils.lisp.

Function: exec-if (test then else &key re-exec-then expected-exit-code then-expected-exit-code else-expected-exit-code)

exec ‘test’, if the exit-code is as expected, then exec ‘then’, else run ‘else’. if ‘re-exec-then’ is T, then exec ‘then’ again after the exec of ‘else’

Package

calm-utils.

Source

utils.lisp.

Function: fc-create-pattern ()
Package

fontconfig.

Source

fontconfig.lisp.

Function: fc-init ()
Package

fontconfig.

Source

fontconfig.lisp.

Function: fc-init-reinitialize ()
Package

fontconfig.

Source

fontconfig.lisp.

Function: fc-pattern-add-integer (pattern object i)
Package

fontconfig.

Source

fontconfig.lisp.

Function: fc-pattern-add-string (pattern object string)
Package

fontconfig.

Source

fontconfig.lisp.

Function: get-from-env-or-ask (var-name &optional default-value)

‘var-name’ should be a string, or something could be fed to (string x) this function will:
1. (uiop:getenv "VAR_NAME"), return the value if it were found
2. ask user to input a new value for this, and return

Package

calm-utils.

Source

utils.lisp.

Function: get-ticks ()
Package

c.

Source

c.lisp.

Function: halt-music ()
Package

c.

Source

c.lisp.

Function: halt-wav (&optional channel)
Package

c.

Source

c.lisp.

Function: load-from-app (pathname)

load lisp files from the ‘CALM_APP_DIR’ directory,
e.g. use (load-from-app "config.lisp") to load your custom configuration file

Package

calm-utils.

Source

utils.lisp.

Function: load-from-calm (pathname)

load lisp files from the ‘CALM_HOME’ directory,
e.g. use (load-from-calm "config.lisp") to load your custom configuration file

Package

calm-utils.

Source

utils.lisp.

Function: markup->layout (markup &key font-size width height align ellipsize cr)
Package

c.

Source

c.lisp.

Function: maybe-enum (type thing)
Package

fontconfig.

Source

fontconfig.lisp.

Function: open-audio-if-not-yet ()
Package

c.

Source

c.lisp.

Function: play-music (pathname &key loops)
Package

c.

Source

c.lisp.

Function: play-wav (pathname &key loops channel)
Package

c.

Source

c.lisp.

Function: playing ()
Package

c.

Source

c.lisp.

Function: rrectangle (x y width height &key radius)

rounded rectangle

Package

c.

Source

c.lisp.

Function: select-font-family (family slant weight)
Package

c.

Source

c.lisp.

Function: set-cursor (type)
Package

calm-utils.

Source

utils.lisp.

Function: show-layout (layout &key cr)

show Pango Layout

Package

c.

Source

c.lisp.

Function: show-markup (markup &key font-size width height align ellipsize cr)

show Pango Markup

Package

c.

Source

c.lisp.

Function: show-png (pathname x y width height)
Package

c.

Source

c.lisp.

Function: touch-file (filename)
Package

calm-utils.

Source

utils.lisp.

Function: volume-music (music-volume)
Package

c.

Source

c.lisp.

Function: volume-wav (wav-volume &key channel)
Package

c.

Source

c.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *calm-audio-channels*
Package

calm.

Source

config.lisp.

Special Variable: *calm-audio-chunksize*
Package

calm.

Source

config.lisp.

Special Variable: *calm-audio-format*
Package

calm.

Source

config.lisp.

Special Variable: *calm-audio-frequency*
Package

calm.

Source

config.lisp.

Special Variable: *calm-audio-numchans*
Package

calm.

Source

config.lisp.

Special Variable: *calm-debug-variable-a*
Package

calm.

Source

config.lisp.

Special Variable: *calm-debug-variable-b*
Package

calm.

Source

config.lisp.

Special Variable: *calm-debug-variable-c*
Package

calm.

Source

config.lisp.

Special Variable: *calm-default-font-family*
Package

calm.

Source

config.lisp.

Special Variable: *calm-default-font-size*
Package

calm.

Source

config.lisp.

Special Variable: *calm-delay*
Package

calm.

Source

config.lisp.

Special Variable: *calm-env-app-dir*
Package

calm.

Source

config.lisp.

Special Variable: *calm-env-calm-cmd*
Package

calm.

Source

config.lisp.

Special Variable: *calm-env-calm-home*
Package

calm.

Source

config.lisp.

Special Variable: *calm-env-host-lisp*
Package

calm.

Source

config.lisp.

Special Variable: *calm-redraw*

The canvas will be painted again and again by calling the ‘draw’ function,
setting it to ‘NIL’ means you don’t want the canvas to be painted again,
setting it back to ‘t’ will paint the canvas again and again by calling the ‘draw’ function, again.

Package

calm.

Source

config.lisp.

Special Variable: *calm-renderer-flags*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-audio-open*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-finger-just-tapped*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-finger-x*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-finger-y*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-loaded-audio*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-mouse-down*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-mouse-inside-window*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-mouse-just-clicked*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-mouse-up*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-mouse-x*
Package

calm.

Source

config.lisp.

Special Variable: *calm-state-mouse-y*
Package

calm.

Source

config.lisp.

Special Variable: *calm-window*
Package

calm.

Source

config.lisp.

Special Variable: *calm-window-flags*
Package

calm.

Source

config.lisp.

Special Variable: *calm-window-height*
Package

calm.

Source

config.lisp.

Special Variable: *calm-window-title*
Package

calm.

Source

config.lisp.

Special Variable: *calm-window-width*
Package

calm.

Source

config.lisp.

Special Variable: *calm-window-x*
Package

calm.

Source

config.lisp.

Special Variable: *calm-window-y*
Package

calm.

Source

config.lisp.


5.2.2 Ordinary functions

Function: calm-config ()
Package

calm.

Source

config.lisp.

Function: calm-quit ()
Package

calm.

Source

calm.lisp.

Function: escape-char (char s)

char escaping for pango-markup

Package

c.

Source

c.lisp.

Function: escape-string (string)

string escaping for Pango Markup

Package

c.

Source

c.lisp.

Function: internal-draw ()

default drawing function, user should defun ‘draw’

Package

calm.

Source

calm.lisp.

Function: internal-on-fingerdown (&key x y dx dy pressure finger-id)
Package

calm.

Source

events.lisp.

Function: internal-on-fingermotion (&key x y dx dy pressure finger-id)
Package

calm.

Source

events.lisp.

Function: internal-on-fingerup (&key x y dx dy pressure finger-id)
Package

calm.

Source

events.lisp.

Function: internal-on-keydown (key)
Package

calm.

Source

events.lisp.

Function: internal-on-keyup (key)
Package

calm.

Source

events.lisp.

Function: internal-on-mousebuttondown (&key button x y clicks)
Package

calm.

Source

events.lisp.

Function: internal-on-mousebuttonup (&key button x y clicks)
Package

calm.

Source

events.lisp.

Function: internal-on-mousemotion (&key x y)
Package

calm.

Source

events.lisp.

Function: internal-on-mousewheel (x y direction)
Package

calm.

Source

events.lisp.

Function: internal-on-textinput (text)
Package

calm.

Source

events.lisp.

Function: internal-on-windowenter ()
Package

calm.

Source

events.lisp.

Function: internal-on-windowleave ()
Package

calm.

Source

events.lisp.

Function: internal-on-windowresized (width height)
Package

calm.

Source

events.lisp.

Function: internal-think ()

default thinking function, user should defun ‘think’
You may not be drawing something, but you are always thinking.

Package

calm.

Source

calm.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   C   D   E   F   G   H   I   K   L   M   O   P   R   S   T   V   W  
Index Entry  Section

C
calm-config: Private ordinary functions
calm-init: Public ordinary functions
calm-load-and-start: Public ordinary functions
calm-log: Public macros
calm-log-fancy: Public macros
calm-quit: Private ordinary functions
calm-start: Public ordinary functions
copy-dir: Public ordinary functions
copy-file: Public ordinary functions

D
destroy-pattern: Public ordinary functions

E
escape-char: Private ordinary functions
escape-string: Private ordinary functions
exec: Public ordinary functions
exec-if: Public ordinary functions

F
fc-create-pattern: Public ordinary functions
fc-init: Public ordinary functions
fc-init-reinitialize: Public ordinary functions
fc-pattern-add-integer: Public ordinary functions
fc-pattern-add-string: Public ordinary functions
Function, calm-config: Private ordinary functions
Function, calm-init: Public ordinary functions
Function, calm-load-and-start: Public ordinary functions
Function, calm-quit: Private ordinary functions
Function, calm-start: Public ordinary functions
Function, copy-dir: Public ordinary functions
Function, copy-file: Public ordinary functions
Function, destroy-pattern: Public ordinary functions
Function, escape-char: Private ordinary functions
Function, escape-string: Private ordinary functions
Function, exec: Public ordinary functions
Function, exec-if: Public ordinary functions
Function, fc-create-pattern: Public ordinary functions
Function, fc-init: Public ordinary functions
Function, fc-init-reinitialize: Public ordinary functions
Function, fc-pattern-add-integer: Public ordinary functions
Function, fc-pattern-add-string: Public ordinary functions
Function, get-from-env-or-ask: Public ordinary functions
Function, get-ticks: Public ordinary functions
Function, halt-music: Public ordinary functions
Function, halt-wav: Public ordinary functions
Function, internal-draw: Private ordinary functions
Function, internal-on-fingerdown: Private ordinary functions
Function, internal-on-fingermotion: Private ordinary functions
Function, internal-on-fingerup: Private ordinary functions
Function, internal-on-keydown: Private ordinary functions
Function, internal-on-keyup: Private ordinary functions
Function, internal-on-mousebuttondown: Private ordinary functions
Function, internal-on-mousebuttonup: Private ordinary functions
Function, internal-on-mousemotion: Private ordinary functions
Function, internal-on-mousewheel: Private ordinary functions
Function, internal-on-textinput: Private ordinary functions
Function, internal-on-windowenter: Private ordinary functions
Function, internal-on-windowleave: Private ordinary functions
Function, internal-on-windowresized: Private ordinary functions
Function, internal-think: Private ordinary functions
Function, load-from-app: Public ordinary functions
Function, load-from-calm: Public ordinary functions
Function, markup->layout: Public ordinary functions
Function, maybe-enum: Public ordinary functions
Function, open-audio-if-not-yet: Public ordinary functions
Function, play-music: Public ordinary functions
Function, play-wav: Public ordinary functions
Function, playing: Public ordinary functions
Function, rrectangle: Public ordinary functions
Function, select-font-family: Public ordinary functions
Function, set-cursor: Public ordinary functions
Function, show-layout: Public ordinary functions
Function, show-markup: Public ordinary functions
Function, show-png: Public ordinary functions
Function, touch-file: Public ordinary functions
Function, volume-music: Public ordinary functions
Function, volume-wav: Public ordinary functions

G
get-from-env-or-ask: Public ordinary functions
get-ticks: Public ordinary functions

H
halt-music: Public ordinary functions
halt-wav: Public ordinary functions

I
internal-draw: Private ordinary functions
internal-on-fingerdown: Private ordinary functions
internal-on-fingermotion: Private ordinary functions
internal-on-fingerup: Private ordinary functions
internal-on-keydown: Private ordinary functions
internal-on-keyup: Private ordinary functions
internal-on-mousebuttondown: Private ordinary functions
internal-on-mousebuttonup: Private ordinary functions
internal-on-mousemotion: Private ordinary functions
internal-on-mousewheel: Private ordinary functions
internal-on-textinput: Private ordinary functions
internal-on-windowenter: Private ordinary functions
internal-on-windowleave: Private ordinary functions
internal-on-windowresized: Private ordinary functions
internal-think: Private ordinary functions

K
keq: Public macros

L
load-from-app: Public ordinary functions
load-from-calm: Public ordinary functions

M
Macro, calm-log: Public macros
Macro, calm-log-fancy: Public macros
Macro, keq: Public macros
Macro, with-state: Public macros
markup->layout: Public ordinary functions
maybe-enum: Public ordinary functions

O
open-audio-if-not-yet: Public ordinary functions

P
play-music: Public ordinary functions
play-wav: Public ordinary functions
playing: Public ordinary functions

R
rrectangle: Public ordinary functions

S
select-font-family: Public ordinary functions
set-cursor: Public ordinary functions
show-layout: Public ordinary functions
show-markup: Public ordinary functions
show-png: Public ordinary functions

T
touch-file: Public ordinary functions

V
volume-music: Public ordinary functions
volume-wav: Public ordinary functions

W
with-state: Public macros


A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*calm-audio-channels*: Private special variables
*calm-audio-chunksize*: Private special variables
*calm-audio-format*: Private special variables
*calm-audio-frequency*: Private special variables
*calm-audio-numchans*: Private special variables
*calm-debug-variable-a*: Private special variables
*calm-debug-variable-b*: Private special variables
*calm-debug-variable-c*: Private special variables
*calm-default-font-family*: Private special variables
*calm-default-font-size*: Private special variables
*calm-delay*: Private special variables
*calm-env-app-dir*: Private special variables
*calm-env-calm-cmd*: Private special variables
*calm-env-calm-home*: Private special variables
*calm-env-host-lisp*: Private special variables
*calm-redraw*: Private special variables
*calm-renderer-flags*: Private special variables
*calm-state-audio-open*: Private special variables
*calm-state-finger-just-tapped*: Private special variables
*calm-state-finger-x*: Private special variables
*calm-state-finger-y*: Private special variables
*calm-state-loaded-audio*: Private special variables
*calm-state-mouse-down*: Private special variables
*calm-state-mouse-inside-window*: Private special variables
*calm-state-mouse-just-clicked*: Private special variables
*calm-state-mouse-up*: Private special variables
*calm-state-mouse-x*: Private special variables
*calm-state-mouse-y*: Private special variables
*calm-window*: Private special variables
*calm-window-flags*: Private special variables
*calm-window-height*: Private special variables
*calm-window-title*: Private special variables
*calm-window-width*: Private special variables
*calm-window-x*: Private special variables
*calm-window-y*: Private special variables

S
Special Variable, *calm-audio-channels*: Private special variables
Special Variable, *calm-audio-chunksize*: Private special variables
Special Variable, *calm-audio-format*: Private special variables
Special Variable, *calm-audio-frequency*: Private special variables
Special Variable, *calm-audio-numchans*: Private special variables
Special Variable, *calm-debug-variable-a*: Private special variables
Special Variable, *calm-debug-variable-b*: Private special variables
Special Variable, *calm-debug-variable-c*: Private special variables
Special Variable, *calm-default-font-family*: Private special variables
Special Variable, *calm-default-font-size*: Private special variables
Special Variable, *calm-delay*: Private special variables
Special Variable, *calm-env-app-dir*: Private special variables
Special Variable, *calm-env-calm-cmd*: Private special variables
Special Variable, *calm-env-calm-home*: Private special variables
Special Variable, *calm-env-host-lisp*: Private special variables
Special Variable, *calm-redraw*: Private special variables
Special Variable, *calm-renderer-flags*: Private special variables
Special Variable, *calm-state-audio-open*: Private special variables
Special Variable, *calm-state-finger-just-tapped*: Private special variables
Special Variable, *calm-state-finger-x*: Private special variables
Special Variable, *calm-state-finger-y*: Private special variables
Special Variable, *calm-state-loaded-audio*: Private special variables
Special Variable, *calm-state-mouse-down*: Private special variables
Special Variable, *calm-state-mouse-inside-window*: Private special variables
Special Variable, *calm-state-mouse-just-clicked*: Private special variables
Special Variable, *calm-state-mouse-up*: Private special variables
Special Variable, *calm-state-mouse-x*: Private special variables
Special Variable, *calm-state-mouse-y*: Private special variables
Special Variable, *calm-window*: Private special variables
Special Variable, *calm-window-flags*: Private special variables
Special Variable, *calm-window-height*: Private special variables
Special Variable, *calm-window-title*: Private special variables
Special Variable, *calm-window-width*: Private special variables
Special Variable, *calm-window-x*: Private special variables
Special Variable, *calm-window-y*: Private special variables