Next Prev Up

# 11.1 Atoms

In X, an atom is a unique ID used as the name for certain server resources -- properties and selections.

In CLX, an atom is represented by a keyword symbol. For convenience, CLX functions also allow atoms to be specified by strings and non-keyword symbols. xatom is a CLX data type that permits either string or symbol values. A string is equivalent to the xatom given by (intern string 'keyword). A symbol is equivalent to the xatom given by ( intern (symbol-name symbol) 'keyword). The symbol name string of an xatom must consist only of ISO Latin characters. Note that the case of xatom strings is important; the xatom "Atom" is not the same as the xatom "ATOM".

Certain atoms are already predefined by every X server. Predefined atoms are designed to represent common names that are likely to be useful for many client applications. Note that these atoms are predefined only in the sense of having xatom and card29 values, not in the sense of having required semantics. No interpretation is placed on the meaning or use of an atom by the server. The xatom objects predefined by CLX are listed below.

:arc | :italic_angle | :string
:atom | :max_space | :subscript_x
:bitmap | :min_space | :subscript_y
:cap_height | :norm_space | :superscript_x
:cardinal | :notice | :superscript_y
:colormap | :pixmap | :underline_position
:copyright | :point | :underline_thickness
:cursor | :point_size | :visualid
:cut_buffer0 | :primary | :weight
:cut_buffer1 | :quad_width | :window
:cut_buffer2 | :rectangle | :wm_class
:cut_buffer3 | :resolution | :wm_client_machine
:cut_buffer4 | :resource_manager | :wm_command
:cut_buffer5 | :rgb_best_map | :wm_hints
:cut_buffer6 | :rgb_blue_map | :wm_icon_name
:cut_buffer7 | :rgb_color_map | :wm_icon_size
:drawable | :rgb_default_map | :wm_name
:end_space | :rgb_gray_map | :wm_normal_hints
:family_name | :rgb_green_map | :wm_size_hints
:font | :rgb_red_map | :wm_transient_for
:font_name | :secondary | :wm_zoom_hints
:full_name | :strikeout_ascent :x_height
:integer | :strikeout_descent

When creating a new atom, the following conventions should be obeyed in order to minimize the conflict between atom names:

- Symbol names beginning with an underscore should be used for atoms that are private to a particular vendor or organization. An additional prefix should identify the organization.
- Symbol names beginning with two underscores should be used for atoms that are private to a single application or end user.

CLX provides functions to convert between an xatom and its corresponding ID integer. The data type of an atom ID is card29. The xatom representation is usually sufficient for most CLX programs. However, it is occasionally useful to be able to convert an atom ID returned in events or properties into its corresponding xatom.

atom-name | display atom-id | Function

| display A display object. atom-id A card29. Returns the atom keyword for the atom-id on the given display server. atom-name Type keyword.

find-atom | display atom-name | Function

| display A display object. atom-name An xatom. Returns the atom ID for the given atom-name, if it exists. If no atom of that name exists for the display server, nil is returned. atom-id Type card29 or null.

intern-atom | display atom-name | Function

| display A display object. atom-name An xatom. Creates an atom with the given name and returns its atom ID. The atom can survive the interning client; it exists until the last server connection has been closed and the server resets itself. atom-id Type card29 or null.

Next Prev Up

© 1988, 1989 Texas Instruments Incorporated
Conversion to HTML made by Gilbert Baumann.
Last build: Tue Dec 16 23:30:42 1997