Page:Xlib - C Language X Interface.pdf/10

 The major naming conventions are:
 * To differentiate the X symbols from the other symbols, the library uses mixed case for external symbols. It leaves lowercase for variables and all uppercase for user macros, as per existing convention.
 * All Xlib functions begin with a capital X.
 * The beginnings of all function names and symbols are capitalized.
 * All user-visible data structures begin with a capital X. More generally, anything that a user might dereference begins with a capital X.
 * Macros and other symbols do not begin with a capital X. To distinguish them from all user symbols, each word in the macro is capitalized.
 * All elements of or variables in a data structure are in lowercase. Compound words, where needed, are constructed with underscores (_).
 * The display argument, where used, is always first in the argument list.
 * All resource objects, where used, occur at the beginning of the argument list immediately after the display argument.
 * When a graphics context is present together with another type of resource (most commonly, a drawable), the graphics context occurs in the argument list after the other resource. Drawables outrank all other resources.
 * Source arguments always precede the destination arguments in the argument list.
 * The x argument always precedes the y argument in the argument list.
 * The width argument always precedes the height argument in the argument list.
 * Where the x, y, width, and height arguments are used together, the x and y arguments always precede the width and height arguments.
 * Where a mask is accompanied with a structure, the mask always precedes the pointer to the structure in the argument list.

1.6. Programming Considerations

The major programming considerations are:
 * Coordinates and sizes in X are actually 16-bit quantities. This decision was made to minimize the bandwidth required for a given level of performance. Coordinates usually are declared as an int in the interface. Values larger than 16 bits are truncated silently. Sizes (width and height) are declared as unsigned quantities.
 * Keyboards are the greatest variable between different manufacturers' workstations. If you want your program to be portable, you should be particularly conservative here.
 * Many display systems have limited amounts of off-screen memory. If you can, you should minimize use of pixmaps and backing store.
 * The user should have control of his screen real estate. Therefore, you should write your applications to react to window management rather than presume control of the entire screen. What you do inside of your top-level window, however, is up to your application. For further information, see chapter 14 and the Inter-Client Communication Conventions Manual.