HP 3000 Manuals

Creating Device Descriptions (contd.) [ MPE/iX Developer's Kit Reference Manual Volume II ] MPE/iX 5.0 Documentation


MPE/iX Developer's Kit Reference Manual Volume II

Creating Device Descriptions (contd.) 

Edit Capabilities 

Table 3-14  lists the capabilities used for inserting and deleting
text on terminals.  Following the table are more detailed descriptions of
the following capabilities:

   *   ich1

   *   in

   *   ip

          Table 3-14.  Editing Capabilities 

-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
|          Capability          |           Variable           |                 Description                 |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| clear=                       | clear_screen                 | Clear screen                                |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| dch=                         | parm_dch                     | Delete #1 chars                             |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| dch1=                        | delete_character             | Delete character                            |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| dl=                          | parm_delete_line             | Delete #1 lines (only from first column on  |
|                              |                              | line)                                       |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| dl1=                         | delete_line                  | Delete current line (only from first        |
|                              |                              | position on line)                           |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| ech=                         | erase_ch                     | Clear from current position to end of       |
|                              |                              | screen                                      |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| el=                          | clr_eol                      | Clear from current position to end of line, |
|                              |                              | leaving the cursor in the original position |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| el1=                         | clr_bol                      | Clear from current position to beginning of |
|                              |                              | line inclusive, leaving the cursor in the   |
|                              |                              | original position                           |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| ich=                         | parm_ich                     | Insert #1 blank characters                  |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| ich1=                        | insert_character             | Insert character                            |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| il=                          | parm_insert_line             | Add #1 new blank lines (only from first     |
|                              |                              | column line)                                |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| il1=                         | insert_line                  | Add new blank line above cursor (only from  |
|                              |                              | first column on line)                       |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| in                           | insert_null_glitch           | Insert mode distinguishes nulls             |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------

          Table 3-14.  Editing Capabilities (cont.) 

-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
|          Capability          |           Variable           |                 Description                 |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| ip=                          | insert_padding               | Insert pad after character inserted         |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| rmdc=                        | exit_delete_mode             | End delete mode                             |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| rmir=                        | exit_insert_mode             | End insert mode                             |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| rmp=                         | char_padding                 | Like ip, but when in replace mode           |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| smdc=                        | enter_delete_mode            | Delete mode (enter)                         |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------
|                              |                              |                                             |
| smir=                        | enter_insert_mode            | Insert mode (enter)                         |
|                              |                              |                                             |
-------------------------------------------------------------------------------------------------------------

Detailed Descriptions.   

More detailed descriptions are provided below for the following
capabilities:

   *   ich1
   *   in
   *   ip

ich1.   

Most characters with a true insert mode do not require ich1 to be
specified; specify ich1 for any terminal that requires a sequence to be
sent before a character can be inserted.  (Do not specify both smir and
ich1 unless the terminal must be placed in insert mode and must be sent a
character before insertion).

in.   

If the terminal distinguishes between blank characters and untyped
positions (for example, local cursor movements) in should be specified.
To find out, clear the screen, type a few characters, press a cursor key,
and type a few more characters.  Put the cursor before the first set of
characters and put the terminal in insert mode.  If the first set of
characters shifts to the second and then moves onto the next line as you
insert more characters, the terminal should be described by in.

ip.   

In addition to post-insert padding, ip can be used for any sequence that
has to be sent after a character is inserted.

Attribute Capabilities 

Table 3-15  lists the capabilities used to control attributes on the
terminal.  For example, attribute capabilities include those to
manipulate bold, underline, and color.

          Table 3-15.  Attribute Capabilities 

----------------------------------------------------------------------------------------------
|                              |                              |                              |
|          Capability          |           Variable           |         Description          |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| bce                          | back_color_erase             | Screen erased with           |
|                              |                              | background color             |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| blink=                       | enter_blink_mode             | Turn on blinking             |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| bold=                        | enter_bold_mode              | Turn on bold (extra bright)  |
|                              |                              | mode                         |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| colors#                      | max_colors                   | Maximum number of colors on  |
|                              |                              | the screen                   |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| dim=                         | enter_dim_mode               | Turn on half-bright mode     |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| hls                          | hue_lightness_saturation     | Terminal uses only HLS color |
|                              |                              | notation (Tektronix)         |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| initc=                       | initialize_color             | Initialize the definition of |
|                              |                              | color                        |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| initp=                       | initialize_pair              | Initialize color pair        |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| invis=                       | enter_secure_mode            | Turn on blank mode           |
|                              |                              | (characters invisible)       |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| ncv#                         | no_color_video               | Video attributes that cannot |
|                              |                              | be used with colors          |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| oc=                          | orig_colors                  | Set all color (pair)s to the |
|                              |                              | original one                 |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| op=                          | orig_pair                    | Set default color pair to    |
|                              |                              | the original one             |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| pairs#                       | max_pairs                    | Maximum number of color      |
|                              |                              | pairs on the screen          |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| prot=                        | enter_protected_mode         | Turn on protected mode       |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| rev=                         | enter_reverse_mode           | Turn on reverse video mode   |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| rmso=                        | exit_standout_mode           | End stand out mode           |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| rmul=                        | exit_underline_mode          | End underscore mode          |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| scp=                         | set_color_pair               | Set current color pair       |
|                              |                              |                              |
----------------------------------------------------------------------------------------------

          Table 3-15.  Attribute Capabilities (cont.) 

----------------------------------------------------------------------------------------------
|                              |                              |                              |
|          Capability          |           Variable           |         Description          |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| setb=                        | set_background               | Set current background color |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| setf=                        | set_foreground               | Set current foreground color |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| sgr=                         | set_attributes               | Define the video attributes  |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| sgr0=                        | exit_attribute_mode          | Turn off all attributes      |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| smso=                        | enter_standout_mode          | Begin stand out mode         |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| smul=                        | enter_underline_mode         | Start underscore mode        |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| xhp                          | ceol_standout_glitch         | Standout not erased by       |
|                              |                              | overwriting (hp)             |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| xmc#                         | magic_cookie_glitch          | # of blank chars left by     |
|                              |                              | smso or rmso                 |
|                              |                              |                              |
----------------------------------------------------------------------------------------------

Handling Color.   

There are two ways terminals handle color.  The Tektronix method provides
a fixed set of colors that can be used for background or foreground.  The
Hewlett-Packard method provides color pairs that represent the foreground
and background colors together; there is no way to define the foreground
and background independent of each other.

The initc string is defined for terminals that use the Tektronix method
of handling color.  The initc string requires four arguments:  one color
number (0 to color -1), and three RGB (red, green, blue) values or three
HLS colors (hue, lightness, saturation) in the same order specified in
the parentheses.

The initp string is defined for terminals that use the Hewlett-Packard
method of handling color.  The initp string requires seven parameters:
the number of the color pair (0 to pairs -1), three RGB values for
foreground, and three RGB values for background (each group in the order
of red, green, blue).

The hls Boolean variable is used to tell the CURSES init_color( ) routine
to convert RGB (red, green, blue) arguments to HLS (hue, lighness,
saturation) before sending them to the terminal (for those terminals that
only use HLS notation).

Some color terminals replace video attributes with colors.  Since these
attributes should not be combined with colors, they need to be
identified.  Information about these attributes are packed into the ncv
variable.

ncv Variable.   

The nine least significant bits of the ncv variable correspond to the
video attributes as shown in Table 3-16 . 

          Table 3-16.  ncv Variable 

----------------------------------------------------------------------------------------------
|                              |                              |                              |
|          Attribute           |         Bit Position         |        Decimal Value         |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| A_STANDOUT                   | 0                            | 1                            |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| A_UNDERLINE                  | 1                            | 2                            |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| A_REVERSE                    | 2                            | 4                            |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| A_BLINK                      | 3                            | 8                            |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| A_DIM                        | 4                            | 16                           |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| A_BOLD                       | 5                            | 32                           |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| A_INVIS                      | 6                            | 64                           |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| A_PROTECT                    | 7                            | 128                          |
|                              |                              |                              |
----------------------------------------------------------------------------------------------
|                              |                              |                              |
| A_ALTCHARSET                 | 8                            | 256                          |
|                              |                              |                              |
----------------------------------------------------------------------------------------------

The corresponding ncv bit of each attribute that should not be combined
with color should be set to one; otherwise, it should be set to zero.
The decimal values of the attributes that cannot be used with color are
summed, and that sum is packed into the ncv variable.  For example, if
the terminal uses color for standout mode (decimal value 1) and for
underlining (decimal value 2), ncv would be a value of 3.

Turning Off Attributes.   

Always use sgr0 to turn off video attributes since it is the only way to
turn off some attributes like dim or blink.

Programs using standout mode should exit standout mode (rmso) before
sending a newline or moving the cursor unless the msgr capability is
present.  (The msgr capability specifies that it's safe to move in
standout mode.)

Setting Arbitrary Modes.   

The sgr string describes the sequence to set arbitrary combinations of
modes.  The sgr string takes nine parameters in the following order:

   1.  standout
   2.  underline
   3.  reverse
   4.  blink
   5.  dim
   6.  bold
   7.  blank
   8.  protect
   9.  alternate character set

Each parameter is either zero or non-zero, representing whether the
attribute is on or off.

Table 3-17  lists the sgr parameters.

          Table 3-17.  sgr Parameters 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|                    tparm                    |                  Attribute                  |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|                                             | none                                        |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| p1                                          | standout                                    |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| p2                                          | underline                                   |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| p3                                          | reverse                                     |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| p4                                          | blink                                       |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| p5                                          | dim                                         |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| p6                                          | bold                                        |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| p7                                          | invis                                       |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| p8                                          | protect                                     |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| p9                                          | altcharset                                  |
|                                             |                                             |
---------------------------------------------------------------------------------------------



MPE/iX 5.0 Documentation