CONTENTS Title Page Copyright Page Preface 1 Overview of the Screen Management Facility (SMG$) 1.1 Pasteboards 1.2 Virtual Displays 1.3 Viewports 1.4 Virtual Keyboards 2 Screen Management Output Operations 2.1 Composition Operations 2.1.1 Paste Operation 2.1.2 Unpaste Operation 2.1.3 Repaste Operation 2.1.4 Move Operation 2.1.5 Delete and Pop Operations 2.1.6 Occlusion Check Operation 2.2 Output Through Virtual Displays 2.2.1 Cursor Position 2.2.2 Deletion Operations 2.2.3 Erasure Operations 2.2.4 Insertion Operations 2.2.5 Writing Operations 2.2.5.1 Character-Oriented Output 2.2.5.2 Line-Oriented Output 2.2.6 Changing the Rendition of a Virtual Display 2.2.7 Drawing and Removing Drawn Lines and Characters 2.2.8 Displaying External Text 2.2.9 Reading from a Virtual Display 2.2.10 Viewports 2.2.10.1 Creating a Viewport 2.2.10.2 Deleting a Viewport 2.2.10.3 Pasting and Unpasting a Viewport 2.2.10.4 Scrolling and Moving a Viewport 2.2.10.5 Changing Viewport Characteristics 2.2.11 Menus 2.2.11.1 Creating a Menu 2.2.11.2 Deleting a Menu 2.2.11.3 Selecting from a Menu 2.2.11.3.1 Default Mode 2.2.11.3.2 RETURN_IMMED Mode 2.2.11.3.3 REMOVE_ITEM Mode 2.2.12 Saving a Virtual Display 2.2.13 Changing Terminal Characteristics 2.2.14 Hardcopy and File Output Operations 2.2.14.1 Snapshots 2.2.14.2 Printing a Pasteboard 2.2.14.3 Pasteboard Output by Means of a User-Supplied Routine 2.3 Operational Controls 2.3.1 Minimal Update 2.3.2 Buffering 2.3.3 Tabs 2.4 Batching Output Operations 2.4.1 Display Update Batching 2.4.2 Pasteboard Update Batching 3 Screen Management Input Operations 3.1 Obtaining Data from Virtual Keyboards 3.2 Setting and Retrieving Virtual Keyboard Characteristics 3.3 Line Composition Using Keypad Keys 3.4 States 3.5 Terminators 3.6 Line Recall and the Recall Buffer 3.7 Interaction of Input and Output 4 Advanced Screen Management Features 4.1 Asynchronous Events 4.1.1 Broadcast Messages 4.1.2 Unsolicited Input 4.1.3 Out-of-Band ASTs 4.2 Subprocesses 4.2.1 Creating a Subprocess 4.2.2 Deleting a Subprocess 4.2.3 Executing Commands in a Subprocess 4.3 Moving the Cursor 4.4 Exit Handler 5 Support for Non-DIGITAL Terminals 5.1 TERMTABLE Interface Routines 5.2 Capability Fields 5.2.1 Boolean Capability Fields 5.2.2 Numeric Capability Fields 5.2.3 String Capability Fields 5.2.4 Argument Substitution 5.2.5 Arithmetic Operations 5.3 Creating a VMS Terminal Capabilities File 5.4 Examples 5.5 Creating TERMTABLE.EXE 5.6 Capability Fields Used by Screen Management 5.7 Input Support for Foreign Terminals 5.8 Support for SET and SHOW TERMINAL Commands 6 Using Screen Management Routines to Develop New Programs 6.1 Calling Routines That Do Not Use the Screen Management Facility 7 Examples of Calling SMG$ Routines SMG$ Reference Section SMG$ADD_KEY_DEF SMG$BEGIN_DISPLAY_UPDATE SMG$BEGIN_PASTEBOARD_UPDATE SMG$CANCEL_INPUT SMG$CHANGE_PBD_CHARACTERISTICS SMG$CHANGE_RENDITION SMG$CHANGE_VIEWPORT SMG$CHANGE_VIRTUAL_DISPLAY SMG$CHECK_FOR_OCCLUSION SMG$CONTROL_MODE SMG$COPY_VIRTUAL_DISPLAY SMG$CREATE_KEY_TABLE SMG$CREATE_MENU SMG$CREATE_PASTEBOARD SMG$CREATE_SUBPROCESS SMG$CREATE_VIEWPORT SMG$CREATE_VIRTUAL_DISPLAY SMG$CREATE_VIRTUAL_KEYBOARD SMG$CURSOR_COLUMN SMG$CURSOR_ROW SMG$DEFINE_KEY SMG$DEL_TERM_TABLE SMG$DELETE_CHARS SMG$DELETE_KEY_DEF SMG$DELETE_LINE SMG$DELETE_MENU SMG$DELETE_PASTEBOARD SMG$DELETE_SUBPROCESS SMG$DELETE_VIEWPORT SMG$DELETE_VIRTUAL_DISPLAY SMG$DELETE_VIRTUAL_KEYBOARD SMG$DISABLE_BROADCAST_TRAPPING SMG$DISABLE_UNSOLICITED_INPUT SMG$DRAW_CHAR SMG$DRAW_LINE SMG$DRAW_RECTANGLE SMG$ENABLE_UNSOLICITED_INPUT SMG$END_DISPLAY_UPDATE SMG$END_PASTEBOARD_UPDATE SMG$ERASE_CHARS SMG$ERASE_COLUMN SMG$ERASE_DISPLAY SMG$ERASE_LINE SMG$ERASE_PASTEBOARD SMG$EXECUTE_COMMAND SMG$FIND_CURSOR_DISPLAY SMG$FLUSH_BUFFER SMG$GET_BROADCAST_MESSAGE SMG$GET_CHAR_AT_PHYSICAL_CURSOR SMG$GET_DISPLAY_ATTR SMG$GET_KEY_DEF SMG$GET_KEYBOARD_ATTRIBUTES SMG$GET_NUMERIC_DATA SMG$GET_PASTEBOARD_ATTRIBUTES SMG$GET_PASTING_INFO SMG$GET_TERM_DATA SMG$GET_VIEWPORT_CHAR SMG$HOME_CURSOR SMG$INIT_TERM_TABLE SMG$INIT_TERM_TABLE_BY_TYPE SMG$INSERT_CHARS SMG$INSERT_LINE SMG$INVALIDATE_DISPLAY SMG$KEYCODE_TO_NAME SMG$LABEL_BORDER SMG$LIST_KEY_DEFS SMG$LIST_PASTING_ORDER SMG$LOAD_KEY_DEFS SMG$LOAD_VIRTUAL_DISPLAY SMG$MOVE_TEXT SMG$MOVE_VIRTUAL_DISPLAY SMG$NAME_TO_KEYCODE SMG$PASTE_VIRTUAL_DISPLAY SMG$POP_VIRTUAL_DISPLAY SMG$PRINT_PASTEBOARD SMG$PUT_CHARS SMG$PUT_CHARS_HIGHWIDE SMG$PUT_CHARS_MULTI SMG$PUT_CHARS_WIDE SMG$PUT_HELP_TEXT SMG$PUT_LINE SMG$PUT_LINE_HIGHWIDE SMG$PUT_LINE_MULTI SMG$PUT_LINE_WIDE SMG$PUT_PASTEBOARD SMG$PUT_STATUS_LINE SMG$READ_COMPOSED_LINE SMG$READ_FROM_DISPLAY SMG$READ_KEYSTROKE SMG$READ_STRING SMG$READ_VERIFY SMG$REMOVE_LINE SMG$REPAINT_LINE SMG$REPAINT_SCREEN SMG$REPASTE_VIRTUAL_DISPLAY SMG$REPLACE_INPUT_LINE SMG$RESTORE_PHYSICAL_SCREEN SMG$RETURN_CURSOR_POS SMG$RETURN_INPUT_LINE SMG$RING_BELL SMG$SAVE_PHYSICAL_SCREEN SMG$SAVE_VIRTUAL_DISPLAY SMG$SCROLL_DISPLAY_AREA SMG$SCROLL_VIEWPORT SMG$SELECT_FROM_MENU SMG$SET_BROADCAST_TRAPPING SMG$SET_CURSOR_ABS SMG$SET_CURSOR_MODE SMG$SET_CURSOR_REL SMG$SET_DEFAULT_STATE SMG$SET_DISPLAY_SCROLL_REGION SMG$SET_KEYPAD_MODE SMG$SET_OUT_OF_BAND_ASTS SMG$SET_PHYSICAL_CURSOR SMG$SET_TERM_CHARACTERISTICS SMG$SNAPSHOT SMG$UNPASTE_VIRTUAL_DISPLAY EXAMPLES 7-1 Using SMG$ Routines in VAX Ada 7-2 Using SMG$ Routines in VAX BASIC 7-3 Using SMG$ Routines in VAX BLISS32 7-4 Using SMG$ Routines in VAX COBOL 7-5 Using SMG$ Routines in VAX FORTRAN 7-6 Using SMG$ Routines in VAX MACRO 7-7 Using SMG$ Routines in VAX Pascal 7-8 Using SMG$ Routines in VAX PL/I 7-9 Using SMG$ Routines in VAX RPG II FIGURES 1-1 Pasteboard Coordinate System 2-1 Paste Operation 2-2 Unpaste Operation 2-3 Repaste Operation 2-4 Move Operation 2-5 Pop Operation 2-6 Occlusion Check 2-7 Lines Drawn Without SMG$DRAW_LINE 2-8 Lines Drawn with SMG$DRAW_LINE SMG-1 Output Generated After Virtual Displays Are Pasted SMG-2 Output Generated After the Viewport Is Created SMG-3 Output Generated After Calling SMG$CHANGE_VIEWPORT SMG-4 Output Generated by FORTRAN Program Calling SMG$CHECK_FOR_OCCLUSION SMG-5 First Virtual Display Generated by This Example SMG-6 Second Virtual Display Generated by This Example SMG-7 Output Generated After the Call to SMG$COPY_VIRTUAL_DISPLAY SMG-8 Output Generated by Creating a Viewport SMG-9 Output of FORTRAN Program Calling SMG$CREATE_VIRTUAL_DISPLAY SMG-10 Output Generated Before the Call to SMG$DELETE_CHARS SMG-11 Output Generated After the Call to SMG$DELETE_CHARS SMG-12 Output Generated by FORTRAN Program Before the Call to SMG$DELETE_LINE SMG-13 Output Generated After the Call to SMG$DELETE_LINE SMG-14 Output Generated Before Any Input or Messages Are Trapped SMG-15 Output Generated After a Broadcast Message Is Trapped SMG-16 Output Generated After a Call to LIB$SPAWN SMG-17 Output Generated by FORTRAN Program Calling SMG$DRAW_LINE SMG-18 Output Generated by FORTRAN Program Calling SMG$DRAW_RECTANGLE SMG-19 AST Routine Arguments SMG-20 Output Before the Call to SMG$ERASE_CHARS SMG-21 Output After the Call to SMG$ERASE_CHARS SMG-22 Initial Output of FORTRAN Program Calling SMG$ERASE_DISPLAY SMG-23 Output Displayed After the Call to SMG$ERASE_DISPLAY SMG-24 Initial Output Generated by FORTRAN Program Calling SMG$ERASE_LINE SMG-25 Output Generated After the Call to SMG$ERASE_LINE SMG-26 Output Generated by SMG$GET_VIEWPORT_CHAR SMG-27 Output Generated by FORTRAN Program Before the Call to SMG$INSERT_CHARS SMG-28 Output Generated by FORTRAN Program After the Call to SMG$INSERT_CHARS SMG-29 Output Generated Before the Call to SMG$INSERT_LINE SMG-30 Output Generated After the Call to SMG$INSERT_LINE SMG-31 Output Generated by Program Calling SMG$LABEL_BORDER SMG-32 Arguments for Moving Text SMG-33 Output of FORTRAN Program Calling SMG$PUT_CHARS SMG-34 Output Generated by FORTRAN Program Calling SMG$PUT_LINE SMG-35 Output Generated by FORTRAN Program Calling SMG$PUT_LINE_WIDE SMG-36 Output Generated by FORTRAN Program Calling SMG$READ_FROM_DISPLAY SMG-37 Output Generated by FORTRAN Program Calling SMG$READ_KEYSTROKE SMG-38 Output Generated Before the Call to SMG$READ_STRING SMG-39 Output Generated After the Call to SMG$READ_STRING SMG-40 Output Generated by FORTRAN Program Calling SMG$REPAINT_SCREEN SMG-41 Output Generated by FORTRAN Program Calling SMG$REPAINT_SCREEN SMG-42 Output Before the Call to SMG$MOVE_VIRTUAL_DISPLAY SMG-43 Output Displayed After the Call to SMG$MOVE_VIRTUAL_DISPLAY SMG-44 Output Displayed After the Call to SMG$REPASTE_VIRTUAL_DISPLAY SMG-45 Output Generated by Pasting the Virtual Display SMG-46 Output Generated After First Call to SMG$SCROLL_VIEWPORT SMG-47 Output Generated After the Second Call to SMG$SCROLL_VIEWPORT SMG-48 Output Generated After the Last Call to SMG$SCROLL_VIEWPORT SMG-49 Output Generated Before a Menu Selection Is Made SMG-50 Output Generated After the User Selects an Item SMG-51 Output Generated Before the User Selects a Menu Item SMG-52 Output Generated After Two Selections SMG-53 Output Generated After EXIT Is Selected SMG-54 Output Generated Before a Menu Item Is Selected SMG-55 Output Generated After Three Menu Selections SMG-56 Output Generated After Program Completion TABLES 1-1 Routines That Support Non-DIGITAL Terminals 1-2 Input Routines 1-3 Output Routines 3-1 Terminator Values 5-1 Boolean Capabilities 5-2 Numeric Capabilities 5-3 String Capabilities 5-4 String_2 Capabilities