Common Lisp Interface Manager 2.0 User's Guide > Chapter 19 Ports, Grafts, and Mirrored Sheets


19.2 Ports

A port is a logical connection to a display server. It is responsible for managing display output and server resources and for handling incoming input events. Typically, the programmer will create a single port that will manage all of the windows on the display.

A port is described by a server path . A server path is a list whose first element is a keyword that selects the kind of port. The remainder of the server path is a list of alternating keywords and values whose interpretation is specific to the port type.

port [Protocol Class]	

Summary: The protocol class that corresponds to a port. If you want to create a new class that behaves like a port, it should be a subclass of port . Subclasses of port must obey the medium protocol.

portp [Function]	

Arguments: object

Summary: Returns t if object is a port; otherwise, it returns nil .


Summary: The basic class on which all CLIM ports are built, a subclass of port . This class is an abstract class intended only to be subclassed, not instantiated.

find-port [Function]	

Arguments: &key (server-path *default-server-path* )

Summary: Finds a port that provides a connection to the window server addressed by server-path . If no such connection exists, a new connection will be constructed and returned. find-port is called automatically by make-application-frame .

The following server paths are currently supported on the appropriate platforms:


Arguments: &key host display-number screen-id

Summary: Given this server path, find-port finds a port for the X server on the given host , using the display-id and screen-id .

On a Unix host, if these values are not supplied, the defaults are derived from the
DISPLAY environment variable.


Summary: This special variable is used by find-port and its callers to default the choice of a display service to locate. Binding this variable in a dynamic context will affect the defaulting of this argument to these functions. This variable will be defaulted according to the environment. In the Unix environment, for example, CLIM tries to set this variable based on the value of the DISPLAY environment variable.

port [Generic Function]

Arguments: object

Summary: Returns the port associated with object . port is defined for all sheet classes (including grafts and streams that support the CLIM graphics protocol), mediums, and application frames. For degrafted sheets or other objects that aren't currently associated with particular ports, port will return nil .

with-port-locked [Macro]	

Arguments: port &body body

Summary: Executes body after grabbing a lock associated with the port port , which may be a port or any object on which the function port works. If object currently has no port, body will be executed without locking.

body may have zero or more declarations as its first forms.

port-server-path [Generic Function]

Arguments: port

Summary: Returns the server path associated with the port port .

port-properties [Generic Function]

Arguments: port indicator

(setf port-properties) [Generic Function]

Arguments: property port indicator

Summary: These functions provide a port-based property list. They are primarily intended to support users of CLIM who may need to associate certain information with ports. For example, the implementor of a special graphics package may need to maintain resource tables for each port on which it is used.

map-over-ports [Function]	

Arguments: function

Summary: Invokes function on each existing port. function is a function of one argument, the port; it has dynamic extent.

restart-port [Generic Function]

Arguments: port

Summary: In a multi-process Lisp, restart-port restarts the global input processing loop associated with the port port . All pending input events are discarded. Server resources may or may not be released and reallocated during or after this action.

destroy-port [Generic Function]

Arguments: port

Summary: Destroys the connection with the window server represented by the port port . All sheet hierarchies that are associated with port are forcibly degrafted by disowning the children of grafts on port using sheet-disown-child . All server resources utilized by such hierarchies or by any graphics objects on port are released as part of the connection shutdown.

Common Lisp Interface Manager 2.0 User's Guide - 22 Dec 2009