Skip to content

Chapter 3. Common Types

NameValue
LISTofFOO A type name of the form LISTofFOO means a counted list of elements of type FOO. The size of the length field may vary (it is not necessarily the same size as a FOO), and in some cases, it may be implicit. It is fully specified in Appendix B. Except where explicitly noted, zero-length lists are legal.

BITMASK

LISTofVALUE

The types BITMASK and LISTofVALUE are somewhat special. Various requests contain arguments of the form:

value-mask: BITMASK

value-list: LISTofVALUE

These are used to allow the client to specify a subset of a heterogeneous collection of optional arguments. The value-mask specifies which arguments are to be provided; each such argument is assigned a unique bit position. The representation of the BITMASK will typically contain more bits than there are defined arguments. The unused bits in the value-mask must be zero (or the server generates a Value error). The value-list contains one value for each bit set to 1 in the mask, from least significant to most significant bit in the mask. Each value is represented with four bytes, but the actual value occupies only the least significant bytes as required. The values of the unused bytes do not matter.

OR A type of the form "T1 or ... or Tn" means the union of the indicated types. A single-element type is given as the element without enclosing braces.
WINDOW32-bit value (top three bits guaranteed to be zero)
PIXMAP32-bit value (top three bits guaranteed to be zero)
CURSOR32-bit value (top three bits guaranteed to be zero)
FONT32-bit value (top three bits guaranteed to be zero)
GCONTEXT32-bit value (top three bits guaranteed to be zero)
COLORMAP32-bit value (top three bits guaranteed to be zero)
DRAWABLEWINDOW or PIXMAP
FONTABLEFONT or GCONTEXT
ATOM32-bit value (top three bits guaranteed to be zero)
VISUALID32-bit value (top three bits guaranteed to be zero)
VALUE32-bit quantity (used only in LISTofVALUE)
BYTE8-bit value
INT88-bit signed integer
INT1616-bit signed integer
INT3232-bit signed integer
CARD88-bit unsigned integer
CARD1616-bit unsigned integer
CARD3232-bit unsigned integer
TIMESTAMPCARD32
BITGRAVITY { Forget, Static, NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast }
WINGRAVITY { Unmap, Static, NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast }
BOOL { True, False }
EVENT { KeyPress, KeyRelease, OwnerGrabButton, ButtonPress, ButtonRelease, EnterWindow, LeaveWindow, PointerMotion, PointerMotionHint, Button1Motion, Button2Motion, Button3Motion, Button4Motion, Button5Motion, ButtonMotion, Exposure, VisibilityChange, StructureNotify, ResizeRedirect, SubstructureNotify, SubstructureRedirect, FocusChange, PropertyChange, ColormapChange, KeymapState }
POINTEREVENT { ButtonPress, ButtonRelease, EnterWindow, LeaveWindow, PointerMotion, PointerMotionHint, Button1Motion, Button2Motion, Button3Motion, Button4Motion, Button5Motion, ButtonMotion, KeymapState }
DEVICEEVENT { KeyPress, KeyRelease, ButtonPress, ButtonRelease, PointerMotion, Button1Motion, Button2Motion, Button3Motion, Button4Motion, Button5Motion, ButtonMotion }
KEYSYM32-bit value (top three bits guaranteed to be zero)
KEYCODECARD8
BUTTONCARD8
KEYMASK { Shift, Lock, Control, Mod1, Mod2, Mod3, Mod4, Mod5 }
BUTMASK { Button1, Button2, Button3, Button4, Button5 }
KEYBUTMASKKEYMASK or BUTMASK
STRING8LISTofCARD8
STRING16LISTofCHAR2B
CHAR2B[byte1, byte2: CARD8]
POINT[x, y: INT16]
RECTANGLE

[x, y: INT16,

width, height: CARD16]

ARC

[x, y: INT16,

width, height: CARD16,

angle1, angle2: INT16]

HOST

[family: { Internet, InternetV6, ServerInterpreted, DECnet, Chaos }

address: LISTofBYTE]

The [x,y] coordinates of a RECTANGLE specify the upper-left corner.

The primary interpretation of large characters in a STRING16 is that they are composed of two bytes used to index a two-dimensional matrix, hence, the use of CHAR2B rather than CARD16. This corresponds to the JIS/ISO method of indexing 2-byte characters. It is expected that most large fonts will be defined with 2-byte matrix indexing. For large fonts constructed with linear indexing, a CHAR2B can be interpreted as a 16-bit number by treating byte1 as the most significant byte. This means that clients should always transmit such 16-bit character values most significant byte first, as the server will never byte-swap CHAR2B quantities.

The length, format, and interpretation of a HOST address are specific to the family (see ChangeHosts request).