For and overview and
related topics, see Introduction
to PEXlib.
The following conventions apply to PEXlib:
- PEXlib uses mixed case for external symbols.
PEXlib leaves all lowercase for user variables and all
upper-case for user macros, per existing convention.
Where acronyms are used in a symbol, all characters of the
acronym are upper-case, e.g., BF (back-facing), HLHSR
(hidden-line/hidden surface removal), LUT (lookup table), OC
(output command), PC (pipeline context).
- All PEXlib functions, symbols, macros, user-visible
data structures or anything a user might reference begin
with "PEX". A single exception to this is that the
error constants have a prefix of "BadPEX" for
consistency with Xlib.
- The beginnings (i.e., immediately following the
"PEX" prefix) of all function names and symbols
are capitalized.
- All fields in a data structure are in lowercase.
Compound words are constructed with underscores.
This convention overrides the capitalization of acronyms,
for data structure field names only.
- The display argument, where needed, is always
the first argument.
Often, the OC Context parameter context is the first
parameter and contains the display argument.
- All resource arguments, where needed, occur at the
beginning of the argument list but after the display
or context argument.
Where a drawable resource is needed, it is listed before
other resource arguments.
- Source arguments always precede destination
arguments.
- Where a mask is specified, the mask always precedes the
pointer to the structure.
- Where a count is specified, the count always precedes
the pointer to the list.
- Min always precedes max.
- Coordinates are specified in x, y or x, y, z order.
- Color triplets are listed in r,g,b; h,s,v; h,l,s; u,v,l
order as appropriate for the color type.
- Color quads are listed in r,g,b,a order.
- PEXlib defines constants for the user consistent with
the PEX protocol.
True and False are already defined by Xlib,
and are consistent with PEX protocol.