Zum Hauptinhalt springen

Common Types

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), in some cases may be implicit, and is not fully specified in this document.

BITMASK and LISTofVALUE​

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

value-mask: BITMASK
value-list: LISTofVALUE

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; unused bits in the value-mask must be zero (or the server generates a Value error). The value-list contains one value for each one bit in the mask, from least to most significant bit in the mask. Each value is represented with 4 bytes, but the actual value occupies only the least significant bytes as required; the values of the unused bytes do not matter.

Or Types​

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.

DEVICE: 32-bit id (<class,model,manufacturer,unit> 8 bits each)
WINDOW: 32-bit id
PIXMAP: 32-bit id
CURSOR: 32-bit id
FONT: 32-bit id
GCONTEXT: 32-bit id
COLORMAP: 32-bit id
DRAWABLE: WINDOW or PIXMAP
ATOM: 32-bit id (top 3 bits guaranteed to be zero)
VISUALID: 32-bit id (top 3 bits guaranteed to be zero)
VALUE: 32-bit quantity (used only in LISTofVALUE)
INT8: 8-bit signed integer
INT16: 16-bit signed integer
INT32: 32-bit signed integer
CARD8: 8-bit unsigned integer
CARD16: 16-bit unsigned integer
CARD32: 32-bit unsigned integer
TIMESTAMP: CARD32
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}
KEYCODE: CARD8
BUTTON: CARD8
KEYMASK: {Shift, CapsLock, Control, Mod1, Mod2, Mod3, Mod4, Mod5}
BUTMASK: {Button1, Button2, Button3, Button4, Button5}
KEYBUTMASK: KEYMASK or BUTMASK
STRING8: LISTofCARD8
STRING16: LISTofCHAR2B

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, NS, ECMA, Datakit, DECnet}

address: LISTofCARD8]

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 2-D matrix; hence the use of CHAR2B rather than CARD16. This corresponds to the JIS/ISO method of indexing two-byte characters. It is expected that most "large" fonts will be defined with two-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.