[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

OpenVMS/Hangul RTL Korean Screen Management (SMG$) Manual


Previous Contents

When a display is redimensioned, the virtual cursor for the display is moved to row 1 and column 1. Note that if a labeled border applies to the virtual display and does not fit the redimensioned display, the label is deleted.

If a program calls both SMG$CREATE_PASTEBOARD and SMG$CREATE_VIRTUAL_KEYBOARD, make sure SMG$CREATE_PASTEBOARD is called first. The program will not function correctly if SMG$CREATE_VIRTUAL_KEYBOARD is called before SMG$CREATE_PASTEBOARD.

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


Condition Values Returned

SS$_NORMAL Normal successful completion.
LIB$_INSVIRMEM Insufficient virtual memory to reallocate needed buffers.
SMG$_INVARG Invalid video or display attributes.
SMG$_WRONUMARG Wrong number of arguments.
SMG$_INVDIS_ID Invalid display-id.

SMG$CHECK_FOR_OCCLUSION

The Check for Occlusion routine checks to see whether a virtual display is covered (occluded) by another virtual display.

Format

SMG$CHECK_FOR_OCCLUSION display-id ,pasteboard-id ,occlusion-state


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 to be checked. 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.

pasteboard-id


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

Specifies the pasteboard to be checked. The pasteboard-id argument is the address of an unsigned longword that contains the pasteboard identifier. Pasteboard-id is returned by SMG$CREATE_PASTEBOARD.

occlusion-state


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

Receives the value denoting whether the display is occluded. The occlusion-state argument is the address of a signed longword into which the occlusion state is written. Occlusion-state is set to 1 if the display is occluded or set to 0 if the display is not occluded on the specified pasteboard. If the procedure does not return SS$_NORMAL, the contents of occlusion-state are undefined.

Description

SMG$CHECK_FOR_OCCLUSION determines whether a specified virtual display as pasted to the specified pasteboard is occluded, or covered, by another virtual display.

Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_NOTPASTED Specified virtual display is not pasted to the specified pasteboard.
SMG$_INVPAS_ID Invalid pasteboard-id.
SMG$_WRONUMARG Wrong number of arguments.
SMG$_INVDIS_ID Invalid display-id.

Example



C+
C This DEC Fortran example program demonstrates the use of
C SMG$CHECK_FOR_OCCLUSION.
C
C This routine creates a virtual display and writes it to the
C pasteboard.  Data is placed in the virtual display using SMG$PUT_CHARS.
C-

        INTEGER SMG$CREATE_VIRTUAL_DISPLAY, SMG$CREATE_PASTEBOARD
        INTEGER SMG$PASTE_VIRTUAL_DISPLAY,  SMG$PUT_CHARS
        INTEGER SMG$CHECK_FOR_OCCLUSION
        INTEGER DISPLAY1, DISPLAY2, PASTE1, PASTE2, ROWS, COLUMNS, BORDER
        INTEGER OCCLUSION, STATUS
        CHARACTER*29 TEXT

C+
C Include the SMG definitions. In particular, we want SMG$M_BORDER.
C-

        INCLUDE '($SMGDEF)'

C+
C Create two virtual displays using SMG$CREATE_VIRTUAL_DISPLAY.
C Give them borders.
C-

        ROWS = 6
        COLUMNS = 50

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

        ROWS = 5
        COLUMNS = 30

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

C+
C Create the pasteboard using SMG$CREATE_PASTEBOARD.
C-

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

C+
C Use SMG$PUT_CHARS to put data into the virtual displays.
C-

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1         ' This virtual display has 6 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.', 3, 1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

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

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1         ' This text should be partially occluded.', 5, 1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1         ' So should part of this row.', 6, 1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY2, ' This is virtual', 3, 1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY2,
     1         ' display #2.', 4, 1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY2,
     1         ' This is just some more text.', 5, 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))

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

C+
C Check the two virtual displays for occlusion by calling
C SMG$CHECK_FOR_OCCLUSION.
C-

        TEXT = 'This display is not occluded.'

        STATUS = SMG$CHECK_FOR_OCCLUSION (DISPLAY1, PASTE1, OCCLUSION)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        IF (OCCLUSION .EQ. 0) THEN
                STATUS = SMG$PUT_CHARS (DISPLAY1, TEXT, 1, 1)
                IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
        ELSE
                STATUS = SMG$PUT_CHARS (DISPLAY1, 'Occluded.', 1 , 1)
                IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
        END IF

        STATUS = SMG$CHECK_FOR_OCCLUSION (DISPLAY2, PASTE1, OCCLUSION)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        IF (OCCLUSION .EQ. 0) THEN
                STATUS = SMG$PUT_CHARS (DISPLAY2, TEXT, 1, 1)
                IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
        ELSE
                STATUS = SMG$PUT_CHARS (DISPLAY2, 'Occluded.', 1 , 1)
                IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))
        END IF

        END

      

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

Figure SMG-4 Output Generated by FORTRAN Program Calling SMG$CHECK_FOR_OCCLUSION



SMG$CONTROL_MODE

The Control Mode routine controls the mode of the pasteboard. This includes buffering, minimal updating, whether the screen is cleared when the pasteboard is deleted, and whether tab characters are used for screen formatting.

Format

SMG$CONTROL_MODE pasteboard-id [,new-mode] [,old-mode] [,buffer-size]


RETURNS


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


Arguments

pasteboard-id


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

Specifies the pasteboard to be changed. The pasteboard-id argument is the address of an unsigned longword that contains the pasteboard identifier.

Pasteboard-id is returned by SMG$CREATE_PASTEBOARD.

new-mode


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

Specifies the new control settings to be used. The optional new-mode argument is the address of an unsigned longword that contains the mode settings. A bit set to 1 forces that mode to be employed while a bit set to 0 inhibits that mode of operation.

Valid settings are as follows:

SMG$M_BUF_ENABLED Enables buffering.
SMG$M_CLEAR_SCREEN Causes the Screen Management Facility to clear the screen when the program exits if you have not previously deleted the pasteboard.
SMG$M_MINUPD Enables minimal update (the default).
SMG$M_NOTABS Causes the Screen Management Facility not to use tab characters to format the screen.
SMG$M_PROTECT Protect pasteboard operations from AST interrupts (the default).

All other bits must be zero and are reserved for future use by Digital.

old-mode


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

Receives the control settings that were in effect before calling this procedure. The optional old-mode argument is the address of an unsigned longword into which are written the former mode settings. A bit set to 1 indicates that the specified mode was employed while a bit set to 0 indicates that the mode was inhibited.

buffer-size


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

Specifies the size of the buffer in bytes. The optional buffer-size argument is the address of an unsigned word that contains the size of the buffer. Buffer-size is used when buffering mode is enabled (SMG$M_BUF_ENABLED). The default and minimum buffer size is 256 bytes. The maximum value is 65535. The buffer-size value depends on UAF values and is maximized with the sysgen parameter MAXBUF.

Description

SMG$CONTROL_MODE lets you determine and change the mode of the Screen Management Facility operation for a specified pasteboard. By specifying different combinations of the new-mode and old-mode arguments, SMG$CONTROL_MODE can be used in various ways.
  • To use SMG$CONTROL_MODE to determine the current mode settings, use the following format:

    SMG$CONTROL_MODE (pasteboard_id ,,old_mode)

  • To use SMG$CONTROL_MODE to set the bits without regard to their current setting, use the following format:

    SMG$CONTROL_MODE (pasteboard_id ,new_mode)

  • To use SMG$CONTROL_MODE to save the current settings, set new modes, and later restore the original settings, use the following format:

    SMG$CONTROL_MODE (pasteboard_id ,new_mode ,old_mode)


    This retrieves the current bit settings and then sets the mode according to the new-mode argument.
    Later, to restore the mode to its former state, specify the following format:


    SMG$CONTROL_MODE (pasteboard_id ,old_mode)


    This sets the new mode according to the settings previously retrieved.

Note that if both arguments are omitted, no information is returned.

The modes that can be determined and changed using SMG$CONTROL_MODE are as follows:

Buffering

In this mode, the Screen Management Facility buffers all output for efficient use of system QIOs. When the buffer fills, SMG$ writes the buffer to the terminal. By calling SMG$FLUSH_BUFFER, the user can force to the screen any output that has been placed in the pasteboard buffer but not yet written to the terminal.

Minimal Screen Update

By default, the Screen Management Facility tries to minimize the number of characters actually sent to the terminal. It does this by keeping track of the current contents of the pasteboard and the new contents of the pasteboard. SMG$ then sends only those characters that have changed.

Nonminimal updating rewrites any line containing a change, starting with the first changed character on that line.

Clear Screen

By default, the Screen Management Facility does not clear the screen when the program exits if you have not already deleted the pasteboard. Use the clear screen mode to prevent this default behavior.

No Tabs

If this bit is set, the Screen Management Facility does not rely on the terminal's tab settings. If it is not set, the Screen Management Facility will use physical tabs for the minimal update procedure. However, note that such use implicitly assumes that the tab stops are set to the Digital default locations (every eight characters). Specify "no tabs" if you want to be sure that the application will run regardless of the tab settings the user has set on the terminal. By default, this bit is clear. A terminal setting of SET TERM/NOTABS may also be used to override this default.


Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_INVARG Invalid argument. New-mode has a bit set which does not correspond to SMG$M_BUF_ENABLED, SMG$M_MINUPD, SMG$M_CLEAR_SCREEN, or SMG$M_NOTABS, or buffer size is less than 256.
SMG$_INVPAS_ID Invalid pasteboard-id.
SMG$_WRONUMARG Wrong number of arguments.

SMG$COPY_VIRTUAL_DISPLAY

The Copy a Virtual Display routine creates a copy of an existing virtual display and assigns to it a new virtual display identifier.

Format

SMG$COPY_VIRTUAL_DISPLAY current-display-id ,new-display-id


RETURNS


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


Arguments

current-display-id


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

Display identifier of the virtual display to be replicated. The current-display-id argument is the address of the unsigned longword that contains the display identifier.

new-display-id


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

Receives the display identifier of the newly created virtual display. The new-display-id argument is the address of the unsigned longword that receives the new display identifier.

Description

SMG$COPY_VIRTUAL_DISPLAY creates a copy of an existing virtual display and assigns to it a new virtual display number. This newly created virtual display will not be pasted anywhere; use SMG$PASTE_VIRTUAL_DISPLAY and the new-display-id identifier to paste the newly created virtual display. The existing display being replicated does not have to be pasted when SMG$COPY_VIRTUAL_DISPLAY is invoked.

Condition Values Returned

SS$_NORMAL Normal successful completion.
LIB$_INSVIRMEM Insufficient virtual memory to allocate needed buffer.

Example



C+
C This DEC Fortran example program demonstrates the use of
C SMG$COPY_VIRTUAL_DISPLAY.
C
C This routine creates a virtual display and writes it to the
C pasteboard.  Data is placed in the virtual display using SMG$PUT_CHARS.
C-

        IMPLICIT INTEGER (A-Z)
        CHARACTER*29 TEXT

C+
C Include the SMG definitions. In particular, we want SMG$M_BORDER.
C-

        INCLUDE '($SMGDEF)'

C+
C Create two virtual displays using SMG$CREATE_VIRTUAL_DISPLAY.
C Give them borders.
C-

        ROWS = 6
        COLUMNS = 50

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

        ROWS = 5
        COLUMNS = 30

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

C+
C Create the pasteboard using SMG$CREATE_PASTEBOARD.
C-

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

C+
C Use SMG$PUT_CHARS to put data into the virtual displays.
C-

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1         ' This virtual display has 6 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.', 3, 1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

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

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1         ' This text should be partially occluded.', 5, 1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY1,
     1         ' So should part of this row.', 6, 1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY2, ' This is virtual', 3, 1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY2,
     1         ' display #2.', 4, 1)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

        STATUS = SMG$PUT_CHARS ( DISPLAY2,
     1         ' This is just some more text.', 5, 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))

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

C+
C Copy the first virtual display, the one that is partially occluded.
C-

        STATUS = SMG$COPY_VIRTUAL_DISPLAY ( DISPLAY1, NEW_DISPLAY)
        IF (.NOT. STATUS) CALL LIB$SIGNAL(%VAL(STATUS))

C+
C Now paste this new virtual display so that it occludes the other displays.
C-

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

        END


      

The first virtual display created by this FORTRAN example is shown in Figure SMG-5.

Figure SMG-5 First Virtual Display Generated by This Example


The second virtual display created by this FORTRAN example is shown in Figure SMG-6.

Figure SMG-6 Second Virtual Display Generated by This Example


The output generated after the call to SMG$COPY_VIRTUAL_DISPLAY is shown in Figure SMG-7.

Figure SMG-7 Output Generated After the Call to SMG$COPY_VIRTUAL_DISPLAY



Previous Next Contents