All Manuals > CAPI User Guide and Reference Manual > 19 Host Window System-specific issues

19.5 CAPI communication with host window system - libraries

CAPI communicates with the host window system via backends called libraries. In most cases you need not worry about the library, and just use generic CAPI.

Currently there are four libraries, named by keywords as follows:

:win32
The only library for Microsoft Windows.
:cocoa
The default library for macOS.
:gtk
The default library for Linux, FreeBSD and x86/x64 Solaris, also available on macOS.
:motif
Deprecated but available on non-Windows platforms.

The function default-library returns the default library for the current platform.

Note: On platforms that support GTK+ and Motif, default-library normally returns :gtk, but after loading Motif using (require "capi-motif") it returns :motif.

A library name is a valid argument to convert-to-screen, and can be used in places when a screen specification is required, most importantly as argument to display. Normally, however, you will be using the default screen of the default library, so you will not have to worry about it.

default-library is used when a program that is designed to run on various platforms wants to do different things in different GUI systems. Note that default-library is available before displaying anything, and can be used at load-time.

The functions installed-libraries returns a list of the installed libraries in the current image. Normally it is just a list of the default library, but loading Motif adds it into the list.


CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:33:54