Previous: , Up: Introduction to CLX   [Contents][Index]


2.5 Data Types

The following are some data type definitions that are commonly used in CLX function definitions.

Type: alist (key-type-and-name datum-type-and-name) 'list

alist defines an association list. An association list is a sequence, containing zero or more repetitions of the given elements with each of the elements expressed as (type name).

Type: angle `(number ,(* -2pi) ,(* 2pi))

angle defines an angle in units of radians and is bounded by (-2%pi;) and (2%pi;). Note that we are explicitly using a different angle representation than what is actually transmitted in the protocol.

Type: arc-seq '(repeat-seq (int16 x) (int16 y) (card16 width) (card16 height) (angle angle1) (angle angle2))

arc-seq defines a six-tuple sequence of the form (x, y, width, height, angle1, angle2). The points x and y are signed, 16-bit quantities with a range from -32,768 to 32,767. The width and height values are unsigned, 16-bit quantities and range from 0 to 65,535. angle1 and angle2 are in units of radians, and bounded by (-2%pi;) and (2%pi;).

Type: array-index `(integer 0 ,array-dimension-limit)

array-index defines a type which is a subtype of the integers and can be used to describe all variables that can be array indices. The range is inclusive because start and end array index specifiers can be one (1) past the end.

Type: bit-gravity '(member gravity*)

A keyword that specifies which region of a window should be retained when the window is resized.

gravity – One of the following:

If a window is reconfigured without changing its inside width or height, then the contents of the window moves with the window and are not lost. Otherwise, the contents of a resized window are either moved or lost, depending on its bit-gravity attribute. See window-bit-gravity, in Window Attributes, for additional information.

Type: bitmap '(array bit (* *))

Specifies a two-dimensional array of bits.

Structure: bitmap-format

A structure that describes the storage format of a bitmap.

The bitmap-format structure contains slots for unit, pad, and lsb-first-p. The unit member indicates the unit of increments used to maintain the bitmap data. The units available for use are 8, 16, or 32 bits. The pad member indicates how many bits are needed to pad the left edge of the scan-line. The lsb-first-p member is a predicate which indicates the ordering of bits with the bitmap unit.

Slot of bitmap-format: unit

Type: (member 8 16 32).

The size of a contiguous grouping of bits, which can be 8, 16, or 32. The default is 8.

Slot of bitmap-format: pad

Type: (member 8 16 32).

The number of bits to left-pad the scan-line, which can be 8, 16, or 32. The default is 8.

Slot of bitmap-format: lsb-first-p

Type: boolean.

A predicate indicating whether the least significant bit comes first (true) or not (nil).

Type: boolean '(or nil (not nil))

boolean defines a type which is all inclusive. It is used for variables that can take on a true (non-nil) or false (nil) value.

Type: boole-constant `(member value*)

boole-constant defines a type that is a set of the values associated with the 16 boolean operation-code constants for the Common Lisp language. It is used for the set of allowed source and destination combination functions in a graphics context.

value – One of the following:

Type: card8 '(unsigned-byte 8)

An unsigned integer value that is a maximum of eight bits long. This gives a number of this type a range from 0 to 255.

Type: card16 '(unsigned-byte 16)

An unsigned integer value that is a maximum of 16 bits long. This gives a number of this type a range from 0 to 65,535.

Type: card29 '(unsigned-byte 29)

An unsigned integer value that is a maximum of 29 bits long. This gives a number of this type a range from 0 to 536,870,911.

Type: card32 '(unsigned-byte 32)

An unsigned integer value that is a maximum of 32 bits long. This gives a number of this type a range from 0 to 4,294,967,295.

Type: color '(satisfies color-p)

A color. See Color Functions, for additional information.

Type: colormap '(satisfies colormap-p)

A colormap. See Colormap Functions, for additional information.

Type: cursor '(satisfies cursor-p)

A cursor. See Cursors, for additional information.

Type: device-event-mask '(or mask32 (list device-event-mask-class))

Provides a way to specify a set of bits for an event bitmask. Two ways of specifying the bits are allowed: by setting the event bits in a 32 bit mask, or by listing the keyword names of the device related event bits in a list.

Type: device-event-mask-class '(member event*)

A keyword name, for a device related event, that corresponds to a particular bit in an event bitmask. The set of names is a subset of the names in the type event-mask-class.

event – One of the following:

Type: display '(satisfies display-p)

A connection to an X server. See Displays, for additional information.

Type: drawable '(or window pixmap)

Both windows and pixmaps can be used as sources and destinations in graphics operations. windows and pixmaps together are known as drawables. However, an :input-only window cannot be used as a source or destination in a graphics operation.

Type: draw-direction '(member :left-to-right :right-to-left)

Defines a list of rotation directions for drawing arcs and fonts. draw-direction can have the values of :left-to-right or :right-to-left.

Type: error-key '(member error*)

Defines a list of all predefined errors. All errors (synchronous and asynchronous) are processed by calling an error handler in the display. The handler is called with the display as the first argument and the error-key as its second argument.

error – One of the following:

Type: event-key '(member event-type*)

Defines a list that specifies all predefined event-types. Clients are informed of information asynchronously by means of events. These events can be either asynchronously generated from devices or generated as side effects of client requests.

event-type – One of the following:

Type: event-mask '(or mask32 (list event-mask-class))

Provides a way to specify a set of bits for an event bitmask. Two ways of specifying the bits are allowed: by setting the event bits in a 32 bit mask, or by listing the keyword names of the event bits in a list.

Type: event-mask-class '(member event*)

The elements of the type event-mask-class are keyword names that correspond to a particular bit in an event bitmask.

event – One of the following:

Function: make-event-keys event-mask

Returns a list of event-mask-class keyword names for the event bits that are set in the specified event mask.

event-mask

An event mask (type mask32).

Function: make-event-mask &rest keys
keys

event-mask-class keywords.

Constructs an event mask from a set of event-mask-class keyword names.

event-mask

Type mask32.

Type: font '(satisfies font-p)

A text font. See Font and Characters, for additional information.

Type: fontable '(or stringable font)

A fontable is either a font object or the name of one of the fonts in the font database.

Type: font-props 'list

A list that contains alternating keywords and integers.

Type: gcontext '(satisfies gcontext-p)

A graphics context. See Graphics Contexts, for additional information.

Type: gcontext-key '(member type*)

A list of predefined types for use in gcontext processing. Various information for graphics output is stored in a graphics context (GC or GContext), such as foreground pixel, background pixel, line width, clipping region, and so forth.

type – One of the following:

Type: grab-status '(member grab-type*)

There are two kinds of grabs: active and passive. An active grab occurs when a single client grabs the keyboard and/or pointer explicitly. Clients can also grab a particular keyboard key or pointer button in a window. The grab activates when the key or button is actually pressed, and is called a passive grab. Passive grabs can be very convenient for implementing reliable pop-up menus.

grab-type – One of the following:

Type: image-depth '(integer 0 32)

Used in determining the depth of a pixmap, window, or image. The value specifies the number of bits deep that a given pixel has within a given pixmap, window, or image.

Type: index-size '(member :default 8 16)

Used to control the element size of the destination buffer given to the translate function when drawing glyphs. If :default is specified, the size is based on the current font, if known; otherwise, 16 is used.

Type: int8 '(signed-byte 8)

A signed integer value that is a maximum of eight bits long. A number of this type can have a range from -128 to 127.

Type: int16 '(signed-byte 16)

A signed integer value that is a maximum of 16 bits long. A number of this type can have a range from -32,768 to 32,767.

Type: int32 '(signed-byte 32)

A signed integer value that is a maximum of 32 bits long. A number of this type can have a range from -2,147,483,648 to 2,147,483,647.

Type: keysym 'card32

Used as an encoding of a symbol on a keycap on a keyboard. It is an unsigned integer value represented in a maximum of 32 bits long. A keysym type can have a range from 0 to 4,294,967,295.

Type: mask16 ' card16

A positional bitmask that contains 16 boolean flags.

Type: mask32 ' card32

A positional bitmask that contains 32 boolean flags.

Type: modifier-key '(member modifier*)

A keyword identifying one of the modifier keys on the keyboard device.

modifier – One of the following:

Type: modifier-mask '(or (member :any) mask16 (list modifier-key))

A bitmask or list of keywords that specifies a set of modifier keys. The keyword :any is equivalent to any subset of modifier key.

Type: pixarray '(or (array pixel (* *)) (array card16 (* *)) (array card8 (* *)) (array (unsigned-byte 4) (* *)) (array bit (* *)))

Specifies a two-dimensional array of pixels.

Type: pixel '(unsigned-byte 32)

An unsigned integer value that is a maximum of 32 bits long. This gives a pixel type a value range from 0 to 4,294,967,295. Useful values are dependent on the class of colormap being used.

Type: pixmap '(satisfies pixmap-p)

A pixmap, see Pixmaps), for additional information.

Structure: pixmap-format

A structure that describes the storage format of a pixmap.

The pixmap-format structure contains slots for depth, bits-per-pixel, and scanline-pad. The depth member indicates the number of bit planes in the pixmap. The bits-per-pixel member indicates the number of bits used to represent a single pixel. For X, a pixel can be 1, 4, 8, 16, 24, or 32 bits wide. As for bitmap-format, the scanline-pad member indicates how many pixels are needed to pad the left edge of the scan-line.

Slot of pixmap-format: depth

Type: image-depth.

The number of bit planes in the pixmap.

Slot of pixmap-format: bits-per-pixel

Type: (member 1 4 8 16 24 32).

The number of consecutive bits used to encode a single pixel. The default is 8.

Slot of pixmap-format: scanline-pad

Type: (member 8 16 32).

The number of bits to left-pad the scan-line, which can be 8, 16, or 32. The default is 8.

Type: point-seq '(repeat-seq (int16 x) (int16 y))

The point-seq type is used to define sequences of (x,y) pairs of points. The paired values are 16-bit, signed integer quantities. This gives the points in this type a range from -32,768 to 32,767.

Type: pointer-event-mask '(or mask32 (list pointer-event-mask-class))

Provides a way to specify a set of bits for an event bitmask. Two ways of specifying the bits are allowed: by setting the event bits in a 32 bit mask, or by listing the keyword names of the pointer related event bits in a list.

Type: pointer-event-mask-class '(member event*)

A keyword name, for a pointer related event, that corresponds to a particular bit in an event bitmask. The set of names is a subset of the names in the type event-mask-class.

event – One of the following:

Type: rect-seq '(repeat-seq (int16 x) (int16 y) (card16 width) (card16 height))

rect-seq defines a four-tuple sequence of the form (x, y, width, height). The points x and y are signed, 16-bit quantities with a range from -32,768 to 32,767. The width and height values are unsigned, 16-bit quantities and range from 0 to 65,535.

Type: repeat-seq (&rest elts) 'sequence

A subtype used to define repeating sequences.

Type: resource-id 'card29

A numeric identifier that is assigned by the server to a server resource object.

Type: rgb-val '(float 0.0 1.0)

An rgb-val is a floating-point value between 0 and 1 that specifies a saturation for a red, green, or blue additive primary. The 0 value indicates no saturation and 1 indicates full saturation.

Type: screen '(satisfies screen-p)

A display screen. See Screens, for further information.

Type: seg-seq '(repeat-seq (int16 x1) (int16 y1) (int16 x2) (int16 y2))

Defines sequences of (x1, y1, x2, y2) sets of points. The point values are 16-bit, signed integer quantities. This gives the points in this type a range from -32,768 to 32,767.

Type: state-mask-key '(or modifier-key (member button*))

A keyword identifying one of the display modifier keys or pointer buttons whose state is reported in device events.

button – One of the following:

Function: make-state-keys state-mask
state-mask

A 16-bit mask of type mask16.

Returns a list of state-mask-key symbols corresponding to the state-mask. A symbol belongs to the returned list if, and only if, the corresponding state-mask bit is 1.

state-keywords

Type list.

Function: make-state-mask &rest keys
keys

A list of state-mask-key symbols.

Returns a 16-bit mask representing the given state-mask-key symbols. The returned mask contains a 1 bit for each keyword.

mask

Type mask16.

Type: stringable '(or string symbol)

Used for naming something. This type can be either a string or a symbol whose symbol-name is used as the string containing the name. The case of the characters in the string is ignored when comparing stringables.

Type: timestamp '(or null card32)

An encoding of a time. nil stands for the current time.

Structure: visual-info

A structure that represents a visual type. The elements of this structure are id, class, red-mask, green-mask, blue-mask, bits-per-rgb, and colormap-entries.

Slot of visual-info: id

Type: card29.

A unique identification number.

Slot of visual-info: class

Type: (member :direct-color :gray-scale :pseudo-color :static-color :static-gray :true-color).

The class of the visual type.

Slots of visual-info: red-mask
Slots of visual-info: green-mask
Slots of visual-info: blue-mask

Type: pixel.

The red-mask, green-mask, and blue-mask elements are only meaningful for the :direct-color and :true-color classes. Each mask has one contiguous set of bits with no intersections.

Slot of visual-info: bits-per-rgb

Type: card8.

Specifies the log base 2 of the approximate number of distinct color values ( individually) of red, green, and blue. Actual RGB values are unsigned 16-bit numbers.

Slot of visual-info: colormap-entries

Type: card16.

Defines the number of available colormap entries in a newly created colormap. For :direct-color and :true-color, this is the size of an individual pixel subfield.

Type: win-gravity '(member gravity*)

A keyword that specifies how to reposition a window when its parent is resized.

gravity – One of the following:

If a parent window is reconfigured without changing its inside width or height, then all child windows move with the parent and are not changed. Otherwise, each child of the resized parent is moved, depending on the child’s gravity attribute. See window-gravity (see Window Attributes)), for additional information.

Type: window '(satisfies window-p)

A window. See Windows and Pixmaps, for additional information.

Structure: wm-size-hints

A structure that contains size hints for the window manager.

Slot of wm-size-hints: x

Type: (or null int32).

This slot is obsolete. New window managers do not use it.

Slot of wm-size-hints: y

Type: (or null int32).

This slot is obsolete. New window managers do not use it.

Slot of wm-size-hints: width

Type: (or null card32).

This slot is obsolete. New window managers do not use it. They will use the min-width and max-width slots instead.

Slot of wm-size-hints: height

Type: (or null card32).

This slot is obsolete. New window managers do not use it. They will use the min-height and max-height slots instead.

Slot of wm-size-hints: min-width

Type: (or null card32).

This slot indicates the smallest width for which the application still works properly.

Slot of wm-size-hints: min-height

Type: (or null card32).

This slot indicates the smallest height for which the application still works properly.

Slot of wm-size-hints: max-width

Type: (or null card32).

This slot indicates the largest width for which the application still works properly.

Slot of wm-size-hints: max-height

Type: (or null card32).

This slot indicates the largest height for which the application still works properly.

Slot of wm-size-hints: width-inc

Type: (or null card32).

This slot defines an arithmetic progression of widths (minimum to maximum) into which the window prefers to be resized.

Slot of wm-size-hints: height-inc

Type: (or null card32).

This slot defines an arithmetic progression of heights (minimum to maximum) into which the window prefers to be resized.

Slot of wm-size-hints: min-aspect

Type: (or null number).

This slot specifies the minimum aspect ratio (the fraction x size divided by y size) preferred by the application.

Slot of wm-size-hints: max-aspect

Type: (or null number).

This slot specifies the maximum aspect ratio (the fraction x size divided by y size) preferred by the application.

Slot of wm-size-hints: base-width

Type: (or null card32).

This slot specifies the desired width of the window.

Slot of wm-size-hints: base-height

Type: (or null card32).

This slot specifies the desired height of the window.

Slot of wm-size-hints: win-gravity

Type: (or null win-gravity).

The window manager will interpret the position of the window and its border width to position the point of the outer rectangle of the overall window specified by the value of this slot. The outer rectangle of the window includes any borders or decorations supplied by the window manager. In other words, if the window manager decides to place the window where the client asked, the position on the parent window’s border named by the value of this slot will be placed where the client window would have been placed in the absence of a window manager.

Type: xatom '(or string symbol)

A name that has been assigned a corresponding unique ID by the server. xatoms are used to identify properties, selections, and types defined in the X server. An xatom can be either a string or symbol whose symbol-name is used as the xatom name. The case of the characters in the string are significant when comparing xatoms.


Previous: , Up: Introduction to CLX   [Contents][Index]