curses_intro.3x (2010 09)

c
curses_intro(3X) curses_intro(3X)
(X/Open CURSES)
Rendition
The rendition of a character displayed on the screen is its attributes and a colour-pair.
The rendition of a character written to the screen becomes a property of the character and moves with the
character through any scrolling and insert/delete line/character operations. To the extent possible on a
particular terminal, a character’s rendition corresponds to the graphic rendition of the character put on
the screen.
If a given terminal does not support a rendition that an application program is trying to use, Curses may
substitute a different rendition for it.
Colours are always used in pairs (referred to as colour-pairs). A colour-pair consists of a foreground
colour (for characters) and a background colour (for the field on which the characters are displayed).
Nonspacing Characters
The requirements in this section are in effect only for implementations that claim Enhanced Curses com-
pliance.
Some character sets may contain nonspacing characters. (Nonspacing characters are those for which
wcwidth() returns a width of zero.) The application may write nonspacing characters to a window.
Every nonspacing character in a window is associated with a spacing character and modifies the spacing
character. Nonspacing characters in a window cannot be addressed separately. A nonspacing character
is implicitly addressed whenever a Curses operation affects the spacing character with which the non-
spacing character is associated.
Nonspacing characters do not support attributes. For interfaces that use wide characters and attributes,
the attributes are ignored if the wide character is a nonspacing character. Multicolumn characters have
a single set of attributes for all columns. The association of nonspacing characters with spacing charac-
ters can be controlled by the application using the wide character interfaces. The wide character string
functions provide codeset-dependent association.
Two typical effects of a nonspacing character associated with a spacing character called c, are as follows:
The nonspacing character may modify the appearance of c. (For instance, there may be nonspacing
characters that add diacritical marks to characters. However, there may also be spacing characters
with built-in diacritical marks.)
The nonspacing character may bridge c to the character following c. (Examples of this usage are the
formation of ligatures and the conversion of characters into compound display forms, words, or ideo-
grams.)
Implementations may limit the number of nonspacing characters that can be associated with a spacing
character, provided any limit is at least 5.
Complex Characters
A complex character is a set of associated characters, which may include a spacing character and may
include any nonspacing characters associated with it. A spacing complex character is a spacing character
followed by any nonspacing characters associated with it. That is, a spacing complex character is a com-
plex character that includes one spacing character. An example of a code set that has complex characters
is ISO/IEC 10646-1:1993.
A complex character can be written to the screen; if it does not include a spacing character, any nonspac-
ing characters are associated with the spacing complex character that exists at the specified screen posi-
tion. When the application reads information back from the screen, it obtains spacing complex charac-
ters.
The
cchar_t data type represents a complex character and its rendition. When a cchar_t represents
a nonspacing complex character (that is, when there is no spacing character within the complex charac-
ter), then its rendition is not used; when it is written to the screen, it uses the rendition specified by the
spacing character already displayed.
An object of type
cchar_t can be initialised using setcchar() and its contents can be extracted using
getcchar(). The behaviour of functions that take a cchar_t input argument is undefined if the
application provides a cchar_t value that was not initialised in this way or obtained from a Curses
function that has a cchar_t output argument.
6 Hewlett-Packard Company 6 HP-UX 11i Version 3: September 2010