Configuration Guide


Chapter 7 . Video File

Panther is designed to run on many character-mode displays with numerous differences between them. For example, some displays are 80 columns wide, while others have 132 columns. Similarly, control sequences used to position the cursor and highlight data on the display often differ from model to model.

Panther uses a video file specific to a given terminal type to determine how to handle that terminal's display characteristics, and so display screens and messages correctly. Each video file defines the display characteristics for a given character-mode terminal type. The Panther distribution includes video files in the config directory that support around 35 character-mode terminal types. One of the distributed video files should work for you.

Note: GUI platforms do not require a video file.

This chapter covers the following topics:


Finding the Correct Video File

As distributed, Panther can be configured to support around 35 character-mode terminals as well as those that emulate other terminals:

  1. Identify the binary video file in the distributed SMVARS source file (in the config directory) that supports your terminal: among the SMVIDEO settings, find the one with a parenthetic mnemonic for your terminal type. For example, the SMVIDEO entry for a vt100 terminal looks like this:
    SMVIDEO = (vt100) $SMBASE/config/vt100vid.bin
  2. Set the SMTERM variable to the mnemonic—in the previous example, SMTERM = vt100. Or, enter the mnemonic when prompted for terminal type when you invoke prodev.
  3. Invoke prodev and check whether basic functions work correctly.

    If the screen does not clear or characters are positioned incorrectly, try one of these approaches:

Table 7-1 provides a listing of popular terminal types. After you determine the family of terminals (there may be more than one video file to support a single family), try each of the files associated with the family of terminals by setting SMTERM to the appropriate terminal mnemonic.

Table 7-1 General categories of families of terminals

If the family is Look for Set SMTERM to

ANSI/DEC VT

ESC [or CSI in the ASCII video files

vt100

Televideo, Wyse

ESC * or ESC = in the ASCII video files

wy30; wy50

Hewlett-Packard

Video files supporting HP terminals begin with the letters hp.

hp

Data General

Video files supporting Data General terminals begin with the letters dg

dg214


The Role of the Video File

Panther video files are based on the termcap and terminfo databases. These databases were originally developed to handle display of the earliest full-screen editors such as emacs and vi. Because these editors use the screen non-sequentially, they need terminal-specific ways to move the cursor, clear the screen, insert lines, and so on. Although closely associated with UNIX, termcap and terminfo are also used on other operating systems, and list idiosyncrasies of many terminal types.

Text editors use visual attributes sparingly, if at all. Thus, termcap contains minimal information about handling them. Usually there are entries to start and end "stand-out" and sometimes entries to start and end "underline." Notably missing are entries that explain how to combine attributes, like reverse video and blinking simultaneously. The terminfo database can combine attributes; in practice, however, the appropriate entries are usually missing.

Panther makes extensive use of attributes in all combinations, and supports color. Rather than extending termcap with additional codes, which might conflict with other extensions, Panther uses an independent file to describe the terminal specific information. Furthermore, some machines, notably PCs, lack terminfo capability.

Panther developed a set of commands that extend the limited set of commands used by termcap and abbreviates verbose sequences used by terminfo. Both syntaxes are supported. All the commands needed in the video file can be written using terminfo syntax; many can be written using the simpler termcap syntax and a few can benefit by using the extended commands.

A summary of the commands used to process parameters is described in this chapter; details and examples are also included.

The Basic Video File

At a minimum, a video file requires two entries:

Although character-mode Panther functions with these two entries, it does so with a limited set of display capabilities—for example, visual attributes are unavailable. Speed can also be affected adversely—many video file entries serve to decrease the number of characters transmitted to the terminal.

Unless otherwise indicated, Panther assumes a 24-line by 80-column screen. Line 24 is used for status text and error messages, and the remaining 23 are available for screens. The non-display attribute is supported and available. The underline attribute is simulated by underscores placed wherever blanks appear in an underlined field. Clearing a line is done by writing spaces. Borders are available, and consist of printable characters only. Refer to "Enhancing a Basic Video File" for specific details on enhancing a basic video file to include display attributes, such as reverse, underline, and so on.

Processing Keywords—Automatic Parameter Sequencing

A stack is used to process a keyword in the video file—parameters are kept in a separate list. The stack is initially empty and parameters are generally pushed on the stack as needed. The parameters are ordered and a pointer is used to access them. It initially points to the first one. The stack is four levels deep; anything pushed off the end is lost. There are commands that push a parameter or constant onto the stack, but no explicit pop commands. Output commands transmit the value on top of the stack, then remove it.

Arithmetic and logical operations take one or two operands from the top of the stack, and replace them with one result; thus, they perform an implicit pop. These types of operations use postfix notation. The operands are pushed, then the operation takes place. So the sequence %p1 %p2 %p3 %+ %* leaves parameter1 + (parameter2 * parameter3) on the stack. This same mechanism is used by terminfo.

Refer to "Parameters for Keyword Sequences" for information about specific parameters.

Supporting termcap commands

termcap commands do not use a stack mechanism. To support them, Panther uses an automatic parameter sequencing scheme where a current index into the parameter list is maintained. When a parameter is needed on the stack, the following actions occur:

The effect of this scheme is that termcap-style commands are translated into terminfo-style.

Although it is possible to use automatic sequencing and explicit parameter pushes in the same sequence, it is not recommended. Explicit pushes of constants with automatic parameter sequencing, however, is a useful combination. For example:

REPT= %p1 %c ESC F %'?' %p2 %+ %c

Video File Syntax

A video file is initially created and edited as an ASCII text file, which is accessible with any text editor. Lines that start with a pound sign (#) are treated as comments and ignored by the vid2bin utility when it converts the ASCII source file to binary format. All distributed video source files are documented with comments.

A video file consists of many instructions, one per line, and has the following format:

keyword = variable-data

keyword
A single word used to define the instructions. Refer to "Video File Keywords."

When you add entries to a video file, it is essential that you use the formats described for the specific video instruction. No error checking is done at runtime. The vid2bin utility checks for errors like missing, misspelled, and superfluous keywords, but ignores duplicate or conflicting entries.

variable-data
A number, a list of characters, a sequence of characters, or a list of further instructions. The value of variable-data depends on the keyword. Refer to "Parameters for Keyword Sequences" for information on keywords that use specific parameters as variable-data.

Wrapping Lines

To continue a logical line on the next physical line, end the first line with a backslash. Do not leave a space between the backslash and carriage return. All white space (spaces and tabs) is skipped, except where noted. To enter a backslash as the last character of a line, use two backslashes (without spaces). Thus

text \

Continuation line

text \\

Ends with a backslash

text \\\

Backslash and a continuation

Double Quotes

A double quote " starts a string. Text between it and the next double quote (or the end of the line) is taken literally, including spaces. To include a double quote in a quoted string, use backslash quote \" with no space between.

"stty tabs"

Has an embedded space

stty tabs

No embedded space

Percent Sign (%)

The percent sign is a control character (refer to Table 7-3 for a list of percent commands). To enter a literal percent sign, enter it twice—for example, %%).

Inputting Control Characters

You can enter in a video file non-printing characters such as control characters with these strings:

Refer to Table 6-4 for a list of mnemonics and hexadecimal values.

Extended ASCII control codes can be transmitted only if the communication line and terminal use eight data bits. Otherwise, the eight-bit code can be replaced by two seven-bit codes—the first code is ESC (0x1b), the second is 0x40 less than the desired eight-bit control character. For example, CSI (0x9b) is replaced by ESC 0x5b, or ESC [. If your video file contains extended ASCII control codes, Panther assumes they can be used; it does not transmit the two-character sequence automatically.

Note: Some computers internally toggle the high bit of a character. The numbers given in this guide are always standard ASCII.

Parameters for Keyword Sequences

Certain keywords take values or sequences that cannot be completely specified in advance. For example, the cursor position sequence requires the line and column number before moving. The commands using these sequences are passed extra parameters.

Table 7-2 lists those keywords that are passed parameters. The number in parentheses is the number of parameters for each keyword.

Table 7-2 Keywords and expected parameters

Keyword Action Parameters

REPT

repeat sequence (2)

Character
Number of times to repeat

EW

erase window (5)

Start line
Start column
Number of lines
Number of columns
Background color

CUP

cursor position (2)

Line and column (relative to 0)

CUU

cursor up (1)

Line increment

CUD

cursor down (1)

Line increment

CUF

cursor forward (1)

Column increment

CUB

cursor backward (1)

Column increment

SGR

set latch graphics rendition (12)

See SGR

ASGR

set area graphics rendition (12)

See ASGR

Percent Commands

Parameters are encoded in sequences by percent commands where the sequence starts with the % symbol. Percent commands perform these tasks:

Panther uses a stack mechanism like that used by terminfo; refer to "Parameters for Keyword Sequences" for a description. However, use percent commands with care, because all sequences go through the same processing, even those that do not use runtime arguments. In particular, to enter a percent sign as a literal, you must use %%.

Percent commands are summarized in Table 7-3. They are organized by function, and their source is indicated (C for termcap; I for terminfo; E for Panther extended command). Descriptions and examples are provided in subsequent sections.

Percent commands that take a count (represented by a # immediately after a %) do not need to have a count specified. If none is specified, the count is assumed to be 1. For example, %w is equivalent to %1w. (This does not apply to %d.)

Table 7-3 Percent commands

Percent command Source* Description
Output Commands

%%

C / I

Output a percent sign

%.

C

Output a character

%c

I

Output a character

%d

C / I

Output a decimal

%#d

I

Output a #-digit decimal, blank filled

%0#d

I

Output a #-digit decimal, zero filled, like the termcap %2 which is not supported

%+

C

Add and output a character

%#z

E

Output # (decimal number) binary zeros

%#w

E

Wait (sleep) # seconds

%S

E

Issue a system command

Stack Manipulation and Arithmetic Commands

%p#

I

Push parameter # (1 - 12 allowed)

%'c'

I

Push the character constant c

%{#}

I

Push the integer constant #

%+

I

Add

%-

I

Subtract

%*

I

Multiple

%/

I

Divide

%m

I

Modulus

%|

I

Bitwise OR

%^

I

Bitwise exclusive OR

%&

I

Bitwise AND

%=

I

Logical EQUAL TO

%>

I

Logical GREATER THAN

%<

I

Logical LESS THAN

%!

I

Logical NOT

%~

I

One's complement

Parameter Sequencing Commands

%#u

E

Discard # parameters

%#b

E

Back up # parameters

%i

C / I

Increment the next two parameters

%r

C

Reverse the next two parameters

Control Flow Commands

%? expr %t then-part

%e else-part %;

I

Conditionally execute one of two command sequences

expr %t then-part %e 
else-part %;

E

Same effect as previous

%#( ... %)

E

Repeat the sequence # times

%l( ... %)

E

Select operations from a list

terminfo commands not supported

%P, %g

Letter variables

$<#>

Padding (use %#z instead)

* C = termcap; I = terminfo; E = Panther extended command

Output Commands

%%

Outputs a literal percent sign.

%.

Outputs a character, like printf; this command is supplied for termcap compatibility.

%c

Outputs a character, like printf (equivalent to %).

%d

Outputs a decimal, any number of digits, no fill. It has variations that allow for specifying the number of digits, and whether blank-fill or zero-fill is to be used.

%#d

Outputs a #-digit decimal, blank filled. For example, %3d outputs at most three decimal digits with blank fill.

%0#d

Outputs a #-digit decimal, zero filled. For example, %03d outputs at most three decimal digits with zero fill.

%+

Adds and outputs a character. If the stack is empty, the character following %+ is added to the next parameter, the sum is output as a character, and the parameter index is incremented. Also refer to definitions of %+ in arithmetic commands and automatic parameter sequencing.

%#z

Outputs the specified number of NUL characters (binary zero). It is usually used for padding, to insert a time delay for commands such as erase screen. The sequence %100z outputs 100 pad bytes to the terminal.

%#w

Waits (sleeps) the specified # of seconds. (Although supported on all UNIX platforms, it is not supported on systems where the sleep library routine is unavailable). It is often used as a time delay for INIT and RESET sequences. The sequence %2w evokes a wait of two seconds.

%S

Issues a system command. The format is %S (string %)—the string is passed to the command interpreter for execution. To include spaces in the string, enclose the text in single quotation marks. The following examples illustrate two ways of making a system call stty tabs:

%S('stty tabs'%)

%S(stty SP tabs%)

Stack Manipulation and Arithmetic Commands

Commands are available to push parameters and constants. Only four levels of stack are supported, and anything pushed off the end is discarded.

%p# .

Pushes parameter #; 1 to 11 is allowed. For example, the sequence %p2 pushes the second parameter

%'c'

Pushes the character constant c. For example, the sequence %'x' pushes the character x.

%{#}

Pushes the integer constant #. For example, the sequence %{12} pushes the number 12.

Various arithmetic and logical operations such as %+, %/, %&, %> are supported. They require one or two operands on the stack. If necessary an automatic push is generated, using the next parameter.

%'@' %| %| %| %c Bitwise OR 3 parameters with @, then output result

The automatic parameter sequencing mechanism works well in the above example. Because bitwise OR requires two parameters and there is only one on the stack, a push is performed. No push is required to process %c because an entry already exists on the stack. Thus only three parameters are consumed and the result of the bitwise OR is output.

In the following sequence the first parameter is pushed, then a space character (0x20) is pushed. The %+ command pops and adds these values and puts the answer on the stack. %c then pops this value and transmits it to the terminal.

%p1 %'SP' %+ %c

Parameter Sequencing Commands

With automatic sequencing of parameters, sometimes it is necessary to access the parameters in a different order. The following percent commands can be specified:

%#b

Backs up the # of parameters by decrementing the parameter index. For example, the following sequences output the same parameter twice:

%d %b %d

%p1 %d %p1 %d

%#u

Uses up or discards # of parameters by incrementing the parameter index. For example, the following sequences output in reverse order:

%u %d %2b %d

%p2 %d %p1 %d

Parameter Changing Commands

Parameter changing commands either increment parameters or reverse them

%i

Increments the next two parameters; however, no output is performed and no parameters are consumed. It is used almost exclusively in termcap cursor positioning sequences. It is passed line and column parameters, with the upper left being (0,0). Many terminals expect the line and column to be relative to (1,1). The following sequence adds one to each parameter and sends it out as decimals: ESC [ %i %d ; %d H

%r

Reverses the next two parameters. It is unnecessary if explicit parameter pushes are used; in fact, it should be avoided in that case because the numbering of the parameters is reversed. This command is often used in cursor positioning sequences where the terminal requires that column be given first and then the line (the default being the other way around). For example, this sequence outputs column first, and then line:

FS G %r %c %c

Control Flow Commands

Control flow commands conditionally execute command sequences. Some specify the number of times to repeat the sequence, and others select operations from a list.

Conditional Command
%? expr %t then-part%e else-part%;				

This is the general if-then-else clause, which can be abbreviated by omitting the if:

expr %t then-part %e else-part %;. 

expr is any sequence including the empty sequence. The %t, which is required, pops a value from the stack and tests it, executing then-part if it is true (non-zero) and else-part otherwise.

then-part and else-part can be any sequence, including the empty sequence. If else-part is empty, %e can be omitted. They can also contain conditionals, so else-if can be implemented. However, this can produce undecipherable sequences. It is provided for terminfo compatibility. The list command (below) is an alternative.

If %t finds the stack is empty, it generates an automatic push of the next parameter. %t consumes one parameter; however, the incrementing of the parameter index is delayed until after the entire conditional is executed. A conditional always consumes exactly one parameter, regardless of which branch is taken or of the content of then-part or else-part. If either of those use automatic parameter sequencing, they use a local index. Thus even if they consume two parameters, at the end of the conditional the parameter index is reset. When the next command is reached, only one parameter has been consumed.

In this sequence, %t ; %c %;, one parameter is consumed. It outputs and a character if the parameter is non-zero, otherwise it skips the parameter.

In the next example, the constant (binary) 1 is pushed, the parameter is compared with 1, and the boolean value is left on the stack. If the value is true, nothing is done; otherwise the parameter is output as a decimal.

%? %{1} %p1 %= %t %e %p1 %d %;

The following sequence exhibits a simple "either-or" condition that is sometimes used to toggle an attribute on or off. It outputs ESC (if the parameter is non-zero, and ESC) otherwise:

ESC %t ( %e ) %;	
Repeat Command
%# (... %)

Performs the same action for several parameters. It is used with automatic parameter sequencing, and is almost useless if explicit parameter pushes are used. The count is specified after the percent sign. All the commands between %# (and %) are executed the specified number of times. For example, the first outputs three decimals, and the second outputs up to three non-zero parameters:

%3( %d %)

%3( %t %d %; %)

List Command
%l(... %)

Available as an alternative to an if-then-else-if construction, but is seldom needed. It implements a simple select or case conditional. The general format is:

%l(value1: expr1 %; value2: expr2 %; ... %)

The values are single character constants representing the various cases. The expression is executed if the value matches the top of stack. At most one expression is executed (i.e., each case contains a break). If the value is missing, the expression is evaluated as a default. For correct operation, the default case must occur last in the list. The colons do not have a leading percent sign, so no selector can be a colon. The %; after the last element of the list is not required.

The parameter on the stack (automatically pushed, if necessary) is popped and tested against the various cases. The parameter index is incremented by one after the entire list is processed, even if the expressions use parameters. The following sequence outputs nothing if the parameter is 0; ESC if it is 1; FS otherwise: %l( 0:%; 1:ESC%; :FS %)

Padding

Certain terminals (or tty drivers) require extra time to execute instructions. Some terminal documentation specifies the delay required for each command. If random characters appear on the screen, particularly characters that are part of command sequences, time delays may be required. Delays can be introduced in two ways:

%#w

Causes a wait (sleep) for the specified number of seconds. This command is usually only required in terminal initialization or reset sequences. A hard reset of a terminal sometimes requires a sleep of one or two seconds. The following sequence causes a two second sleep after terminal reset: ESC c %2w

%#z

Outputs the specified number of zeros. This command is occasionally needed on the erase display or erase line commands and very rarely in the cursor positioning sequence. The number of zeros to send may range from about five, for very short delays, to several thousand for longer delays. Usually 100 or so is adequate. The following sequence specifies 100 pad zeros after clearing the screen: ESC [ J %100z

termcap indicates padding by using a number at the beginning of a sequence, which is the number of milliseconds of pad required.

terminfo uses the syntax $<#>.

It is easy to convert to the %#z notation, because at 9600 baud, one character takes one millisecond to output.


Creating and Modifying a Video File

If none of the distributed video files is suitable for your terminal type, you can create one with one of these methods:

After you have a video file that displays Panther correctly on your terminal, you can enhance it to provide greater functionality.

Modifying an Existing Video File

It is easiest to create a video file by basing it on an existing one that you modify:

  1. Identify the desired video file by setting the SMTERM variable in your environment to the mnemonic (for example, SMTERM = vt100) for the selected video file. (Or leave it unset and type the name in when prodev prompts you for it.)
  2. Execute prodev and retrieve an existing screen or try creating one.
  3. Check a few basic functions: Does the screen clear? Are characters positioned properly (or even close)?

    If things seem to work closely to the way you would expect them to—you probably have a good, modifiable video file.

  4. If the video file works well, but the keys are not translating properly, modify the key translation file or create a new one that is compatible with the video file (refer to Chapter 6).
  5. Make a copy of the best working video file you found; name it testvid.
  6. Edit the ASCII video file using any text editor. Comment out or delete all lines except for the ED (erase display) entry and CUP (cursor position) entry.
  7. Convert the ASCII file to binary format using vid2bin.
  8. Edit the SMVARS source file. Add the following entry after the last SMVIDEO entry:
    SMVIDEO = testvid.bin
  9. Convert the SMVARS source file to binary with var2bin.
  10. Invoke prodev and check the basic functions.

Creating a Video File

The term2vid utility uses your system's termcap/terminfo entry to create a rudimentary video source file. The utility has this syntax:

term2vid [-f] terminalType

-f allows the output to overwrite an existing file; terminalType is the name of the terminal type, the value of the system TERM variable.

The ASCII output file is named after terminalType. If necessary, modify the source to include features not listed in the source termcap/terminfo. After you edit the source, convert it to binary format with vid2bin and test it.

Enhancing a Basic Video File

After you have a basic working video file, you can enhance it to provide greater functionality. Incrementally add and test various features until you have a fully operational video file. The easiest way to add the recommended sequences is to copy them from an existing video file or, if available, from your terminal's documentation. The following features are commonly added:


Video File Keywords

Table 7-4 includes a list of all video file entry keywords, arranged by function. Detailed information on each keyword is available on the indicated pages. Refer to the sample video file for syntax examples.

Table 7-4 Video file keywords

Keyword Description
Basic Capabilities

BOTTOMRT

Last position of screen may be written without scrolling the display

BUFSIZ

Number of characters to accumulate before flushing

COLMS

Number of columns on screen

INIT

Initialization sequence

KBD_DELAY

Timing interval for keyboard input

LINES

Number of lines on screen

REPMAX

Maximum number of repeated characters

REPT

Repeat the following character sequence

RESET

Undo initialization sequence

Screen and Line Erasure

ED

Erase entire display

EL

Erase to end of current line

EW

Erase window

Cursor Position

CMFLGS

Allowed cursor-motion shortcuts

CUB

Cursor backward

CUD

Cursor down

CUF

Cursor forward

CUP

Absolute cursor position

CUU

Cursor up

Cursor Appearance

COF

Turn cursor off

CON

Turn cursor on

INSOFF

Overstrike-mode cursor

INSON

Insert-mode cursor

RCP

Restore cursor position and attribute

SCP

Save cursor position and attribute

Display Attributes

AREAATT

List of available area attributes

ARGR

Remove area attribute

ASGR

Set graphics rendition (area)

COLOR

List of colors

EMPHASIS_KEEPATT

Specify attributes retained for grayed objects

EMPHASIS_SETATT

Set attributes for grayed objects

LATCHATT

List of available latch attributes

SGR

Set graphics rendition (latch)

SPXATT

List of attributes that do not affect space

Status Line

CMSG

Close status line

MSGATT

Status line attributes

OMSG

Open status line

Graphics and International Character Support

GRAPH

Graphics character equivalents

GRTYPE

Shortcut for defining graphics characters

MODE0

Normal character set sequence

MODE1

Locking shift to alternate character set 1

MODE2

Locking shift to alternate character set 2

MODE3

Locking shift to alternate character set 3

MODE4

Non-locking shift to alternate character set 1

MODE5

Non-locking shift to alternate character set 2

MODE6

Non-locking shift to alternate character set 3

Borders and Line Drawing

BORDER

Characters that make up the 10 border styles

BOX

Characters that make up the styles for box and line drawing

BRDATT

Available border attributes

Indicators

ARROWS

Indicator characters for shifting and scrolling

BELL

"Visible bell" alarm sequence

CBDSEL

Deselection character for groups

CBSEL

Selection character for groups

MARKCHAR

Character used for check menu items

OPTMNUIND

Character used as an option menu indicator

SUBMNSTRING

String on menu item indicating presence of submenu

Drivers

BLKDRVR

Name of block mode driver

MOUSEDRIVER

Name of mouse driver

Miscellaneous

COMPRESS

Output data compression for Jterm

CURPOS

Display the current cursor position on the status line

Basic Capabilities

BOTTOMRT
A flag indicating that the bottom right-hand corner of the display can be written to without causing the display to scroll. If this flag is not present, Panther does not write to that position.

BUFSIZ
Sets the size of the output buffer used by Panther. If it is omitted, Panther calculates a reasonable default size. Include this entry only if special circumstances warrant. For example, if you make extensive use of a screen-oriented debugger, you can set BUFSIZ to a large value; that effectively disables the delayed-write feature, which can interfere with debugging.

COLMS
Indicates the number of columns on the display. The default value is 80. In some windowing environments (for example, Sun workstations) the values of LINES and COLMS are overridden by the number of lines and columns in the active window.

INIT
Terminal initialization sequence, output by the library function sm_initcrt. There is no default; and the keyword can be omitted. INIT is typically used to change the mode of the terminal, to map function keys, select attribute styles, and so on. Padding is sometimes required, either with %#z or %#w.
# map 2 function keys, then wait 2 seconds
INIT = %S( "/etc/keyset f1 ^a P ^m" %) \
%S( "/etc/keyset f2 ^a Q ^m" %) \
%2w
# load alternate character sets
INIT = ESC)F ESC*| ESC+}

Specifying Cursor Style
On ASCII terminals, you can use escape sequences for specifying the cursor style in the INIT and RESET strings in the normal fashion. The format is
INIT = C n1, n2[, n3, flag]
RESET = C n1, n2[, n3]
n1 and n2 specify the top and bottom scan lines respectively for the cursor block; with line 0 at the top. (A scan line is the smallest vertical unit on your display—one pixel wide). The optional n3 specifies the blink rate, as follows:

1

no cursor

2

fast blink (the default)

3

slow blink

0

fast blink (Not always valid on non-IBM systems)

The standard sequences for a blinking block cursor are

For a monochrome monitor:

INIT = C 0, 13, 0

For a CGA monitor:

INIT = C 0, 7, 0

For a EGA monitor:

INIT = C 0, 13, 2

KBD_DELAY
Assigns a timing interval to keyboard input. A positive integer between 1 and 10 represents an interval in tenths of a second. A negative integer or 0 represents an interval of indefinitely great length.

If you use key sequences that are lead-ins of other sequences, you must assign a timing interval via KBD_DELAY to determine when a key sequence ends.

LINES
Indicates the number of lines on the display. The default value is 24. In general one line is reserved for status and error messages so the maximum screen size is usually one less than the number specified here. (Refer to OMSG and CMSG for exceptions.)

REPMAX
Indicates the maximum number of characters REPT can repeat. To determine the proper value of REPMAX, omit the entry from the video file; then using prodev, create a field that extends the entire width of the screen. Once you choose XMIT, if the entire field has the underline attribute, you do not need the REPMAX entry. If the field is not underlined, gradually shorten the field until the underlines fill the field. The resulting number determines the largest possible value of REPMAX.

REPT
A repeat-character sequence that is passed two parameters: the character to be repeated and the number of times to display it. There is no default, because most terminals do not support character repeat. If it is available on your terminal, include the REPT entry. The repeat sequence is used whenever possible, usually for borders and for clearing areas of the screen. If borders do not appear correctly, your sequence could be incorrect. A repeat sequence is not used to repeat a control character, and it never extends to more than one line.

For example, the following entry outputs the character, then ESC F and the count with 0x3f (the ASCII value of '?') added:

REPT= %c ESC F %+ ?
The next entry sets the maximum count for the preceding REPT entry. Anything over this count splits into more sequences.
REPMAX= 64

RESET
A reset-terminal sequence, output by the library function sm_resetcrt. There is no default. The RESET sequence should be set to undo the effects of INIT. For many terminals a hard reset that resets the terminal to the state stored in non-volatile memory is appropriate.

Screen and Line Erasure

ED
Provides the control sequence that erases the display. This entry is required and clears all available display attributes, including background color. You can find the correct command in your terminal manual or in termcap as cl. Some terminals require padding after this command. The following example is common for ANSI terminals
ED = ESC [ J

EL
Provides a sequence that erases characters and attributes from the cursor to the end of the line. If EL is not in the video file, Panther erases the line by writing blanks. You can find the sequence in termcap as ce. Some terminals require padding after this command. The first example is common for ANSI terminals; the second illustrates a padded entry:
EL = ESC [ K
EL = ESC [ 0 K %100z

EW
Provides a sequence that erases a rectangular region on the screen, to a given background color if available. Five parameters are passed: start line, start column, number of lines, number of columns, and background color. (If color is not available, the fifth parameter is ignored.)

Cursor Position

CMFLGS
Lists shortcuts Panther uses for cursor positioning:

CR

Carriage return (0x0d, or ^M) moves the cursor to the first column of the current line.

LF

Linefeed (0x0a, or ^J) moves the cursor down one line in the same column.

BS

Backspace (0x08, or ^H) moves the cursor one position to the left with out erasing anything.

AM

Automatic margin: the cursor automatically wraps to the first column when it reaches the right-hand edge of the display.

Note: The AM setting of CMFLGS must match the auto-wrap setting of the terminal. If the setting is not correct, the terminal display may be irregular. Consider using INIT and RESET to turn terminal auto-wrap on and off as desired.

Most terminals are capable of the first three. The fourth can frequently be found in termcap as am. It cannot be used on terminals with the xen1 glitch (i.e., VT100-style delayed auto margin).

CUB
Moves the cursor backward in the same row. Takes the number of columns to move as a parameter. Do not specify this keyword if the sequence can only move the cursor one column at a time. The following entry moves the cursor back:
CUB = ESC [ %d D

CUD
Moves the cursor down in the same column. Takes the number of lines to move as a parameter. Do not specify this keyword if the sequence can only move the cursor one line at a time. The following entry moves the cursor down:
CUD = ESC [ %d B

CUF
Moves the cursor forward in the same row. Takes the number of columns to move as a parameter. Do not specify this keyword if the sequence can only move the cursor one column at a time. The following entry moves the cursor forward:
CUF = ESC [ % C

CUU
Moves the cursor up in the same column. Takes the number of lines to move as a parameter. Do not specify this keyword if the sequence can only move the cursor one line at a time. The following entry moves the cursor up:
CUU = ESC [ %d A		

CUP
Establishes absolute cursor position which is required to run character-mode Panther. This sequence appears in termcap as cm. It takes two parameters: the target line and the target column, in that order and relative to 0. %i (increment) is used to convert them to be relative to one. ANSI terminals need the line and column as decimals. Other terminals add a fixed value to the line and column to make them printable characters; %+ is used. The following example is for an ANSI terminal:
CUP = ESC [ %i %d;%d H
Another common scheme is to output the line and column as characters, after adding SP. The entry might look like the following example:
CUP = FS C %+SP %+SP

Cursor Appearance

COF
Turns the cursor off. If possible, both COF and CON should be specified. Menus (using a block cursor) look better with the regular cursor off. Also Panther often must move the cursor around the screen to put text in fields, to scroll arrays, and so on. If the cursor is off during these operations, the user is not disturbed by its flickering all over the screen.

CON
Turns the cursor on in the desired style. A blinking block cursor is recommended because an underline cursor is difficult to see in an underlined field.

Note: You can use the INIT and RESET sequences to switch between the cursor style used in Panther applications and that used on the command line.

Many terminals have no ability to turn the cursor on and off. Although Panther attempts to minimize cursor movement, some flickering is unavoidable.

CON and COF can sometimes be found in the terminal manual as cursor attributes and in termcap as CO and CF. The following entries are an example of a pair of COF and CON sequences for some ANSI terminals:

CON = ESC [>5l
COF = ESC [>5h

INSOFF and INSON
INSOFF and INSON, change the cursor style so that you can easily see which mode you are in: insert or overstrike. By convention, the insert cursor is about one-half the size of the regular, overstrike cursor. INSOFF or INSON is issued to the terminal when you toggle Panther's data entry mode using the INSERT key. On many terminals, changing the cursor style also turns it on; in this case, the INSOFF is the same as COF, so you can omit it altogether. If the cursor style can be changed without turning it on or off, use both INSON and INSOFF. Uses the same escape sequence format as INIT and RESET.

RCP and SCP
Saves (SCP) and restores (RCP) cursor position and attribute.

Display Attributes

Panther supports highlight, blink, underline and reverse video attributes. If either highlight or blink is not available, low intensity is supported in its place. An additional attribute, standout, can be assigned to any other desired attribute—for example dim or italics, if available. The display attribute keywords AREAATT and LATCHATT are used to list the attributes available in each style and associate a character with each attribute.

Attribute Types

Panther supports three different kinds of attribute handling.

You can set several modes on your terminal. Many terminals support both area and onscreen attributes. If so, you should select area ("non-embedded" or "no space") rather than onscreen ("embedded" or "spacing") attributes. Some terminals support one latch attribute and several area attributes simultaneously.

If your terminal has only one attribute style available, it is recommended that you select reverse video. Panther supports non-display in software, so you can omit that attribute. Underlines are simulated (by writing an underscore character) if that attribute is not available.

You can find attribute information in your terminal's documentation or, perhaps, in your termcap database (if applicable). The codes so, ul and bl specify standout (usually reverse video), underline, and bold respectively. The codes se, ue and be specify the sequence to end the attributes. The standard ANSI sequences are:

so=\E[7m:se=\E[0m:ul=\E[4m:ue=\E[0m:bl=\E[1m:be=\E[0m

If you find something like these, ANSI latch attributes are available. If you find entries ug#1:sg#1, onscreen attributes are available.

AREAATT
Lists the area or onscreen attributes that are available, and associates a character with each. The possible attributes are:

ACS

Alternate character set (line drawing graphics)

BLINK

Blink or other standout

DIM

Dim (low intensity)

HILIGHT

Highlight (bold)

REVERSE

Reverse (or inverse) video

STANDOUT

User selected standout mode

UNDERLN

Underline

In addition, flags are available that specify how the attributes are implemented by the terminal. The flags are:

LINEWRAP

The attribute wraps from line to line

ONSCREEN

The attribute uses a screen position

REWRITE

Must rewrite attribute when writing character

SCREENWRAP

The attribute wraps from bottom of screen to top

Area and onscreen attributes modify all characters from the start attribute to the next attribute or to an \Qend', whichever is closer. (An \Qend' is either the end of the screen or the end of the line.) If there is no \Qend', use SCREENWRAP. If the end is the end of screen, use LINEWRAP. If end is the end of the line, omit both wrap flags. Some terminals allow you to select the style. For onscreen attributes, SCREENWRAP is best and LINEWRAP a good second; for area attributes the choices are about the same. If the attribute takes up a screen position, use the ONSCREEN flag.

AREAATT= BLINK= 2 DIM= p REVERSE= 4 UNDERLN= 8 \
ONSCREEN LINEWRAP
ASGR = ESC G %u %'0' %5( %| %) %c

On some terminals writing a character at the position where an attribute was set can remove the attribute. Immediately after placing the attribute, the character may be written with no problems; however, the next time a character is written there, the attribute disappears. In this case, use the REWRITE flag to reset the attribute before writing to that position. The following example illustrates how the REWRITE flag is used (in Televideo 925 video file):

AREAATT = REVERSE = 4 UNDERLN = 8 BLINK = 2 REWRITE
ASGR = ESC G %'0' %9( %| %) %c

Some terminals restrict the number of attributes, use an ARGR entry to remove attributes.

ARGR
Removes area attributes. Some terminals restrict the number of attributes (as set with ASGR) that are available on a given line. If possible, use an ARGR entry. Changing an attribute to normal does not remove it; a normal attribute stops the propagation of a previous attribute only. The following example illustrates how the ARGR entry might appear in your video file:
AREAATT = REVERSE = Q UNDERLN = \Q 
ASGR = ESC d %u %'@' %5( %| %) %c
ARGR = ESC e
Panther uses the ARGR entry to remove repeated attributes, to avoid exceeding the maximum number of attributes on a line. If there is no maximum, the remove attribute sequence can be omitted; it sometimes makes the screen "wiggle."

If the maximum number of attributes is small, Panther's performance can be limited. ARGR is desirable because having many attributes onscreen can dramatically slow performance, because Panther must keep rewriting them as attributes change.

ASGR
An area set graphics rendition sequence, used in conjunction with AREAATT, is passed twelve parameters. The first nine are the same as used by terminfo. The parameters, in order, represent:

1

standout

2

underline

3

reverse video

4

blink

5

dim (low intensity)

6

highlight (bold)

7

blank

8

protect not used, always 0

9

alternate character

10

foreground color (if available)

11

background color (if available)

12

background highlight

If an attribute is desired, the parameter passed is the character associated with the attribute, as explained in the description of SGR. If the attribute is not desired, the parameter passed is (binary) 0.

If no attributes are specified in the video file, Panther supports only two attributes: non-display (done in software anyway) and underline (using the underscore character).

COLOR
Used to associate a character with each color, just as LATCHATT associates a character with each attribute. Panther supports eight foreground and background colors. The CTYPE entry has flags that tell Panther what background color is available. You only need to specify the three primary colors in the video file. If other colors are not specified, they are generated according to the following rules:

BLACK =

RED & GREEN & BLUE

BLUE

Must be specified

GREEN

Must be specified

CYAN =

GREEN | BLUE

RED

Must be specified

MAGENTA =

RED | BLUE

YELLOW =

RED | GREEN

WHITE =

RED | GREEN | BLUE

The tenth parameter to SGR or ASGR is the character representing the foreground color; the eleventh represents the background color (it is 0 if background color is not available). Many ANSI terminals set foreground color with the following sequence: ESC [ 3x m – where x ranges from 0 for black to 7 for white. Background color is often set with ESC [4x m. The order of the colors varies from terminal to terminal.

On color terminals, REVERSE often means black on white. If background color is available, Panther prefers that REVERSE is not specified in the video file. It uses the specified color as the background, and either black or white as the foreground. The following example is suitable for a color ANSI terminal:

LATCHATT = HILIGHT = 1 BLINK = 5 
COLOR = RED = 4 GREEN = 2 BLUE = 1 BACKGRND
SGR = %3u ESC [ 0 %3( %?%t ; %c %; %) ; %3u 3%c ; 4%c m

If the terminal has a unique sequence for each color, a list command works well. In the following example, the ANSI attribute sequence ESC [ 0 ; p1 ; p2 ; ... m) is used:

LATCHATT = REVERSE = 7 HILIGHT = 2 
COLOR = CYAN = 0 MAGENTA = 1 BLUE = 2 YELLOW =3 \
GREEN = 4 RED = 5 BLACK = 6 WHITE = 7
SGR = ESC [ 0 %p3%t;7%; %p6%t;2%; \
%l( 0:;>1%; 1:;5%; 2:;5;>1%; 3:;4%; \
4:;4;>1%; 5:;4;5%; 6:;4;5;>1 %) m

The values for the colors are:

cyan     >1 
magenta 5
blue 5 ; > 1
yellow 4
green 4 ; > 1
red 4 ; 5
black 4 ; 5 ; > 1

Some terminals use ESC [ 2 ; x ; y m to set color and other attributes—x is the foreground color and y is the background color; both numbers range from 0 to 7. If highlight is desired in the foreground, 8 should be added to x. If blink is desired, 8 should be added to y. The following video entries satisfy these requirements:

LATCHATT = HILIGHT = 8 BLINK = 8 
COLOR = RED = 4 GREEN = 2 BLUE = 1 BACKGRND
SGR = ESC [ 2 ; %p10 %p6 %+ %d ; %p11 %p4 %+ %d m

EMPHASIS_KEEPATT
Use this entry to specify the attributes to be retained when implementing drop shadows and grayed objects. By default, all attributes are enabled except HILIGHT. This variable is used in conjunction with the EMPHASIS setup variable. You can change this setting at runtime with the library function sm_pset. Refer to Table 2-1 for a list of display attribute keywords.

EMPHASIS_SETATT
Use this entry to specify the attributes to apply when implementing drop shadows and grayed objects. By default, this variable has two attributes enabled: REVERSE and DIM. This variable is used in conjunction with the EMPHASIS setup variable. You can change attributes at runtime with the library function sm_pset. Refer to Table 2-1 for a list of display attribute keywords.

LATCHATT
Lists the available attributes, and associates a character with each. The possible attributes are:

ACS

Alternate character set (line drawing graphics)

B_HIGLIGHT

Background highlight

BLANK

Non-display (foreground not shown)

BLINK

Blink or other standout

DIM

Dim (low intensity)

HILIGHT

Highlight (bold)

REVERSE

Reverse (or inverse) video

STANDOUT

User selected standout mode

UNDERLN

Underline

The format is:
LATCHATT = attribute = value attribute = value ...

So a typical LATCHATT might look like:

LATCHATT = HILIGHT = 1 BLINK = 5 UNDERLN = 4 REVERSE = 7

If the equal sign and value are missing, the attribute is given the value (binary) 1.

Most ANSI terminals use latch attributes, and the codes are fairly standardized. To determine which attributes are supported and how attributes can be combined, if at all, examine the SGR entry that usually follows the LATCHATT entry. Some ANSI terminals support color, either foreground only or foreground and background. The sequences for color are far less standard.

Terminal manuals often describe the sequence as "set graphics rendition." A common description reads:

ESC [ p1 ; p2 ; ... m

where p n=

0 for normal

1 for bold

5 for blink

Thus ESC [ 0 m is normal, ESC [ 1 m is bold, ESC [ 1 ;5 m is bold and blinking. Often, setting an attribute does not remove others, so it is best to reset to normal first, using ESC [0; 1 m for bold, ESC[0;1;5m for blinking bold, and so on. The coding in the video file is as follows:

LATCHATT = HILIGHT = 1 BLINK = 5 UNDERLN = 4 REVERSE = 7 
SGR = ESC [ 0 %9(%t ; %c %; %) m

The meaning of the above SGR sequence is as follows. The sequence is passed 11 parameters, each 0 (if the attribute is not to be set) or the character in the LATCHATT list. First, ESC [ 0 is output. The %t test, repeated 9 times, causes the zero parameters to be skipped. A non-zero parameter causes a semicolon and the parameter to be output. Finally, the character m is output. If the normal attribute is wanted, all parameters are 0, and the output sequence is ESC [ 0 m. For underline SGR is ESC [ 0 ; 4 m. If highlighted, blinking, and reverse video are desired, the output is

ESC [ 0; 7 ; 5 ;1 m.

Unable to combine attributes

Some terminals (or emulators) do not accept the method of combining attributes used above. In that case, one sequence followed by the next might work—for example, ESC [ 1 m ESC [ 7m. Some terminals cannot combine attributes at all. Here are some more ANSI and near-ANSI examples:

Standard ANSI terminal

LATCHATT= HILIGHT=1 BLINK=5 UNDERLN=4 REVERSE=7

ANSI with low intensity but no highlight

LATCHATT= DIM=2 REVERSE=7 UNDERLN=4 BLINK=5

Only one attribute available:

LATCHATT= REVERSE=7

Repeat of above SGR example

SGR = ESC [ 0 %9(%t ; %c %; %) m

Attributes cannot be combined

SGR = ESC [ 0 m %9(%t  ESC [ %c m %; %)

Skip parameters that are always 0

SGR = %u ESC [ 0 %5(%t ; %c %; %) m

In the next LATCHATT/SGR example explicit pushes are used to select the appropriate parameter. The second pair is the same as the first, but the attribute is treated as a boolean. The first uses the optional %?, the second omits it.

LATCHATT = DIM = 2 
SGR = ESC [ m %? %p5 %t ESC [ 2 m %;
LATCHATT = DIM 
SGR = ESC [ m %t ESC [ 2 m %;

The following is suitable for terminals that support all attributes but cannot combine them. It selects one attribute giving preference to REVERSE, UNDERLN, BLINK, and HILIGHT in that order. It uses a complicated "if-then-elseif-elseif-elseif" structure. Automatic parameter sequencing cannot be relied on, so explicit parameter pushes are used.

LATCHATT = HILIGHT BLINK UNDERLN REVERSE 
SGR = ESC [ %p3 %t 7 %e %p2 %t 4 %e %p4 %t 5 %e \
%p6 %t 1 %; %; %; %; m

Bit-mapped attributes

Some terminals use bit-mapped attributes. Terminal manuals are not usually explicit on this. Often they use tables like that described in Table 7-5.

Table 7-5 Bit-mapped attributes

n Visual attribute n Visual attribute

0

normal

8

underline

1

invisible

9

invisible underline

2

blink

:

underline and blink

3

invisible blink

;

invisible underline and blink

4

reverse video

<

reverse and underline

5

invisible reverse

=

invisible reverse and underline

6

reverse and blink

>

reverse, underline and blink

7

invisible reverse and blink

?

invisible reverse, underline and blink

After poring over the ASCII table for a while, it becomes clear that this is bit-mapped, with the four high-order bits constant (0x30) and the four low-order bits varying, like this:

This can be coded in the video file as follows. The attributes are OR-ed with a starting value of '0' (0x30).

LATCHATT = BLINK = 2 REVERSE = 4 UNDERLN = 8
SGR = ESC G %'0' %9( %| %) %c

For Videotex terminal

Following are examples of LATCHATT entries that can be used with a Videotex terminal. The LATCHATT entries, when used with the SGR entry, have equivalent equivalent results. The bits are OR-ed together with a starting value of 0x40, or @, and the result is output as a character.

LATCHATT= UNDERLN=DLE BLINK=STX REVERSE=EOT HILIGHT=SP
LATCHATT= UNDERLN= ^P BLINK= ^B REVERSE= ^D HILIGHT= SP
LATCHATT= UNDERLN= 0x10 BLINK= 0x02 REVERSE= 0x04 \
HILIGHT= 0x20
LATCHATT= UNDERLN= P BLINK= B REVERSE= D HILIGHT= \Q
SGR = FS G %'@' %9( %| %) %c

Protected modes

Some terminals that use area attributes support a single latch attribute. It is often called "protected" and is used to indicate protected areas when the terminal is operated in block mode. The following example switches between protected and unprotected modes in order to use low intensity. (Be aware that a terminal might become very slow when using the protect feature.) The SGR sequence depends only on the attribute being non-zero, so no value is necessary:

LATCHATT = DIM
SGR = ESC %?%t ) %e ( %;

SGR
A set graphics rendition sequence, in conjunction with the LATCHATT sequence, is passed twelve parameters.

1

standout

2

underline

3

reverse video

4

blink

5

dim (low intensity)

6

highlight (bold)

7

blank

8

protect not used, always 0

9

alternate character

10

foreground color (if available)

11

background color (if available)

12

background highlight

If an attribute is desired, the parameter passed is the character associated with the attribute, as explained below. If the attribute is not desired, the parameter passed is (binary) 0.

For example, a video file might contain this entry:

LATCHATT = REVERSE = 7 HILIGHT = 1 BLINK = 5 UNDERLN = 4 

If a field is to be highlighted and underlined, the SGR sequence is passed (0, '4', 0, 0, 0, '1', 0, 0, 0). The second and sixth parameters represent underline and highlight; they are set to the corresponding values in the LATCHATT entry. The rest are zero. To make the field reverse video and blinking, SGR is passed (0, 0, '7', '5', 0, 0, 0, 0, 0) .

If no attributes are specified in the video file, Panther supports only two attributes: non-display (done in software anyway) and underline (using the underscore character).

SPXATT
Lists attributes which do not change or affect the appearance of a character cell containing a space, for example:
SPXATT = BOLD DIM BLANK BLINK COLOR

For efficiency, this entry reduces the number of characters sent to a screen. It defaults to COLOR BLANK HILIGHT DIM. To turn it off entirely, use:

SPXATT =

Status Line

Panther usually uses a line from the screen to display status text and error messages. Thus a 25-line screen (as specified in the LINES keyword) has 24 lines for the screen, and one for messages. This use of a normal screen line for messages is the default.

Terminals that use a separate status line can use different attributes on the status line than on the screen itself. Panther provides some support for this ability; for very complicated status lines, you must write a routine and install it with sm_install using the STAT_FUNC function type. For more information on installing a status line function, refer to "Status Line Function" on page 44-45 in Application Development Guide.

OMSG and CMSG
Opens and closes the status line. Use the OMSG entry to open the status line, and CMSG to close it. These entries are used primarily for those terminals that have a special status line that cannot be addressed by normal cursor positioning. All text between these sequences appears on the status line. No assumption is made about clearing the line; Panther always writes blanks to the end of the line.
OMSG = ESC f
CMSG = CR ESC g

If the OMSG entry is present in your video file, Panther uses all the lines specified in the LINES entry for screens.

MSGATT
Lists the attributes available on the status line. This keyword takes a list of flags:

AREAATT

All area attributes can be used

BLINK

Blink available

DIM

Dim (low intensity) available

HILIGHT

Highlight (bold) available

LATCHATT

All latch attributes can be used

NONE

No attributes on status line

ONSCREEN

Area attributes take a screen position

REVERSE

Reverse video available

UNDERLN

Underline available

The attribute for the status line is specified as either a latch (LATCHATT) or area (AREAATT) attribute, and the sequence to set it must is given in the SGR or ASGR keyword. For example, if REVERSE is listed in MSGATT and REVERSE is a latch attribute, then SGR sets it. Attributes that appear in MSGATT and do not appear in either LATCHATT or AREAATT are ignored.

In order for Panther to determine the correct length of a line, it is important to know whether area attributes are onscreen or not. It is not uncommon for area attributes to be non-embedded on the screen but embedded on the status line. Use the ONSCREEN flag in MSGATT to inform Panther of this condition.

LATCHATT = DIM
AREAATT = REVERSE UNDERLN BLINK
MSGATT = REVERSE UNDERLN BLINK ONSCREEN
MSGATT = AREAATT ONSCREEN

The two MSGATT entries are equivalent. They show a case where only area attributes are available on the status line and they take a screen position. The area attributes in the normal screen area do not.

Graphics and International Character Support

Panther has support for eight-bit ASCII codes as well as any graphics that the terminal can support in text mode. Bitmapped graphics are not supported.

GRAPH
Maps internal numbers to output sequences, similar to the key translation files which provide mapping from character sequences to internal numbers. The only character value that can not be sent is 0.

Some terminals have a special compose key, active in eight-bit mode. Generally, you would press the compose key followed by one or two more keys, generating a character in the range 0xa0 to 0xff. Panther can process such characters as normal display characters, with no special treatment in the video file.

Other terminals have special keys that produce sequences representing special characters. The key translation file can be used to map such sequences to single values in the range 0xa0 to 0xfe. (Refer to the Developer's Guide for a way to use values outside that range.) The video file can then specify how these values are output to the terminal.

Often, to display graphics characters, a terminal must be told to "shift" to an alternate character set (in reality, to address a different character ROM). The video file's GRAPH entries tell which alternate set to use for each graphics character, and how to shift to it. Whenever Panther is required to display a character, it looks in the GRAPH table for that character (refer to the description on MODE0 through MODE6 for information on what happens). If it is not there, the character is sent to the terminal unchanged.

GRTYPE
Provides a convenient shortcut for certain common graphics sets, each denoted by another keyword. The GRTYPE keywords can be combined. The format is:
GRTYPE = [GRTYPE] keyword... 

The GRTYPE keyword can be any of the following:

ALL

0xa0 through 0xfe

EXTENDED

same as ALL

PC

0x01 through 0x1f and 0x80 through 0xff

CONTROL

0x01 through 0x1f, and 0x7f

C1

0x80 through 0x9f, plus 0xff

An entry in the GRAPH table is made for each character in the indicated range, with mode 0. If the mode is not 0, you must construct the GRAPH table by hand.

MODE0 through MODE6
Panther supports up to three alternate character sets. The sequences that switch among character sets are listed below.

MODES0 through MODE3 are locking shifts. All characters following are shifted, until a different shift sequence is sent.

MODES4 through MODE6 are non-locking or single shifts, which apply only to the next character.

You may need to use the INIT entry to load the character sets you want for access by the mode changes.

MODE0

switch to standard character set

MODE1

alternate set 1

MODE2

alternate set 2

MODE3

alternate set 3

MODE4

...

MODE5

MODE6

Different modes can be used to support foreign characters, currency symbols, graphics, and so on. Panther makes no assumption as to whether the mode changing sequences latch to the alternate character set or not. To output a character in alternate set 2, Panther first outputs the sequence defined by MODE2, then a character, and finally the sequence defined by MODE0 (which may be empty, if the others are all non-locking). Here are three examples:

MODE0 = SI
MODE1 = SO
MODE2 = ESC n
MODE3 = ESC o

Sample of ANSI standard

MODE0 = ESC [ 10 m
MODE1 = ESC [ 11 m
MODE2 = ESC [ 12 m
MODE3 = ESC [ 13 m
MODE0 =
MODE1 = SS1
MODE2 = SS2

Any of the MODEn strings may also contain a list of attributes. When a character in that mode is displayed, that attribute is added to whatever attribute is already in effect. On some terminals, like the HP, only an attribute is required. For example:

MODE4 = ACS

This forces all mode 4 characters to be displayed using the alternate character set.

Any character in the range 0x01 to 0xff can be mapped to an alternate character set by use of the keyword GRAPH. The value of GRAPH is a list of equations. The left side of each equation is the character to be mapped; the right side is the number of the character set (0, 1, 2, 3), followed by the character to be output. Any character not so mapped is output as itself. For example, suppose that 0x90 =1 d appears in the GRAPH list. First the sequence listed for MODE1 is sent, then the letter d, and then the sequence listed for MODE0.

In the following example, 0x81 is output as SO / SI, 0xb2 as SO 2 SI, and 0x82 as ESC o a SI. LF, BEL and CR are output as a space, and all other characters are output without change. This output processing applies to all data coming from Panther. No translation is made for direct calls to printf, putchar, and so on. Thus \n and \r will still work correctly in printf, and putchar (BEL) still rings the terminal bell.

MODE0 = SI
MODE1 = SO
MODE2 = ESC
nMODE3 = ESC o
GRAPH = 0x81 = 1 / 0xb2 = 1 2 0x82 = 3 a LF = 0 SP\
BEL = 0 SP CR = 0 SP

Recommendations

For efficiency, use single shifts to obtain accented letters, currency symbols, and other characters that appear mixed in with unshifted characters. Graphics characters, especially for borders, are good candidates for a locking shift.

It is possible, though not recommended, to map the usual display characters to alternates. For example, GRAPH = y = 0 z causes the y key to display as z. Graphics characters are non-portable across different displays, unless care is taken to ensure that the same characters are used on the left-hand side for similar graphics, and only for a common subset of the different graphics available.

Borders and Line Drawing

The characters constituting the border and line drawing styles can be specified in the video file.

BORDER
Specifies alternate borders. If fewer than 10 are given, the default borders (listed below) are used to complete the set. They are numbered 0 to 9. When you create screens with the screen editor, you can select from these border styles. The BORDER entry is portable across different platforms because Panther saves a border as a style number in the screen file. Style 1 is the default.

Border Styles

0.                                         1.
IIIII _____
I I | |
IIIII _____
2.                                         3.
+++++ =====
+ + | |
+++++ =====
4.                                         5.
%%%%% .....
% % : :
%%%%% .....
6.                                         7.
***** \\\\\
* * \ \
***** \\\\\
8.                                         9.
///// #####
/ / # #
///// #####

The data for BORDER is a list of 8 characters per border, in the order: upper left corner, top, upper right corner, left side, right side, lower left corner, bottom, lower right corner. The default border set is:

BORDER =   SP  SP  SP  SP  SP  SP  SP  SP  \
SP _ SP | | | _ | \
+ + + + + + + + \
SP = SP | | SP = SP \
% % % % % % % % \
. . . : : : . : \
* * * * * * * * \
\ \ \ \ \ \ \ \ \
/ / / / / / / / \
# # # # # # # #

In addition, attributes can be specified for each set of border characters. For example:

BORDER = SP  SP  ...  SP  REVERSE \
; A ... + ACS \

If there is a GRAPH entry in the video file, you can use the graphics character set of the terminal for borders. Choose some numbers to represent the various border parts. The GRAPH option can be used to map these numbers to a graphics character set. The numbers chosen are arbitrary, except that they should not conflict with ordinary display characters. Even if the extended 8-bit character set is used, there are unused values in the ranges 0x01 to 0x1f and 0x80 to 0x9f.

Boxes

BOX
Ten different sets of line draw characters can be specified when you are using the screen editor. The BOX entry lists either five or thirteen characters per set. If only five characters are specified the remaining eight are taken from the corresponding BORDER set.

Although the format in the video file is similar, Panther uses BOX and BORDER differently. While BORDER entries are portable across platforms, Panther saves line drawing as display data. To ensure portability, avoid assigning graphic characters to the BOX keyword. Instead, use characters that are displayable on all terminals.

BRDATT
Use a BRDATT entry to limit the attributes available in the border. Normally HILIGHT (or DIM) and REVERSE are used; however, if your terminal uses onscreen attributes or can accommodate only a few attributes per line, it may be better to prohibit attributes in borders—use the entry BRDATT = NONE.

The flags used in MSGATT can also be used with BRDATT; however, the only attributes available are HILIGHT, DIM, and REVERSE.

Indicators

ARROWS
Used to indicate the presence of offscreen data in shifting/scrolling fields. You can define these indicators to be any characters you wish. The default characters are:
<, >, X for shifting 
^, v, X for scrolling

The character X is used when two shifting/scrolling fields are next to each other; it represents a combination of both < and >.

ARROWS = < > X ^ v X

Shift/scroll indicators are black on screens with background colors of white, yellow, or cyan. They are white on all other screen background colors. You cannot alter indicator colors.

BELL
If present, is transmitted by the library function sm_bel to give a visible alarm. Normally, the function rings the terminal's bell. The BELL sequence can sometimes be found in the termcap file under vb.

CBDSEL and CBSEL
Selection (CBSEL) and deselection (CBDSEL) characters for groups. If there are no entries for CBSEL and CBDSEL in your video file, the internal defaults are X for CBSEL and a blank for CBDSEL. For radio button or checklist widgets, these characters are used to indicate which fields are selected and which are not. You can add these entries to the video file to override the defaults. For example:
CBSEL  =  y
CBDSEL = n

As a result, Panther uses a y to indicate a selected occurrence; NL deselects the occurrence, and Panther inserts an n in the box.

MARKCHAR
Defines the character used to check menu items. The default character is X. For example, the following example specifies the square root symbol (/) as the mark character. This variable is optional for supporting those character-mode applications that use menu bars and is most useful in video files that support reasonable graphical characters.
MARKCHAR = 0xFB

OPTMNUIND
Defines the character used to indicate option menus. The default character is v. This variable is optional for character-mode applications.

SLIDER
Defines the characters used in character-mode scroll bars. Eight characters are defined, where the first set of four characters define the slider characters used in horizontal scroll bars, and the second set contains the slider characters used in vertical scroll bars:
SLIDER = left-arrow right-arrow bar thumb \
up-arrow down-arrow bar thumb

For example, these characters are defined in vt100vid:

SLIDER = < > = # ^ v / #

You can use hex values of graphics characters for those terminals that support them. For example:

SLIDER = 0x11 0x10 0xb0 0xb2 0x1e 0x1f 0xb0 0xb2

SUBMNSTR
Defines the indicator for submenu options. This indicator appears on menu bar options indicating that the item invokes a submenu. The default string is an ellipsis (...). This variable is optional for supporting those character-mode applications that use menu bars and is most useful in video files that support reasonable graphical characters.

Drivers

MOUSEDRIVER
Enables the mouse in Panther applications. Supported mouse types on UNIX are AT, SCO, Jterm, and xterm.

Miscellaneous

COMPRESS
Implements data compression for Jterm users. Use the following entry:
COMPRESS = JTERM

CURPOS
Specifies the time-out delay, in tenths of a second. The CURPOS entry causes the current cursor position to be displayed on the status line at the specified intervals:

CURPOS = 1
Updates display every 0.1 second (use on fast systems)

CURPOS = 3
Updates every 0.3 second (reasonable for most)

CURPOS = 7
Updates every 0.7 second at low baud rates

CURPOS = 0
No display, same as omitting keyword.

When possible, Panther uses non-blocking keyboard reads. If no key is received within a specified time, the cursor position display is updated. This allows fast typists to type at full speed; when the typist pauses, the cursor position display is updated.

The delay depends on the baud rate and your terminal. If there is no non-blocking read, a non-zero value of CURPOS enables the display and zero disables it. If the terminal has its own display, omit CURPOS.


Sample Video File

This sample video file is for a basic ANSI terminal (like a VT100) It contains the basic capabilities, plus control sequences to erase a line and to apply the reverse video, underlined, blinking, and highlighted visual attributes. The entries for CUP and SGR are more complicated because they require additional parameters at runtime.

# Display size (these are actually the default # values)
LINES = 24
COLMS = 80
# Erase whole screen and single line
ED = ESC [ 2 J
EL = ESC [ 0 K
# Position cursor
CUP = ESC [ %i %d ; %d H
# Standard ANSI attributes, four available
LATCHATT = REVERSE = 7 UNDERLN = 4 BLINK = 5 HILIGHT = 1
SGR = ESC [ 0 %u %5(%t ; %c %; %) m