[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

OpenVMS/Hanzi RTL Chinese Screen Management (SMG$) Manual


Previous Contents

Original SMG routines support only ASCII(default) and DEC Special Graphics, but Chinese SMG will allow users to specify the character-set which enables Chinese language to be used.

In case Chinese language character set is used and the start-column is on the right portion of a Chinese character, the character will be changed to undefined characters. Also, if any character is discarded at the end of the line, and the discard begins on the right portion of a Chinese character, the left portion of the character will become an undefined character.


Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_INVARG Unrecognized rendition code.
SMG$_INVCOL Invalid column.
SMG$_INVDIS_ID Invalid display-id.
SMG$_INVROW Invalid row.
SMG$_WILUSERMS Pasteboard is not a video terminal.
SMG$_WRONUMARG Wrong number of arguments.
LIB$_INVSTRDES Invalid string descriptor.

Example



C+
C This DEC Fortran example program demonstrates the use of SMG$INSERT_CHARS.
C-

        IMPLICIT INTEGER (A-Z)
        INCLUDE '($SMGDEF)'

C+
C Use SMG$CREATE_VIRTUAL_DISPLAY to create a virtual display
C with a border.
C-

        ROWS = 7
        COLUMNS = 50

        STATUS = SMG$CREATE_VIRTUAL_DISPLAY
     1          (ROWS, COLUMNS, DISPLAY1, SMG$M_BORDER)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

C+
C Call SMG$CREATE_PASTEBOARD to create the pasteboard.
C-

        STATUS = SMG$CREATE_PASTEBOARD (PASTE1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

C+
C Put data in the virtual display by calling SMG$PUT_CHARS.
C-

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1       ' This virtual display has 7 rows and 50 columns.', 2, 1 )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1       ' This is a bordered virtual display.', 4, 1 )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1       ' SMG$PUT_CHARS puts data in this virtual display.', 6, 1 )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

C+
C Use SMG$PASTE_VIRTUAL_DISPLAY to paste the virtual display.
C-

        STATUS = SMG$PASTE_VIRTUAL_DISPLAY ( DISPLAY1, PASTE1, 4, 15 )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

C+
C Call SMG$INSERT_CHARS to add a row 1 of text, starting at column 6.
C Underline these characters.
C-

        STATUS = SMG$INSERT_CHARS ( DISPLAY1,
     1          'This is a new row.', 1, 6, SMG$M_UNDERLINE )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

C+
C Calling SMG$INSERT_CHARS again, add text to row 6.
C Note that there will be some characters that will no
C longer fit on the line. They will be discarded. The
C new text will be bolded.
C-

        STATUS = SMG$INSERT_CHARS ( DISPLAY1,
     1          'to this bordered display.', 6, 28, SMG$M_BOLD )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        END

      

The output generated by this FORTRAN program before the call to SMG$INSERT_CHARS is shown in Figure SMG-27.

Figure SMG-27 Output Generated by FORTRAN Program Before the Call to SMG$INSERT_CHARS


The output generated by this FORTRAN program after the call to SMG$INSERT_CHARS is shown in Figure SMG-28.

Figure SMG-28 Output Generated by FORTRAN Program After the Call to SMG$INSERT_CHARS



SMG$INSERT_LINE

The Insert Line routine inserts a line into a virtual display and scrolls the display.

Format

SMG$INSERT_LINE display-id ,start-row [,character-string] [,direction] [,rendition-set] [,rendition-complement] [,flags] [,character-set]


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

display-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the virtual display affected. The display-id argument is the address of an unsigned longword that contains the display identifier.

Display-id is returned by SMG$CREATE_VIRTUAL_DISPLAY.

start-row


OpenVMS usage longword_signed
type longword (signed)
access read only
mechanism by reference

Specifies the row number at which the string is inserted and at which scrolling begins. The start-row argument is the address of a signed longword that contains the row number.

character-string


OpenVMS usage char_string
type character string
access read only
mechanism by descriptor

The character string to be inserted by SMG$INSERT_LINE. The character-string argument is the address of a descriptor pointing to this string.

direction


OpenVMS usage longword_unsigned
type longword (unsigned)
access read only
mechanism by reference

Specifies the scrolling direction. The direction argument is the address of an unsigned longword that contains the direction code. Valid values are SMG$M_UP and SMG$M_DOWN. SMG$M_UP is the default.

rendition-set


OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by reference

Attribute specifier. The optional rendition-set argument is the address of a longword bit mask in which each attribute set causes the corresponding attribute to be set in the display. The following attributes can be specified using the rendition-set argument:
SMG$M_BLINK Displays blinking characters.
SMG$M_BOLD Displays characters in higher-than-normal intensity.
SMG$M_REVERSE Displays characters in reverse video, that is, using the opposite of the default rendition of the virtual display.
SMG$M_UNDERLINE Displays underlined characters.
SMG$M_INVISIBLE Specifies invisible characters; that is, the characters exist in the virtual display but do not appear on the pasteboard.
SMG$M_USER1 through SMG$M_USER8 Displays user-defined attributes.

The display-id argument must be specified when you use the rendition-set argument.

rendition-complement


OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by reference

Attribute complement specifier. The optional rendition-complement argument is the address of a longword bit mask in which each attribute set causes the corresponding attribute to be complemented in the display. All of the attributes that can be specified with the rendition-set argument can be complemented with the rendition-complement argument. The display-id argument must be specified when you use the rendition-complement argument.

The optional arguments rendition-set and rendition-complement let the user control the attributes of the virtual display. The rendition-set argument sets certain virtual display attributes, while rendition-complement complements these attributes. If the same bit is specified in both the rendition-set and rendition-complement parameters, rendition-set is evaluated first, followed by rendition-complement. By using these two parameters together, the user can control each virtual display attribute in a single procedure call. On a single-attribute basis, the user can cause the following transformations:

Set Complement Action
0 0 Attribute set to default
1 0 Attribute on
0 1 Attribute set to complement of default setting
1 1 Attribute off

flags


OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by reference

Optional bit mask that specifies the action to take if the text does not fit on the line. The flags argument is the address of an unsigned longword that contains the flag. Valid values for flags are as follows:
0 Does not wrap (the default)
SMG$M_WRAP_CHAR Wraps at the last character on the line
SMG$M_WRAP_WORD Wraps at the last space on the line

character-set


OpenVMS usage longword_unsigned
type longword (unsigned)
access read only
mechanism by reference

Specifies the character set of the string in the character-string. The character-set argument is the address of an unsigned longword that contains the character set code. If this argument is omitted, the default character set will be the character set set up by SMG$CREATE_VIRTUAL_DISPLAY or by SMG$CHANGE_VIRTUAL_DISPLAY.
Value Character Set
SMG$C_ASCII ASCII
SMG$C_SPEC_GRAPHICS DEC Special Graphics
SMG$C_HANZI DEC Hanzi

1One of DEC supplemental character set and Latin-1 character set.


Description

SMG$INSERT_LINE lets you insert a line into a virtual display at a location other than the first or last line. Existing lines are scrolled in the specified direction to create an open space. If you specify a character-string argument, that string is written in the space created; otherwise, the new line remains blank. If the string does not span the width of the display, it is padded with blanks.

If the value of flags is SMG$M_WRAP_WORD or SMG$M_WRAP_CHAR and the specified character-string is longer than the width of the virtual display, SMG$INSERT_LINE scrolls another line and writes the excess characters in the created space. If flags is 0, any excess characters are discarded. The virtual cursor remains at the character position following the last character written.

See SMG$PUT_LINE to add lines and scroll at the first or last line in a virtual display.

In case the insertion operation specifies a Chinese language character set, and the discard begins on the right portion of Chinese character, the left portion of the character will become an undefined character.

Original SMG routines support only ASCII(default) and DEC Special Graphics, but Chinese SMG will allow users to specify the character-set which enables Chinese language to be used.


Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_INVARG Invalid argument. The specified direction is not up or down.
SMG$_INVCOL Invalid column.
SMG$_INVDIS_ID Invalid display-id.
SMG$_INVROW Invalid row.
SMG$_WILUSERMS Pasteboard is not a video terminal.
SMG$_WRONUMARG Wrong number of arguments.

Example



C+
C This DEC Fortran example program demonstrates the use of SMG$INSERT_LINE.
C
C Include the SMG definitions. In particular, we want SMG$M_BORDER,
C SMG$M_UNDERLINE, and SMG$M_UP.
C-

        IMPLICIT INTEGER (A-Z)
        INCLUDE '($SMGDEF)'

C+
C Use SMG$CREATE_VIRTUAL_DISPLAY to create a virtual display
C with a border.
C-

        ROWS = 7
        COLUMNS = 50

        STATUS = SMG$CREATE_VIRTUAL_DISPLAY
     1          (ROWS, COLUMNS, DISPLAY1, SMG$M_BORDER)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

C+
C Call SMG$CREATE_PASTEBOARD to create the pasteboard.
C-

        STATUS = SMG$CREATE_PASTEBOARD (PASTE1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

C+
C Use SMG$PUT_CHARS to put data in the virtual display.
C-

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1        ' This virtual display has 7 rows and 50 columns.', 2, 1 )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1        ' This is a bordered virtual display.', 4, 1 )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1        ' SMG$PUT_CHARS puts data in this virtual display.', 6, 1 )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

C+
C Paste the virtual display by calling SMG$PASTE_VIRTUAL_DISPLAY.
C-

        STATUS = SMG$PASTE_VIRTUAL_DISPLAY ( DISPLAY1, PASTE1, 4, 15 )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))


C+
C Call SMG$INSERT_LINE to add a line of text after line 6 and scroll
C the display. Also, underline the new characters.
C-

        STATUS = SMG$INSERT_LINE ( DISPLAY1, 7,
     1          'This is a new line.', SMG$M_UP, SMG$M_UNDERLINE )
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        END

      

The initial output generated by this FORTRAN program is shown in Figure SMG-29.

Figure SMG-29 Output Generated Before the Call to SMG$INSERT_LINE


The output generated after the call to SMG$INSERT_LINE is shown in Figure SMG-30.

Figure SMG-30 Output Generated After the Call to SMG$INSERT_LINE



SMG$INVALIDATE_DISPLAY

The Mark a Display as Invalid routine marks a display as invalid and causes the entire display to be redrawn.

Format

SMG$INVALIDATE_DISPLAY display-id


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

display-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the virtual display affected. The display-id argument is the address of an unsigned longword that contains the display identifier.

Display-id is returned by SMG$CREATE_VIRTUAL_DISPLAY.


Description

SMG$INVALIDATE_DISPLAY marks a display as invalid and redraws the entire display. You would normally use this routine after you determine that output has been written to the display without benefit of the Screen Management Facility.

This routine redraws the virtual display by invalidating the pasteboard contents of the virtual display's "footprint". If the display is occluded, only the occluded portion of the occluding virtual display is redrawn (the entire display is not redrawn).


Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_INVDIS_ID Invalid display-id.

SMG$KEYCODE_TO_NAME

The Translate a Key Code into a Key Name routine translates the key code of a key on the keyboard into its associated key name.

Format

SMG$KEYCODE_TO_NAME key-code ,key-name


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

key-code


OpenVMS usage word_unsigned
type word (unsigned)
access read only
mechanism by reference

Specifies the key code to translate into a key name. The key-code argument is the address of an unsigned word that contains the key code.

Key-code is the same as the word-terminator-code argument returned by SMG$READ_COMPOSED_LINE, SMG$READ_KEYSTROKE, and SMG$READ_STRING.

key-name


OpenVMS usage char_string
type character string
access write only
mechanism by descriptor

String containing the name of the key into which key-code is to be translated. The key-name argument is the address of a descriptor pointing to the character string containing the key name. The key-name argument is simply the name of the key (for example, COMMA, PERIOD, KP4, and so forth).

Description

SMG$KEYCODE_TO_NAME translates the key code of a key on the keyboard into its associated key name. This key code is the same code that is returned by the SMG$READ_COMPOSED_LINE, SMG$READ_KEYSTROKE, and SMG$READ_STRING routines in the word-terminator-code argument. The form of key-code is SMG$K_TRM_keyname (for example, SMG$K_TRM_DELETE).

For more information on terminator values, see Table 3-1 in Chapter 3.


Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_INVKEYNAM Invalid key-name.


Previous Next Contents