! ANY MAY 1987 Copied from SYS$LIBRARY:UISENTRY.FOR
! Completely commented out as it is FORTRAN 
! To get a routine to work in IMP fiddle with the approprite lines
! These are usually just below with only one '!'
!
%from IMP %include DSCDEF,AST
!!*** MODULE UISENTRY ***
!! 
!!   seg_id.rl.r = UIS$BEGIN_SEGMENT (vd_id)
!! 
!! seg_id.rl.r = Segment ID
!! vd_id.rl.r = Virtual display ID
%external %integer %function %spec UIS BEGIN SEGMENT %alias "UIS$BEGIN_SEGMENT" -
                          (%integer %name VD ID)
!! 
!!     Begin a graphics segment.
!! 
!INTEGER*4 uis$begin_segment
!EXTERNAL  uis$begin_segment
!! 
!!   UIS$CIRCLE (vd_id, atb,center_x,center_y, xradius,
!! [start_deg],[end_deg])
!! 
!!     Draw the arc of a circle.
!! 
!! vd_id.rl.r = Virtual display ID
!!       atb.rl.r = Attribute block number
!!       center_x.rf.r, center_y.rf.r = Center x,y coordinates (F floating)
!! xradius.rf.r = Radius of the circle (x axis) (F floating)
!! start_deg.rf.r = Degree at which arc starts (F floating, optional)
!! end_deg.rf.r = Degree at which arc ends (F floating, optional)
!! 
!EXTERNAL  uis$circle
!! 
!!   UIS$CLOSE_WINDOW (wd_id)
!! 
!!     Close window, default routine for DELETE menu option.
!!     (calls SYS$EXIT)
!! 
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$close_window
!! 
!!   new_obj_id = UIS$COPY_OBJECT (obj_id, matrix, ia)
!! 
!!     Copy the sepcified object.
!! 
!! obj_id.rl.r = SEG or OTP ID
!! matrix.ra.v = Address of matrix
!! ia.rl.r = Input attribute block value
!! 
!INTEGER*4 uis$copy_object
!EXTERNAL  uis$copy_object
!! 
!!  uis$create_color_map (vcm_size, vcm_name: REF $BBLOCK,
!! vcm_attributes: REF VECTOR []) =
!! 
!! 
!! Create a new virtual color map.
!! 
!!  Inputs:
!! 
!! vcm_size.rl.r = Size of virtual color map
!! vcm_name.rt.dx = (optional) VCM name descriptor
!! vcm_attributes.rl.r = (optional) VCM attribute block
!! 
!!  Outputs:
!! 
!! vcm_id.wl.v = Virtual color map ID (returned in R0)
!! 
%external %integer %function %spec UIS Create Color Map %alias "UIS$CREATE_COLOR_MAP" -
                              (%integer %name VCM SIZE,
                               %record (DSC FM) %name VCM Name,
                               %integer %name VCM Attributes)

!INTEGER*4 uis$create_color_map
!EXTERNAL  uis$create_color_map
!! 
!!  uis$create_color_map_seg (vcm_id, devnam: REF $BBLOCK,
!! place_mode, place_data) =
!! 
!! 
!! Create color map segment and bind it to a virtual color map
!! 
!!  Inputs:
!! 
!! vcm_id.rl.r = Virtual color map ID
!! devnam.rt.dx = Device name
!! place_mode.rl.r = Placement mode
!! place_data.rl.r = Placement data
!! 
!!  Outputs:
!! 
!! cms_id.wl.v =  Color map segment ID (returned in R0)
!! 
!INTEGER*4 uis$create_color_map_seg
!EXTERNAL  uis$create_color_map_seg
!! 
!!   vd_id.rl.v = UIS$CREATE_DISPLAY (x1,y1,x2,y2,width,height,vcm_id)
!! 
!!     Create a virtual display
!! 
!! vd_id.wl.r = Virtual display ID (return value)
!! x1.rf.r = Minimum X world coordinate (F floating)
!! y1.rf.r = Minimum Y world coordinate (F floating)
!! x2.rf.r = Maximum X world coordinate (F floating)
!! y2.rf.r = Maximum Y world coordinate (F floating)
!! width.rf.r = Width of display in cms (F floating)
!! height.rf.r = Height of display in cms (F floating)
!! vcm_id.rl.r = Virtual color map ID (optional)
!! 
!INTEGER*4 uis$create_display
!EXTERNAL  uis$create_display
%external %integer %function %spec UIS CREATE DISPLAY %alias -
                             "UIS$CREATE_DISPLAY" -
                             (%real %name x1,y1,x2,y2,width,height,
                              %integer %name vcm id)

!! 
!!   kb_id.wl.v = UIS$CREATE_KB (devnam)
!! 
!!     Create a virtual keyboard
!! 
!! kb_id.wl.r = Virtual keyboard ID (return value)
!! devnam.rt.dx = Device name descriptor
!! 
!INTEGER*4 uis$create_kb
!EXTERNAL  uis$create_kb
%external %integer %function %spec UIS CREATE KB %alias "UIS$CREATE_KB" -
                  (%record (DSC FM) %name devnam)
!! 
!!  tb_id = UIS$CREATE_TB (devnam)
!! 
!!  Create tablet data block
!!  devnam.rt.dx
!! 
!INTEGER*4 uis$create_tb
!EXTERNAL  uis$create_tb
!! 
!!   UIS$CREATE_TERMINAL (termtype,[title],[attributes],devnam,[devlen])
!! 
!!     Create a terminal emulation window of the specified type.
!! 
!! termtype.rt.dx = Terminal type descriptor ('VT' or 'TK')
!! title.rt.dx = Window title descriptor (optional)
!! attributes.ra.v = Address of window attribute block
!! devnam.wt.dx = Descriptor to return device name in
!! devlen.wwu.r = Word to return device name length in
!! 
!EXTERNAL  uis$create_terminal
!! 
!!   tr_id.wl.v = UIS$CREATE_TRANSFORMATION (vd_id,x1,y1,x2,y2,
!! [vdx1,vdy1,vdx2,vdy2])
!! 
!!     Create alternate display transformation
!! 
!! tr_id.wl.v = Transformation ID (return value)
!! vd_id.rl.r = Virtual display ID
!! x1.rf.r, y1.rf.r = Lower left corner of new coordinate space
!! x2.rf.r, y2.rf.r = Upper right corner of new coordinate space
!! vdx1.rf.r, vdy1.rf.r = Lower left corner of virtual display (VD_ID)
!! vdx2.rf.r, vdy2.rf.r = Upper right corner of virtual display (VD_ID)
!! 
!INTEGER*4 uis$create_transformation
!EXTERNAL  uis$create_transformation
!! 
!!   wd_id.wl.v = UIS$CREATE_WINDOW (vd_id,devnam,[title],[x1,y1,x2,y2],
!! [width,height],
!! [attributes])
!! 
!!     Create a display window to an existing virtual display
!! 
!! wd_id.rl.r = Display window ID (return value)
!! vd_id.rl.r = Virtual display or pasteboard ID
!! devnam.rt.dx = Descriptor of physical display device
!! title.rt.dx = Descriptor of window border title
!! x1.rf.r, y1.rf.r = One corner of the window rectangle (F floating)
!! x2.rf.r, y2.rf.r = Other corner of the window rectangle (F floating)
!! width.rf.r, height.rf.r = Initial width,height of viewport in cms (F floating)
!! attributes.ra.v = Address of window attributes block (WDPL$C_xxx)
!! 
!! 
!INTEGER*4 uis$create_window
!EXTERNAL  uis$create_window
%external %integer %function %spec UIS CREATE WINDOW %alias -
                             "UIS$CREATE_WINDOW" -
                             (%integer %name VD ID,
                              %record (Dsc Fm) %name DevNam,Title,
                              %real %name x1,y1,x2,y2,
                              %real %name width,height,
                              %integer %name Attributes)
!! 
!!  uis$delete_color_map (vcm_id): NOVALUE =
!! 
!! 
!! Delete a virtual color map.
!! 
!!  Inputs:
!! 
!! vcm_id.rl.r = Virtual color map ID
!! 
!!  Outputs:
!! 
!! NONE
!! 
!EXTERNAL  uis$delete_color_map
!! 
!!  uis$delete_color_map_seg (cms_id): NOVALUE =
!! 
!! 
!! Delete a color map segment.
!! 
!!  Inputs:
!! 
!! cms_id.rl.r = Color map segment ID
!! 
!!  Outputs:
!! 
!! NONE
!! 
!EXTERNAL  uis$delete_color_map_seg
!! 
!!   UIS$DELETE_DISPLAY (vd_id)
!! 
!!     Delete a virtual display.
!! 
!! vd_id.rl.r = Virtual display ID
!! 
!EXTERNAL  uis$delete_display
%external %routine %spec UIS DELETE DISPLAY %alias "UIS$DELETE_DISPLAY" -
                    (%integer %name VD ID)
!! 
!!   UIS$DELETE_KB (kb_id)
!! 
!!     Delete a virtual keyboard.
!! 
!! kb_id.rl.r = Virtual keyboard ID
!! 
!EXTERNAL  uis$delete_kb
%external %routine %spec UIS DELETE KB %alias "UIS$DELETE_KB" -
              (%integer %name KB ID)
!! 
!!   UIS$DELETE_OBJECT (obj_id)
!! 
!! obj_id.rl.r = Segment or primitive ID
!! 
!!     End a graphics segment.
!! 
!EXTERNAL  uis$delete_object
%external %routine %spec UIS DELETE OBJECT %alias "UIS$DELETE_OBJECT" -
                 (%integer %name obj id)
!! 
!!   UIS$DELETE_PRIVATE (obj_id)
!! 
!! obj_id.rl.r = Segment or primitive ID
!! 
!!     Deleates all private data assocated with the object.
!! 
!EXTERNAL  uis$delete_private
!! 
!!  UIS$DELETE_TB (tb_id)
!! 
!!  Delete tablet data block
!!  tb_id.rl.r
!! 
!EXTERNAL  uis$delete_tb
!! 
!!   UIS$DELETE_TRANSFORMATION (tr_id)
!! 
!!     Delete a display transformation.
!! 
!! tr_id.rl.r = Transformation ID
!! 
!EXTERNAL  uis$delete_transformation
!! 
!!   UIS$DELETE_WINDOW (wd_id)
!! 
!!     Delete a display window to a virtual display.
!! 
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$delete_window
!! 
!!   UIS$DISABLE_DISPLAY_LIST (vd_id, display_flags)
!! 
!!     Disable keeping the display list for "animation" displays
!! 
!! vd_id.rl.r = Virtual display ID
!! display_flags.rl.r = Mask of display list controls
!! 
%externalroutinespec UISDisable Display List %alias "UIS$DISABLE_DISPLAY_LIST" -
                     (%integer %name VD ID,Display Flags)
!EXTERNAL  uis$disable_display_list
!! 
!!   UIS$DISABLE_KB (kb_id)
!! 
!!     Disable a virtual keyboard.  (Detach the physical keyboard
!!     from it.)
!! 
!! kb_id.rl.r = Virtual keyboard ID
!! 
!EXTERNAL  uis$disable_kb
%external %routine %spec UIS DISABLE KB %alias "UIS$DISABLE_KB" -
             (%integer %name KB ID)
!! 
!!  UIS$DISABLE_TB (tb_id)
!! 
!!  Release digitizing tablet
!!  tb_id.rl.r
!! 
!EXTERNAL  uis$disable_tb
!! 
!!   UIS$DISABLE_VIEWPORT_KB (wd_id)
!! 
!!     Do not allow a viewport to have a keyboard associated with it.
!! 
!! wd_id.rl.r = Display window ID
!! 
!! 
!EXTERNAL  uis$disable_viewport_kb
!! 
!!   UIS$ELLIPSE (vd_id, atb,center_x,center_y,xradius,yradius,[start_deg],[end_deg])
!! 
!!     Draw the arc of an ellipse.
!! 
!! vd_id.rl.r = Virtual display ID
!!       atb.rl.r = Attribute block number
!!       center_x.rf.r, center_y.rf.r = Center x,y coordinates (F floating)
!! xradius.rf.r = Major axis radius of the ellipse (F floating)
!! yradius.rf.r = Minor axis radius of the ellipse (F floating)
!! start_deg.rf.r = Degree at which arc starts (F floating, optional)
!! end_deg.rf.r = Degree at which arc ends (F floating, optional)
!! 
!EXTERNAL  uis$ellipse
!! 
!!   UIS$ENABLE_DISPLAY_LIST (vd_id, display_flags)
!! 
!!     Enable keeping the display list (used after being disabled)
!! 
!! vd_id.rl.r = Virtual display ID
!! display_flags.rl.r = Mask of display list controls
!! 
!EXTERNAL  uis$enable_display_list
%externalroutinespec UIS Enable Display List %alias "UIS$ENABLE_DISPLAY_LIST" -
                (%integer %name VD ID,Dsplay Flags)
!! 
!!   UIS$ENABLE_KB (kb_id [,wd_id])
!! 
!!     Enable a virtual keyboard.  (Attach the physical keyboard
!!     to it.)
!! 
!! kb_id.rl.r = Virtual keyboard ID
!! wd_id.rl.r = Display window ID (optional)
!! 
!EXTERNAL  uis$enable_kb
%external %routine %spec UIS Enable KB %alias "UIS$ENABLE_KB" -
           (%integer %name kb id,wd id)
!! 
!!  UIS$ENABLE_TB (tb_id)
!! 
!!  Make this current owner of digitizing
!!  tb_id.rl.r
!! 
!EXTERNAL  uis$enable_tb
!! 
!!   UIS$ENABLE_VIEWPORT_KB (kb_id, wd_id)
!! 
!!     Allow a viewport to have a keyboard associated with it.
!! 
!! kb_id.rl.r = Virtual keyboard ID
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$enable_viewport_kb
!! 
!!   UIS$END_SEGMENT (vd_id)
!! 
!! vd_id.rl.r = Virtual display ID
!! 
!!     End a graphics segment.
!! 
!EXTERNAL  uis$end_segment
%external %routine %spec UIS END SEGMENT %alias "UIS$END_SEGMENT" -
              (%integer %name VD ID)
!! 
!!   UIS$ERASE (vd_id, [x1,y1,x2,y2])
!! 
!!     Erases the region specified by the given rectangle.
!! 
!! vd_id.rl.r = Address of virtual display ID
!! x1.rf.r, y1.rf.r = X,Y position of one rectangle corner (F floating)
!! x2.rf.r, y2.rf.r = X,Y position of other corner (F floating)
!! 
!EXTERNAL  uis$erase
%external %routine %spec UIS Erase %alias "UIS$ERASE" -
                (%integer %name VD ID,
                 %real %name x1,y1,x2,y2)
!! 
!!   UIS$EXECUTE(vd_id, buflen, bufaddr)
!! 
!!     Executes a binary generic encoding stream
!! 
!! vd_id.rl.r = Virtual display ID
!! buflen.rl.r = Length of binary stream in bytes
!! bufaddr.ra.v = Address of binary stream
!! 
!EXTERNAL  uis$execute
!! 
!!   vd_id = UIS$EXECUTE_DISPLAY(buflen, bufaddr)
!! 
!!     Creates a virtual display and executes a
!! binary generic encoding stream
!! 
!! vd_id.rl.r = Virtual display ID
!! buflen.rl.r = Length of binary stream in bytes
!! bufaddr.ra.v = Address of binary stream
!! 
!INTEGER*4 uis$execute_display
!EXTERNAL  uis$execute_display
!! 
!!  UIS$EXPAND_ICON (wd_id, [icon_wd_id,] [attributes])
!! 
!!    Get rid of the icon and restore the desired viewport from
!!    its hidden state.
!! 
!! wd_id.rl.r = Window identifier for the viewport to be
!! restored.
!! icon_wd_id.rl.r = (Optional) Window identifier for the icon
!! to be deleted.
!! attributes.ra.v = (Optional) Window attribute list for
!! viewport placement.
!!
%external %routine %spec UIS EXPAND ICON %alias "UIS$EXPAND_ICON" -
         (%integer %name WD ID, ICON ID, Attributes)

!EXTERNAL  uis$expand_icon
!! 
!!   UIS$EXTRACT_HEADER (obj_id [,[buflen, [bufaddr],
!! [retlen]])
!! 
!!     This routine encodes the header and returns the
!! encoding in the specified buffer.
!! 
!! vd_id.rl.r = Virtual display ID
!! buflen.wl.r = (optional) Address of user data buffer.
!! bufaddr.ra.v = (optional) Address of user buffer.
!! retlen.wl.r = (optional) Address to return length of private data buf.
!! 
!! 
!EXTERNAL  uis$extract_header
!! 
!!   UIS$EXTRACT_OBJECT (obj_id [,[buflen, [bufaddr],
!! [retlen]])
!! 
!!     This routine encodes the specified object and returns the
!! encoding in the specified buffer.
!! 
!! obj_id.rl.r = SEG or OTP ID
!! buflen.wl.r = (optional) Address of user data buffer.
!! bufaddr.ra.v = (optional) Address of user buffer.
!! retlen.wl.r = (optional) Address to return length of private data buf.
!! 
!! 
!EXTERNAL  uis$extract_object
!! 
!!   UIS$EXTRACT_PRIVATE(obj_id,[[buflen], [bufaddr], [retlen]])
!! 
!!     Return private date from the specified object.
!! 
!! obj_id.rl.r = SEG or OTP ID
!! buflen.wl.r = (optional) Address of user data buffer.
!! bufaddr.ra.v = (optional) Address of user buffer.
!! retlen.wl.r = (optional) Address to return length of private data buf.
!! 
!! 
!EXTERNAL  uis$extract_private
!! 
!!   UIS$EXTRACT_REGION (vd_id [, x1, y1, x2, y2]
!! [,buflen] [,bufaddr] [,retlen])
!! 
!!     Fills the specified buffer with the UIS encoding
!!     for the specified region.
!! 
!! vd_id.rl.r = VD ID
!! x1.rf.r,y1.rf.r,x2.rf.r,y2.rf.r = Bounds of rectangle
!! buflen.rl.r = (optional) buffer length byte count
!! bufaddr.ra.r = (optional) buffer address
!! retlen.wl.r = (optional) returned buffer byte count
!! 
!! 
!EXTERNAL  uis$extract_region
!! 
!!   UIS$EXTRACT_TRAILER (obj_id [,[buflen, [bufaddr],
!! [retlen]])
!! 
!!     This routine encodes the trailer and returns the
!! encoding in the specified buffer.
!! 
!! vd_id.rl.r = Virtual display ID
!! buflen.wl.r = (optional) Address of user data buffer.
!! bufaddr.ra.v = (optional) Address of user buffer.
!! retlen.wl.r = (optional) Address to return length of private data buf.
!! 
!! 
!EXTERNAL  uis$extract_trailer
!! 
!!   obj_id.rl.r = UIS$FIND_PRIMITIVE(vd_id, x1, y1, x2, y2,
!! [context], [extent_array])
!! 
!!     Find the next primitive which intersects the specified rectangle.
!! 
!! vd_id.rl.r = Virtual display ID
!! x1.rf.r,y1.rf.r,x2.rf.r,y2.rf.r = Bounds of rectangle
!! context.rl.r = (optional) context longword
!! extent.ra.v = (optional) Address of user extent array.
!! 
!! obj_id.rl.r = Object ID
!! 
!INTEGER*4 uis$find_primitive
!EXTERNAL  uis$find_primitive
!! 
!!   obj_id.rl.r = UIS$FIND_SEGMENT(vd_id, x1, y1, x2, y2,
!! [context], [extent_array])
!! 
!!     Find the next segment which intersects the specified rectangle.
!! 
!! vd_id.rl.r = Virtual display ID
!! x1.rf.r,y1.rf.r,x2.rf.r,y2.rf.r = Bounds of rectangle
!! context.rl.r = (optional) context longword
!! extent.ra.v = (optional) Address of user extent array.
!! 
!! obj_id.rl.r = Object ID
!! 
!INTEGER*4 uis$find_segment
!EXTERNAL  uis$find_segment
!! 
!!   UIS$GET_ABS_POINTER_POS (devnam, retx, rety)
!! 
!!     Gets the current mouse position in absolute coordinates
!! 
!! devnam.rt.dx = Device name descriptor
!! retx.wf.r, rety.wf.r = Address to return X,Y coordinates in cms
!! 
!EXTERNAL  uis$get_abs_pointer_pos
!!   UIS$GET_ALIGNED_POSITION (vd_id, atb, retx,rety)
!! 
!!     Get the current text position, which is used when writing
!!     text.  The position refers to the upper left corner of the
!!     text.
!! 
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Attribute block number
!! retx.wf.r, rety.wf.r = X,Y position (F floating)
!! 
%external %routine %spec UIS SET ALIGNED POSITION -
                                 %alias "UIS$SET_ALIGNED_POSITION" -
                   (%integer %name VD ID, ATB,
                    %real %name x, y)
!EXTERNAL  uis$get_aligned_position
!! 
!!   arc_type = UIS$GET_ARC_TYPE (vd_id, atb)
!! 
!!     Gets the current arc type.
!! 
!! arc_type.wl.v = Arc type code (return value)
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! 
!INTEGER*4 uis$get_arc_type
!EXTERNAL  uis$get_arc_type
!! 
!!   index.wl.v = UIS$GET_BACKGROUND_INDEX (vd_id, atb)
!! 
!!     Gets the text and graphics background color index.
!! 
!! index.wl.v = Color map index (return value)
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! 
!INTEGER*4 uis$get_background_index
!EXTERNAL  uis$get_background_index
!! 
!!   status.wl.r = UIS$GET_BUTTONS (wd_id, retstate)
!! 
!!     Gets the current mouse button state.
!! 
!!     Returns true/false if mouse is within the window
!! wd_id.rl.r = Display window ID
!! retstate.wl.r = Address to return button state in
!! 
!BYTE      uis$get_buttons
!EXTERNAL  uis$get_buttons
%external %predicate %spec UIS GET BUTTONS %alias "UIS$GET_BUTTONS" -
                      (%integer %name WD ID,retstate)
!! 
!!   angle.wf.r = UIS$GET_CHAR_ROTATION (vd_id, atb)
!! 
!!     Sets the angle of the character relative to text path
!! 
!! angle.wf.r = Current character rotation angle
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!REAL*4    uis$get_char_rotation
!EXTERNAL  uis$get_char_rotation
!! 
!!   UIS$GET_CHAR_SIZE (vd_id, atb, char, width, height)
!! 
!!     Sets an additional amount of text spacing.
!! 
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! char.wt.dx = Character on which to base size
!! width.wf.r = Width of example character
!! height.wf.r = Height to make example character
!! 
!BYTE      uis$get_char_size
!EXTERNAL  uis$get_char_size
%external %integer %function %spec UIS GetChar Size %alias "UIS$GET_CHAR_SIZE" -
                    (%integer %name VD ID,ATB,
                     %record (DSC FM) %name Char,
                     %real %name Width,Height)
!! 
!!   angle.wf.r = UIS$GET_CHAR_SLANT (vd_id, atb)
!! 
!!     Gets the slant of characters (0=rectangular characters)
!! 
!! angle.wf.r = Current character slant angle
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!REAL*4    uis$get_char_slant
!EXTERNAL  uis$get_char_slant
!! 
!!   UIS$GET_CHAR_SPACING (vd_id, atb, dx, dy)
!! 
!!     Gets additional amount of text spacing.
!! 
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! dx.wf.r = Additional X spacing factor (0 if none)
!! dy.wf.r = Additional Y spacing factor (0 if none)
!! 
!EXTERNAL  uis$get_char_spacing
!! 
!!   UIS$GET_CLIP (vd_id, atb [,x1, y1, x2, y2])
!! 
!!     Gets a user clipping rectangle.
!! 
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! x1.wf.r, y1.wf.r = X,Y position of lower left corner (F floating)
!! x2.wf.r, y2.wf.r = X,Y position of upper right corner (F floating)
!! 
!BYTE      uis$get_clip
!EXTERNAL  uis$get_clip
!! 
!!   UIS$GET_COLOR (vd_id, index, retR, retG, retB [,wd_id])
!! 
!!     Gets the RGB color values from a color map.
!! 
!! vd_id.rl.r = Virtual display ID
!! index.rl.r = Color map index
!! retR.wrf.r = Red color value
!! retG.wf.r = Green color value
!! retB.wf.r = Blue color value
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$get_color
!! 
!!   UIS$GET_COLORS (vd_id, index, count, R_vector, G_vector, B_vector [,wd_id])
!! 
!!     Gets multiple RGB color values from a color map.
!! 
!! vd_id.rl.r = Virtual display ID
!! index.rl.r = First color map index
!! count.rl.r = Number of indices
!! R_vector.wrf.r = Red color values
!! G_vector.wf.r = Green color values
!! B_vector.wf.r = Blue color values
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$get_colors
!! 
!!   seg_id.rl.r = UIS$GET_CURRENT_OBJECT (vd_id)
!! 
!! obj_id.rl.r = Segment or primitive ID
!! vd_id.rl.r = Virtual display ID
!! 
!!     Get current graphics object id.
!! 
!INTEGER*4 uis$get_current_object
!EXTERNAL  uis$get_current_object
!! 
!!   UIS$GET_DISPLAY_SIZE (devnam, retwidth, retheight,
!! [retresolx,retresoly],
!! [retpwidth, retpheight])
!! 
!!     Gets the size of the physical display in cms
!! 
!! devnam.rt.dx = Device name descriptor
!! retwidth.wf.r, retheight.wf.r = Address to return width,height (F floating)
!! retresolx.wf.r, retresoly.wf.r = (Optional) Address to return X,Y
!! resolution, in pixels/cm (F floating)
!! retpwidth.wl.r, retpheight.wl.r = Address to return width,height in pixels
!! 
%external %routine %spec UIS GET DISPLAY SIZE %alias "UIS$GET_DISPLAY_SIZE" -
                    (%record (DSC FM) %name DEVNAM,
                     %real %name retwidth,retheight,
                                 retresolx,retresoly,
                     %integer %name retpwidth,retpheight)
!EXTERNAL  uis$get_display_size
!! 
!!   boolean = UIS$GET_FILL_PATTERN (vd_id, atb,[index])
!! 
!!     Gets the fill pattern index.
!! 
!! Returns true/false if the fill pattern is in the attribute block
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! index.wl.r = Index of fill pattern
!! 
!BYTE      uis$get_fill_pattern
!EXTERNAL  uis$get_fill_pattern
!! 
!!   UIS$GET_FONT (vd_id, atb, bufferdesc, [length])
!! 
!!     Gets a font from an attribute block.
!! 
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! bufferdesc.wt.dx = Font ID buffer descriptor
!! length.ww.r = Length of string written into specified buffer
!! 
!EXTERNAL  uis$get_font
!! 
!!   UIS$GET_FONT_ATTRIBUTES (font_id, ascender, descender, height
!! [,maximum_width] [,item_list]
!! 
!!     Gets a font from an attribute block.
!! 
!! font_id.rt.dx = Font ID descriptor
!! ascender.wl.r = ascender height
!! descender.wl.r = descender height
!! height.wl.r = global cell height
!! maximum_width.wl.r = width of the widest character
!! item_list.ra.v = an item list of fields to return
!! 
%external %routine %spec UIS Get Font Attributes -
                                          %alias "UIS$GET_FONT_ATTRIBUTES" -
                     (%record (DSC FM) %name Font Id,
                      %integer %name Ascender, Descender, Height,
                                     Maximum Width, Item List)
!EXTERNAL  uis$get_font_attributes
!! 
!!   UIS$GET_FONT_SIZE (fontid, text_string, retwidth,retheight)
!! 
!!     Gets the size of a font's characters in cms
!! 
!! fontid.rt.dx = Font ID string descriptor
!! text_string.rt.dx = Character string descriptor
!! retwidth.wf.r, retheight.wf.r = Address to return width,height (F floating)
!! 
!EXTERNAL  uis$get_font_size
!! 
!!  uis$get_hw_color_info (devnam: REF $BBLOCK, type, indices, colors, maps,
!! rbits, gbits, bbits, ibits, res_indices, regen): NOVALUE =
!! 
!! 
!! Return information about hardware color characteristics.
!! 
!!  Inputs:
!! 
!! Address of device name descriptor (defaults to SYS$WORKSTATION)
!! 
!! (The rest, all longwords, passed by reference.)
!! 
!! 
%external %routine %spec UIS Get HW Color Info %alias "UIS$GET_HW_COLOR_INFO" -
                    (%record (DSC FM) %name DEVNAM,
                     %integer %name type,indices,colors,maps,rbits,gbits,bbits,
                      ibits,res indices,regen)
!EXTERNAL  uis$get_hw_color_info
!! 
!!   UIS$GET_INTENSITIES (vd_id, index, count, I_vector [,wd_id])
!! 
!!     Gets ultiple achromatic intensity values from a color map.
!! 
!! vd_id.rl.r = Virtual display ID
!! index.rl.r = First color map index
!! count.rl.r = Number of indices
!! I_vector.wf.r = Achromatic intensity values
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$get_intensities
!! 
!!   UIS$GET_INTENSITY (vd_id, index, retI [,wd_id])
!! 
!!     Gets the achromatic intensity value from a color map.
!! 
!! vd_id.rl.r = Virtual display ID
!! index.rl.r = Color map index
!! retI.wf.r = Achromatic intensity value
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$get_intensity
!! 
!!   UIS$GET_KB_ATTRIBUTES (kb_id, [enable_items,]
!! [disable_items,] [click_volume])
!! 
!!     Returns keyboard characteristics.
!! 
!! kb_id.rl.r = Virtual keyboard ID
!! enable_items.wl.r = Mask of enabled characteristics
!! disable_items.wl.r = Mask of disabled characteristics
!! click_volume.wl.r = Click volume level
!! 
!! 
!EXTERNAL  uis$get_kb_attributes
!! 
!!   x = UIS$GET_LEFT_MARGIN (vd_id, atb)
!! 
!!     Gets the left margin for writing text.
!! 
!! x.wf.v = X coordinate of left margin (return value)
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! 
!REAL*4    uis$get_left_margin
!EXTERNAL  uis$get_left_margin
!! 
!!   style = UIS$GET_LINE_STYLE (vd_id, atb)
!! 
!!     Gets the default line style
!! 
!! style.wl.v = line style bitvector (return value)
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! 
!INTEGER*4 uis$get_line_style
!EXTERNAL  uis$get_line_style
!! 
!!   width = UIS$GET_LINE_WIDTH (vd_id, atb [,mode])
!! 
!!     Gets the default line width
!! 
!! width.wf.v = Line width
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! mode.wl.r  = (optional) line width specification mode
!! 
!REAL*4    uis$get_line_width
!EXTERNAL  uis$get_line_width
!! 
!!   next_obj_id.rl.r = UIS$GET_NEXT_OBJECT (obj_id, [flags])
!! 
!!     Get the object id of the object following the specified object.
!! 
!! obj_id.rl.r = Object ID
!! flags.rl.r = (optional) Flags
!! 
!! next_obj_id.rl.r = ID of next object
!! 
!INTEGER*4 uis$get_next_object
!EXTERNAL  uis$get_next_object
!! 
!!   obj_type.rl.r = UIS$GET_OBJECT_ATTRIBUTES (obj_id, [extent_array])
!! 
!!     Get the attributes of the specified object.
!! 
!! obj_id.rl.r = Object ID
!! extent.ra.v = (optional) Address of user extent array.
!! 
!! obj_type.rl.r = Object type code
!! 
!INTEGER*4 uis$get_object_attributes
!EXTERNAL  uis$get_object_attributes
!! 
!!   PARENT_ID = UIS$GET_PARENT_SEGMENT (vd_id)
!! 
!!     Gets the root segment id.
!! 
!! vd_id.rl.r = Virtual display ID
!! 
!! parent_id.rl.r = Parent segment ID
!! 
!INTEGER*4 uis$get_parent_segment
!EXTERNAL  uis$get_parent_segment
!! 
!!   status.wl.v = UIS$GET_POINTER_POSITION (vd_id, wd_id, retx, rety)
!! 
!!     Gets the current mouse position in world coordinates
!! 
!!     Returns true/false if mouse is within the window
!! vd_id.rl.r = Virtual display ID
!! wd_id.rl.r = Display window ID
!! retx.wf.r, rety.wf.r = Address to return X,Y world coordinates
!! 
!! 
!BYTE      uis$get_pointer_position
!EXTERNAL  uis$get_pointer_position
%external %predicate %spec UIS GET POINTER POSITION %alias "UIS$GET_POINTER_POSITION" -
                      (%integer %name VD ID,WD ID,
                       %real %name retx,rety)
!! 
!!   UIS$GET_POSITION (vd_id, retx,rety)
!! 
!!     Gets the current text position.  The position refers
!!     to the baseline of the text.
!! 
!! vd_id.rl.r = Virtual display ID
!! retx.wf.r, rety.wf.r = Address to return X,Y position (F floating)
!! 
!EXTERNAL  uis$get_position
%external %routine %spec UIS GET POSITION %alias "UIS$GET_POSITION" -
                    (%integer %name VD ID,
                     %real %name retx,rety)
!! 
!!   previous_obj_id.rl.r = UIS$GET_PREVIOUS_OBJECT (obj_id, [flags])
!! 
!!     Get the object id of the object before the specified object.
!! 
!! obj_id.rl.r = Object ID
!! flags.rl.r = (optional) Flags
!! 
!! previous_obj_id.rl.r = ID of previous object
!! 
!INTEGER*4 uis$get_previous_object
!EXTERNAL  uis$get_previous_object
!! 
!!   ROOT_ID = UIS$GET_ROOT_SEGMENT (vd_id)
!! 
!!     Gets the root segment id.
!! 
!! vd_id.rl.r = Virtual display ID
!! 
!! root_id.rl.r = Root segment ID
!! 
!INTEGER*4 uis$get_root_segment
!EXTERNAL  uis$get_root_segment
!! 
!!  UIS$GET_TB_INFO (devnam,retwidth, retheight,
!!    reresolx, retresoly,
!!    [retpwidth, retpheight])
!!  Get tablet characteristics
!! 
!!  devnam.rt.dx
!! retwidth.wf.r
!! retheight.wf.r
!! retresolx.wf.r
!! retresoly.wf.r
!! retpwidth.wl.r
!! retpheight.wl.r
!! 
!BYTE      uis$get_tb_info
!EXTERNAL  uis$get_tb_info
!! 
!!  UIS$GET_TB_POSITION (wd_id, retx, rety)
!! 
!!  Get tablet position
!!  wd_id.rl.r
!!  retx.wf.r
!!  rety.wf.r
!! 
!EXTERNAL  uis$get_tb_position
!! 
!!  mode = uis$get_text_formatting (vd_id, atb)
!! 
!! 
!!      Get formatting mode (normal, justify, center)
!! 
!!  Inputs:
!! 
!!  vd_id.rl.r = Virtual Display ID
!!  atb.rl.r = Input attribute block number
!! 
!!  Outputs:
!! 
!! mode.wl.r = Formatting mode (UIS$C_TEXT_FORMAT_xxxxx)
!! 
!INTEGER*4 uis$get_text_formatting
!EXTERNAL  uis$get_text_formatting
!! 
!!  uis$get_text_margins (vd_id, atb, x, y, margin_length)
!! 
!! 
!!      Get text margins used for text formatting.
!! 
!!  Inputs:
!! 
!!  vd_id.rl.r = Virtual Display ID
!!  atb.rl.r = Input attribute block number
!!  x,y.wf.r = (optional) X and Y coordinate of starting position
!! margin_length.wf.r = (optional) Distance to ending margin
!! 
!EXTERNAL  uis$get_text_margins
!! 
!!   UIS$GET_TEXT_PATH (vd_id, atb, major, minor)
!! 
!!     Gets the text paths.
!! 
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! major.wl.r = Major text path
!! minor.wl.r = Minor text path
!! 
!EXTERNAL  uis$get_text_path
!! 
!!   angle.wf.r = UIS$GET_TEXT_SLOPE (vd_id, atb)
!! 
!!     Gets the angle of text slope
!! 
!! angle.wf.r = Current text slope angle
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!REAL*4    uis$get_text_slope
!EXTERNAL  uis$get_text_slope
!! 
!!  uis$get_vcm_id (vd_id) =
!! 
!! 
!! 
!! Return the virtual color map ID for the given virtual display.
!! 
!!  Inputs:
!! 
!! Virtual display ID
!! 
!!  Outputs:
!! 
!! Virtual color map ID
!! 
!! 
!INTEGER*4 uis$get_vcm_id
!EXTERNAL  uis$get_vcm_id
!! 
!!   boolean = UIS$GET_VIEWPORT_ICON (wd_id, icon_wd_id)
!! 
!!     Returns a boolean value indicating whether the viewport has been
!!     shrunk.  The wd_id for the viewport's icon is optionally returned,
!!     if it exists.
!! 
!! wd_id.rl.r = Display window ID
!! icon_wd_id.wl.r = (optional) Address of variable to receive the
!! icon's wd_id
!! boolean.wf.v = True, if window was shrunk to an icon, false
!! otherwise.
!! 
!BYTE      uis$get_viewport_icon
!EXTERNAL  uis$get_viewport_icon
!!   UIS$GET_VIEWPORT_POSITION (wd_id, retx, rety)
!! 
!!     Gets the absolute position of the viewport's lower left corner
!!     as measured in cms from the lower left corner of the display.
!! 
!! wd_id.rl.r = Display window ID
!! retx.wf.r, rety.wf.r = Address to return x,y (F floating cms)
!! 
!EXTERNAL  uis$get_viewport_position
!! 
!!   UIS$GET_VIEWPORT_SIZE (wd_id, retwidth, retheight)
!! 
!!     Gets the size of the viewport in cms
!! 
!! wd_id.rl.r = Display window ID
!! retwidth.wf.r, retheight.wf.r = Address to return width,height (F floating)
!! 
!EXTERNAL  uis$get_viewport_size
%external %routine %spec UIS Get Viewport Size %alias "UIS$GET_VIEWPORT_SIZE" -
                    (%integer %name VD ID,
                     %real %name Retwidth,Retheight)
!! 
!!   boolean = UIS$GET_VISIBILITY(vd_id, wd_id, [,x1, y1 [,x2 ,y2]])
!! 
!!     Returns whether the specified rectangle in the display
!!     window is completely visible or not.
!! 
!!     Returns true/false visibility status
!! vd_id.rl.r = Virtual display ID
!! wd_id.rl.r = Display window ID
!! x1.rf.r,y1.rf.r = World coordinates of one corner
!! x2.rf.r,y2.rf.r = World coordinates of other corner
!! 
!BYTE      uis$get_visibility
!EXTERNAL  uis$get_visibility
!! 
!!   mask = UIS$GET_WINDOW_ATTRIBUTES(wd_id)
!! 
!!     Returns a mask containing the attributes of the specified
!!     window.
!! 
!! mask.wl.v = Mask of window attributes (return value)
!! wd_id.rl.r = Display window ID
!! 
!INTEGER*4 uis$get_window_attributes
!EXTERNAL  uis$get_window_attributes
!! 
!!   UIS$GET_WINDOW_SIZE (vd_id, wd_id, x1,y1,x2,y2)
!! 
!!     Gets the window bounds in WC.
!! 
!! vd_id.rl.r = Virtual display ID
!! wd_id.rl.r = Display window ID
!! x1,y1,x2,y2.wf.r = Address to return WC bounds (F floating)
!! 
!EXTERNAL  uis$get_window_size
!! 
!!   index.wl.v = UIS$GET_WRITING_INDEX (vd_id, atb)
!! 
!!     Gets the text and graphics writing color index.
!! 
!! index.wl.v = Color map index (return value)
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! 
!INTEGER*4 uis$get_writing_index
!EXTERNAL  uis$get_writing_index
!! 
!!   mode = UIS$GET_WRITING_MODE (vd_id, atb)
!! 
!!     Gets the text and graphics writing mode.
!! 
!! mode.wl.v = Number of the mode (return value)
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Input attribute block number
!! 
!INTEGER*4 uis$get_writing_mode
!EXTERNAL  uis$get_writing_mode
!! 
!!   UIS$GET_WS_COLOR (vd_id, color_id, retR, retG, retB, [wd_id])
!! 
!!     Gets the RGB color values for a workstation standard color.
!! 
!! vd_id.rl.r = Virtual display ID
!! color_id.rl.r = WS color ID
!! retR.wrf.r = Red color value
!! retG.wf.r = Green color value
!! retB.wf.r = Blue color value
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$get_ws_color
!! 
!!   UIS$GET_WS_INTENSITY (vd_id, color_id, retI, [wd_id])
!! 
!!     Gets the achromatic intensity value for a workstation standard color.
!! 
!! vd_id.rl.r = Virtual display ID
!! color_id.rl.r = WS color ID
!! retI.wf.r = Achromatic intensity value
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$get_ws_intensity
!! 
!!   UIS$HLS_to_RGB (H, L, S, R, G, B)
!! 
!!     Convert HLS color to RGB color
!! 
!EXTERNAL  uis$hls_to_rgb
!! 
!!   UIS$HSV_to_RGB (H, S, V, R, G, B)
!! 
!!     Convert HSV color to RGB color
!! 
!EXTERNAL  uis$hsv_to_rgb
!! 
!!   UIS$IMAGE (vd_id, atb,x1,y1,x2,y2,
!! rasterwidth,rasterheight,bitsperpixel,
!! rasteraddr)
!! 
!!     Write a natural image bitmap into the specified virtual
!!     display rectangle given by the two corners.  If the size
!!     of the bitmap doesn't match the rectangle, scaling is done.
!! 
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Attribute block number
!! x1.rf.r, y1.rf.r = X,Y position of one rectangle corner (F floating)
!! x2.rf.r, y2.rf.r = X,Y position of other corner (F floating)
!! rasterwidth.rl.r = Width of image bitmap in pixels
!! rasterheight.rl.r = Height of image bitmap in pixels
!! bitsperpixel.rl.r = Number of image bits which make up 1 "pixel"
!! rasteraddr.ra.v = Address of natural image data
!! 
!EXTERNAL  uis$image
!! 
!!   UIS$INSERT_OBJECT (obj_id)
!! 
!!     Moves the specified object to the current position
!!     position in the display list.
!! 
!! obj_id.rl.r = Object ID
!! 
!EXTERNAL  uis$insert_object
!! 
!!   UIS$LINE (vd_id, atb,x1,y1[,x2,y2,...])
!! 
!!     Plot point or disconnected lines
!! 
!! vd_id.rl.r = Virtual display ID
!!       atb.rl.r = Attribute block number
!!       x1.rf.r, y1.rf.r = x,y coordinates (F floating), repeated
!! 
!EXTERNAL  uis$line
%external %routine %spec UIS LINE %alias "UIS$LINE" -
                   (%integer %name VD ID,ATB,
                    %real %name x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8)
!! 
!!   UIS$LINE_ARRAY (vd_id, atb, count,x_vector,y_vector)
!! 
!!     Plot point or disconnected lines
!! 
!! vd_id.rl.r = Virtual display ID
!!       atb.rl.r = Attribute block number
!! count.rl.r = Number of points
!!       x_vector.rf.ra = Address of array of x coordinates (F floating)
!!       y_vector.rf.ra = Address of array of y coordinates (F floating)
!! 
!EXTERNAL  uis$line_array
%external %routine %spec UIS LINE ARRAY %alias "UIS$LINE_ARRAY" -
                   (%integer %name VD ID,ATB,COUNT,
                    %real %name x1,y1)
!! 
!!   UIS$MEASURE_TEXT (vd_id, atb, text_string, retwidth,retheight
!! [,ctllist, ctllen] [,posarray])
!! 
!!     Gets the width and height of a text string in world coordinates
!! 
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = attribute block number number
!! text_string.rt.dx = Character string descriptor
!! retwidth.wf.r, retheight.wf.r = Address to return width, height (F floating)
!! ctllist.ra.v = control list array
!! ctllen.rl.r = length of ctllist in longwords
!! posarray.wa.v = position array
!! 
!EXTERNAL  uis$measure_text
!! 
!!   UIS$MOVE_AREA (vd_id, x1,y1,x2,y2,new_x,new_y)
!! 
!!     Moves the region specified by the given rectangle to
!!     another place in the virtual display.
!! 
!! vd_id.rl.r = Virtual display ID
!! x1.rf.r, y1.rf.r = X,Y position of one rectangle corner (F floating)
!! x2.rf.r, y2.rf.r = X,Y position of other corner (F floating)
!! new_x.rf.r, new_y.rf.r = New X,Y origin for rectangle (F floating)
!! 
%external %routine %spec UIS MOVE AREA %alias "UIS$MOVE_AREA" -
                   (%integer %name VD ID,
                    %real %name x1, y1, x2, y2,
                    %real %name new x, new y)
!EXTERNAL  uis$move_area
!! 
!!   UIS$MOVE_VIEWPORT (wd_id, attributes)
!! 
!!     Move a display viewport to another position on the physical display.
!! 
!! wd_id.rl.r = Display window ID
!! attributes.rl.r = Display window attribute list
!! 
!EXTERNAL  uis$move_viewport
!! 
!!   UIS$MOVE_WINDOW (vd_id,wd_id,x1,y1,x2,y2)
!! 
!!     Move a display window to another position in the virtual display.
!! 
!! vd_id.rl.r = Virtual display ID
!! wd_id.rl.r = Display window ID
!! x1.rf.r, y1.rf.r = One corner of the window rectangle (F floating)
!! x2.rf.r, y2.rf.r = Other corner of the window rectangle (F floating)
!! 
!EXTERNAL  uis$move_window
%external %routine %spec UIS MOVE WINDOW %alias "UIS$MOVE_WINDOW" -
                    (%integer %name VD ID,WD ID,
                     %real %name x1,y1,x2,y2)
!! 
!!   UIS$NEW_TEXT_LINE (vd_id, atb)
!! 
!!     Format the current text line, and position to next text line
!! 
!!   vd_id.rl.r = Virtual display ID
!! atb.rl.r = Attribute block number
!! 
!EXTERNAL  uis$new_text_line
!! 
!!   UIS$PLOT (vd_id, atb,x1,y1[,x2,y2,...])
!! 
!!     Plot point or line(s)
!! 
!! vd_id.rl.r = Virtual display ID
!!       atb.rl.r = Attribute block number
!!       x1.rf.r, y1.rf.r = x,y coordinates (F floating), repeated
!! 
!EXTERNAL  uis$plot
%external %routine %spec UIS PLOT %alias "UIS$PLOT" -
                    (%integer %name VD ID,ATB,
                     %real %name x1,y1,x2,y2,x3,y3,x4,y4)
!! 
!!   UIS$PLOT_ARRAY (vd_id, atb, count,x_vector,y_vector)
!! 
!!     Plot point or line(s)
!! 
!! vd_id.rl.r = Virtual display ID
!!       atb.rl.r = Attribute block number
!! count.rl.r = Number of points
!!       x_vector.rf.ra = Address of array of x coordinates (F floating)
!!       y_vector.rf.ra = Address of array of y coordinates (F floating)
!! 
!EXTERNAL  uis$plot_array
%external %routine %spec UIS PLOT ARRAY %alias "UIS$PLOT_ARRAY" -
                    (%integer %name VD ID,ATB,Count,
                     %real %name x vector,y vector)
!! 
!!   UIS$POP_VIEWPORT (wd_id)
!! 
!!     Pops the window to the top of the screen stacking order.
!! 
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$pop_viewport
!! 
!!  status = UIS$PRESENT (major_version, minor_version)
!! 
!!  Returns true if UIS is installed on the system.
!! 
!!  major_version.ww.r - major version number returned (optional)
!!  minor_version.ww.r - minor version number returned (optional)
!! 
!INTEGER*4 uis$present
!EXTERNAL  uis$present
!! 
!!   UIS$PRIVATE (vd_id, facnum, buffer)
!! 
!!     Write private data in buffer to last seg or otp.
!! 
!! obj_id.rl.r = VD_ID or OBJ_ID
!! facnum.rl.r = Address of facility number
!! buffer.dx.rx = Address of buffer descriptor.
!! 
!EXTERNAL  uis$private
!! 
!!   UIS$PUSH_VIEWPORT (wd_id)
!! 
!!     Pushes the window to the bottom of the screen stacking order.
!! 
!! wd_id.rl.r = Display window ID
!! 
!EXTERNAL  uis$push_viewport
!! 
!!   keybuf = UIS$READ_CHAR (kb_id [,flags])
!! 
!!     Read a single character from the keyboard.
!! 
!! keybuf.wl.v = Word key buffer (return value)
!! kb_id.rl.r = Virtual keyboard ID
!! flags.rl.r = Flags longword
!! 
%external %integer %fn %spec UIS READ CHAR %alias "UIS$READ_CHAR" -
                   (%integer %name VD ID, Flags)
!INTEGER*4 uis$read_char
!EXTERNAL  uis$read_char
!! 
!!  UIS$RESIZE_WINDOW (vd_id, wd_id, [new_abs_x, new_abs_y,]
!!        [new_width, new_height,]
!!        [new_wc_x1, new_wc_y1, new_wc_x2, new_wc_y2])
!! 
!!   Change the size of the window.
!! vd_id.rl.r = Virtual display ID
!! wd_id.rl.r = Display window ID
!!     new_abs_x.rf.r, new_abs_y.rf.r =  Exact X and Y of lower left
!!         corner (in centimeters)
!!     new_width.rf.r, new_height.rf.r = New width and height
!!     new_wc_x1.rf.r, new_wc_y1.rf.r, new_wc_x2.rf.r, new_wc_y2.rf.r
!!     = New world coordinates.
!! 
!! 
!EXTERNAL  uis$resize_window
%external %routine %spec UIS Resize Window %alias "UIS$RESIZE_WINDOW" -
                    (%integer %name VD ID,WD ID,
                     %real %name New Abs X,New Abs Y,
                                 New Width,New Height,
                                 New WC X1,New WC Y1,
                                 New WC X2,New WC Y2)
!! 
!!  uis$restore_cms_colors (cms_id): NOVALUE =
!! 
!! 
!! Restore CMS colors to hardware
!! 
!!  Inputs:
!! 
!! cms_id.rl.r = Color map segment ID
!! 
!!  Outputs:
!! 
!! NONE
!! 
!EXTERNAL  uis$restore_cms_colors
!! 
!!   UIS$SET_ADDOPT_AST (wd_id, astadr, astprm)
!! 
!!     Enable ASTs for additional options
!! 
!! wd_id.rl.r = Display window ID
!! astadr.ra.v = AST routine address
!! astprm.rl.r = AST parameter
!! 
!EXTERNAL  uis$set_addopt_ast
!! 
!!   UIS$SET_ALIGNED_POSITION (vd_id, atb, x,y)
!! 
!!     Set the current text position, which is used when writing
!!     text.  The position refers to the upper left corner of the
!!     first character.
!! 
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Attribute block number
!! x.rf.r, y.rf.r = X,Y position (F floating)
!! 
!EXTERNAL  uis$set_aligned_position
!! 
!!   UIS$SET_ARC_TYPE (vd_id, iatb, oatb, arc_type)
!! 
!!     Sets the default arc type
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! arc_type.rl.r = Method to be used for closing arcs
!! 
!EXTERNAL  uis$set_arc_type
!! 
!!   UIS$SET_BACKGROUND_INDEX (vd_id, iatb, oatb, index)
!! 
!!     Sets the text and graphics background color index.
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! index.rl.r = Color map index
!! 
%external %routine %spec UIS Set Background Index %alias "UIS$SET_BACKGROUND_INDEX" -
                    (%integer %name VD ID,IATB,OATB,INDEX)
!EXTERNAL  uis$set_background_index
!! 
!!   UIS$SET_BUTTON_AST (vd_id, wd_id, [astadr, astprm,] [keybuf,]
!! [x1,y1,x2,y2])
!! 
!!     Setup a region to intercept mouse button transitions
!! 
!! vd_id.rl.r = Virtual display ID
!! wd_id.rl.r = Display window ID
!! astadr.ra.v = AST routine address
!! astprm.rl.r = AST parameter
!! keybuf.wl.r = Longword to receive button information
!! x1.rf.r,y1.rf.r,x2.rf.r,y2.rf.r = Bounds of rectangle (F floating)
!! 
!EXTERNAL  uis$set_button_ast
%external %routine %spec UIS SET BUTTON AST %alias "UIS$SET_BUTTON_AST" -
                    (%integer %name VD ID,WD ID,
                     %record (AST Fm) %name astadr,astprm,
                     %integer %name keybuf,
                     %real %name x1,y1,x2,y2)
!!   UIS$SET_CHAR_ROTATION (vd_id, iatb, oatb, angle)
!! 
!!     Sets the angle of the character relative to text path
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! angle.rf.r = Character rotation angle
!EXTERNAL  uis$set_char_rotation
%external %routine %spec UIS Set Char Rotation %alias "UIS$SET_CHAR_ROTATION" -
                    (%integer %name VD ID,IATB,OATB,
                     %real %name Angle)
!! 
!!   UIS$SET_CHAR_SIZE (vd_id, iatb, oatb, char, width, height)
!! 
!!     Sets an additional amount of text spacing.
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! char.rt.dx = Character on which to base size
!! width.rf.r = Width of example character
!! height.rf.r = Height to make example character
!! 
!EXTERNAL  uis$set_char_size
%external %routine %spec UIS Set Char Size %alias "UIS$SET_CHAR_SIZE" -
                    (%integer %name VD ID,IATB,OATB,
                     %record (DSC FM) %name char,
                     %real %name width,height)
!! 
!!   UIS$SET_CHAR_SLANT (vd_id, iatb, oatb, angle)
!! 
!!     Sets the slant of characters (to make italics)
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Input attribute block number
!! angle.rf.r = Angle to set slant to
!EXTERNAL  uis$set_char_slant
%external %routine %spec UIS Set Char Slant %alias "UIS$SET_CHAR_SLANT" -
                    (%integer %name VD ID,Iatb,oatb,
                     %real %name angle)
!! 
!!   UIS$SET_CHAR_SPACING (vd_id, iatb, oatb, dx,dy)
!! 
!!     Sets an additional amount of text spacing.
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! dx.rf.r = Additional X spacing factor (0 if none)
!! dy.rf.r = Additional Y spacing factor (0 if none)
!! 
!EXTERNAL  uis$set_char_spacing
!! 
!!   UIS$SET_CLIP (vd_id, iatb,oatb [,x1,y1,x2,y2])
!! 
!!     Sets a user clipping rectangle.
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! x1.rf.r, y1.rf.r = X,Y position of lower left corner (F floating)
!! x2.rf.r, y2.rf.r = X,Y position of upper right corner (F floating)
!! 
!EXTERNAL  uis$set_clip
!! 
!!   UIS$SET_CLOSE_AST (wd_id, astadr, astprm)
!! 
!!     Enable close notification ASTs
!! 
!! wd_id.rl.r = Display window ID
!! astadr.ra.v = AST routine address
!! astprm.rl.r = AST parameter
!! 
!EXTERNAL  uis$set_close_ast
!! 
!!   UIS$SET_COLOR (vd_id, index, R, G, B)
!! 
!!     Sets the RGB color values into a color map.
!! 
!! vd_id.rl.r = Virtual display ID
!! index.rl.r = Color map index
!! R.rf.r = Red color value
!! G.rf.r = Green color value
!! B.rf.r = Blue color value
!! 
!EXTERNAL  uis$set_color
!! 
!!   UIS$SET_COLORS (vd_id, index, count, R_vector, G_vector, B_vector)
!! 
!!     Sets multiple RGB color values into a color map.
!! 
!! vd_id.rl.r = Virtual display ID
!! index.rl.r = First color map index
!! count.rl.r = Number of indices
!! R_vector.rf.r = Red color values
!! G_vector.rf.r = Green color values
!! B_vector.rf.r = Blue color values
!! 
%external %routine %spec UIS Set Colors %alias "UIS$SET_COLORS" -
                    (%integer %name WD ID,index,count,
                     %real %name r vector,g vector,b vector)
!EXTERNAL  uis$set_colors
!! 
!!   UIS$SET_EXPAND_ICON_AST (wd_id, [astadr,] [astprm])
!! 
!!     Enable an AST which will be sent when the user requests, via the
!!     viewport options menu, that the icon should be restored to a
!!     viewport.  The application cannot disable the abiltiy to restore
!!     viewports from icons; it may reinstate the default behavior by
!!     specifying UIS$C_DEFAULT_EXPAND as the astadr.
!! 
!! 
!! wd_id.rl.r = Display window ID
!! astadr.rl.v = (optional) Address of user AST routine
!! astprm.rl.r = (optional) User AST parameter
!! 
!EXTERNAL  uis$set_expand_icon_ast
!! 
!!   UIS$SET_FILL_PATTERN (vd_id, iatb,oatb, index)
!! 
!!     Sets the fill pattern index.
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! index.rl.r = Index of fill pattern
!! 
!EXTERNAL  uis$set_fill_pattern
%external %routine %spec UIS Set Fill Pattern %alias "UIS$SET_FILL_PATTERN" -
                    (%integer %name VD ID,IATB,OATB,INDEX)
!! 
!!   UIS$SET_FONT (vd_id, iatb, oatb, font_id)
!! 
!!     Associates a font with an attribute block.
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! font_id.rt.dx = Font ID string descriptor
!! 
!EXTERNAL  uis$set_font
%external %routine %spec UIS Set Font %alias "UIS$SET_FONT" -
                    (%integer %name VD ID,IATB,OATB,
                     %record (DSC FM) %name Font Id)
!! 
!!   UIS$SET_GAIN_KB_AST (kb_id, astadr, astprm)
!! 
!!     Enable gain keyboard notification ASTs
!! 
!! kb_id.rl.r = Virtual display ID
!! astadr.ra.v = AST routine address for gaining kbd
!! astprm.rl.r = AST parameter
!! 
!EXTERNAL  uis$set_gain_kb_ast
!! 
!!   UIS$SET_INSERTION_POSITION (obj_id, flags)
!! 
!!     Set the current object position, which is used when writing
!!     new object in the display list.
!! 
!! obj_id.rl.r = Virtual display ID or object ID
!! flags.rl.r = (optionsl) flags longword
!! 
!EXTERNAL  uis$set_insertion_position
!! 
!!   UIS$SET_INTENSITIES (vd_id, index, count, I_vector)
!! 
!!     Sets multiple achromatic intensity values into a color map.
!! 
!! vd_id.rl.r = Virtual display ID
!! index.rl.r = First color map index
!! count.rl.r = Number of indices
!! I_vector.rf.r = Achromatic intensity values
!! 
!EXTERNAL  uis$set_intensities
!! 
!!   UIS$SET_INTENSITY (vd_id, index, I)
!! 
!!     Sets the achromatic intensity value into a color map.
!! 
!! vd_id.rl.r = Virtual display ID
!! index.rl.r = Color map index
!! I.rf.r = Achromatic intensity value
!! 
!EXTERNAL  uis$set_intensity
!! 
!!   UIS$SET_KB_AST (kb_id, astadr, astprm, keybuf)
!! 
!!     Specify single-character keyboard ASTs
!! 
!! kb_id.rl.r = Virtual keyboard ID
!! astadr.ra.v = AST routine address
!! astprm.rl.r = AST parameter
!! keybuf.wl.r = Longword to receive button information
!! 
%external %routine %spec UIS SET KB AST %alias "UIS$SET_KB_AST" -
        (%integer %name KB ID,%record(ASTFM)%name astadr,astprm,
         %integer %name keybuf)
!EXTERNAL  uis$set_kb_ast
!! 
!!   UIS$SET_KB_ATTRIBUTES (kb_id, [enable_items],
!! [disable_items], [click_volume])
!! 
!!     Modify keyboard characteristics.
!! 
!! kb_id.rl.r = Virtual keyboard ID
!! enable_items.rl.r = Mask of characteristics to be enabled
!! disable_items.rl.r = Mask of characteristics to be disabled
!! click_volume.rl.r = Click volume level
!! 
!! 
!EXTERNAL  uis$set_kb_attributes
!! 
!! UIS$SET_KB_COMPOSE2(kb_id [,table,tablelen])
!! 
!! Load a 2-stroke compose table
!! 
!! kb_id.rl.r = Keyboard ID
!! table.ra.v,tablelen.rl.r = address of buffer and its length
!! 
!! 
!EXTERNAL  uis$set_kb_compose2
!! 
!! UIS$SET_KB_COMPOSE3(kb_id [,table,tablelen])
!! 
!! Load a 3-stroke compose table
!! 
!! kb_id.rl.r = Keyboard ID
!! table.ra.v,tablelen.rl.r = address of buffer and its length
!! 
!! 
!EXTERNAL  uis$set_kb_compose3
!! 
!! UIS$SET_KB_KEYTABLE(kb_id [,table,tablelen])
!! 
!! Load a keyboard mapping table
!! 
!! kb_id.rl.r = Keyboard ID
!! table.ra.v,tablelen.rl.r = address of buffer and its length
!! 
!! 
!EXTERNAL  uis$set_kb_keytable
!! 
!!   UIS$SET_LEFT_MARGIN (vd_id, iatb, oatb, x)
!! 
!!     Sets the left margin for writing text.
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! x.rf.r =  Position of left margin
!! 
!EXTERNAL  uis$set_left_margin
!! 
!!   UIS$SET_LINE_STYLE (vd_id, iatb, oatb, style)
!! 
!!     Sets the default line style
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! style.rl.r = 32-bit bitvector whose bits control drawing
!! 
!EXTERNAL  uis$set_line_style
%external %routine %spec UIS Set Line Style %alias "UIS$SET_LINE_STYLE" -
                    (%integer %name VD ID,iatb,oatb,style)
!! 
!!   UIS$SET_LINE_WIDTH (vd_id, iatb, oatb, width [,mode])
!! 
!!     Sets the default line width
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! width.rf.r = Width of lines (1.0 is normal)
!! mode.rl.r = Pixel/world coordinate indicator
!! 
!EXTERNAL  uis$set_line_width
!! 
!!   UIS$SET_LOSE_KB_AST (kb_id [,astadr, astprm])
!! 
!!     Enable lost keyboard notification ASTs
!! 
!! kb_id.rl.r = Virtual display ID
!! astadr.ra.v = AST routine address for losting kbd
!! astprm.rl.r = AST parameter
!! 
!EXTERNAL  uis$set_lose_kb_ast
!! 
!!   UIS$SET_MOVE_INFO_AST (wd_id, [astadr, astprm])
!! 
!!     Enable move notification ASTs
!! 
!! wd_id.rl.r = Display window ID
!! astadr.ra.v = AST routine address
!! astprm.rl.r = AST parameter
!! 
!EXTERNAL  uis$set_move_info_ast
!! 
!!   UIS$SET_POINTER_AST (vd_id, wd_id, [astadr], [astprm],
!! [x1,y1,x2,y2],
!! [exitastadr], [exitastprm])
!! 
!!     Setup a region to intercept mouse movement
!! 
!! vd_id.rl.r = Virtual display ID
!! wd_id.rl.r = Display window ID
!! astadr.ra.v = AST routine address
!! astprm.rl.r = AST parameter
!! x1.rf.r,y1.rf.r,x2.rf.r,y2.rf.r = Bounds of rectangle (F floating)
!! exitastadr.ra.v = Exit AST address
!! exitastprm.rl.r = Exit AST parameter
!! 
!EXTERNAL  uis$set_pointer_ast
%external %routine %spec UIS Set Pointer AST %alias "UIS$SET_POINTER_AST" -
              (%integer %name VD ID,WD ID,%record(ASTFM)%name astadr,astprm,
               %real %name x1,y1,x2,y2,%record(ASTFM)%name exitastadr,
               exitastprm)
!! 
!!   UIS$SET_POINTER_PATTERN (vd_id, wd_id, [pattern1, nullarg,
!! activex, activey,]
!! [x1,y1,x2,y2], [flags])
!! 
!!     Setup a cursor pattern region.
!! 
!! vd_id.rl.r = Virtual display ID
!! wd_id.rl.r = Display window ID
!! pattern_array.ra.v = 16x16 pixel bitmap describing the cursor pattern
!! pattern_count.rl.r = number of patterns
!! activex,activey.rl.r = Offset from upper left of mouse to hot spot
!! x1.rf.r,y1.rf.r,x2.rf.r,y2.rf.r = Bounds of rectangle (F floating)
!! flags.rl.r = bit 0 set means bind cursor to rectangle
!! 
!EXTERNAL  uis$set_pointer_pattern
!! 
!!   boolean = UIS$SET_POINTER_POSITION (vd_id, wd_id, x, y)
!! 
!!     Specifies a new current pointer position in world
!!     coordinates.  It is only effective if the specified
!!     position is visible.
!! 
!! vd_id.rl.r = Virtual display ID
!!  wd_id.rl.r = Display window ID
!! x.rf.r = New X coordinate
!! y.rf.r = New Y coordinate
!! 
!!     Returns true/false if position is set.
!! 
!BYTE      uis$set_pointer_position
!EXTERNAL  uis$set_pointer_position
!! 
!!   UIS$SET_POSITION (vd_id, x,y)
!! 
!!     Set the current text position, which is used when writing
!!     text.   The position refers to the alignment point (baseline)
!!     of the first character.
!! 
!! vd_id.rl.r = Virtual display ID
!! x.rf.r, y.rf.r = X,Y position (F floating)
!! 
!EXTERNAL  uis$set_position
%external %routine %spec UIS SET POSITION %alias "UIS$SET_POSITION" -
                    (%integer %name VD ID,
                     %real %name x,y)
!! 
!!  UIS$SET_RESIZE_AST (vd_id, wd_id, [astadr,] [astprm], [new_abs_x,
!!        new_abs_y,] [new_width, new_height,] [new_wc_x1,
!!        new_wc_y1, new_wc_x2, new_wc_y2])
!! 
!! 
!! 
!!   Enable or disable a resize AST.
!! 
!! vd_id.rl.r = Virtual display ID
!! wd_id.rl.r = Display window ID
!! astadr.rl.v = Address of user AST routine
!! astprm.rl.r = User AST parameter
!!     new_abs_x.wf.r, new_abs_y.wf.r =  Exact X and Y of lower left
!!         corner (in centimeters)
!!     new_width.wf.r, new_height.wf.r = New width and height
!!     new_wc_x1.wf.r, new_wc_y1.wf.r, new_wc_x2.wf.r, new_wc_y2.wf.r
!!     = New world coordinates.
!! 
!! 
!EXTERNAL  uis$set_resize_ast
%external %routine %spec UIS Set Resize AST %alias "UIS$SET_RESIZE_AST" -
                    (%integer %name VD ID,WD ID,
                     %record(AST FM) %name astadr,
                     %record (*) %name astprm,
                     %real %name new abs x,new abs y,
                                 new width,new height,
                                 new wc x1,new wc y1,
                                 new wc x2,new wc y2)
!! 
!!   UIS$RGB_to_HLS (R, G, B, H, L, S)
!! 
!!     Convert RGB color to HLS color
!! 
!EXTERNAL  uis$rgb_to_hls
!! 
!!   UIS$RGB_to_HSV (R, G, B, H, S, V)
!! 
!!     Convert RGB color to HSV color
!! 
!EXTERNAL  uis$rgb_to_hsv
!! 
!!   UIS$SET_SHRINK_TO_ICON_AST (wd_id, [astadr,] [astprm])
!! 
!!     Enable an AST which will be sent when the user requests, via the
!!     viewport options menu, that the viewport should be shrunk to a
!!     icon.  The application can disable the abiltiy to shrink a
!!     viewport by specifying only the wd_id argument or specifying
!!     0 as the ASTADR.  It may reinstate the default behavior by
!!     specifying UIS$C_DEFAULT_SHRINK_TO_ICON as the astadr.
!! 
!! 
!! wd_id.rl.r = Display window ID
!! astadr.rl.v = (optional) Address of user AST routine
!! astprm.rl.r = (optional) User AST parameter
!! 
!EXTERNAL  uis$set_shrink_to_icon_ast
!! 
!!  UIS$SET_TB_AST (tb_id [,data_astadr] [,data_astprm]
!!   [,x_pos][,y_pos]
!!   [,data_x1][,data_y1][,data_x2][,data_y2]
!!   [,button_astadr] [,button_astprm]
!!   [,button_keybuf])
!!  Enable/disable data digitizing ASTs
!!  tb_id.rl.r
!!  data_astadr.ra.v,data_astprm.rl.r
!!  x_pos.wf.r,y_pos.wf.r
!!  data_x1.rf.r,data_y1.rf.r,data_x2.rf.r,data_y2.rf.r
!!  button_astadr.ra.v,button_astprm.rl.r
!!  button_keybuf.wl.r
!! 
!EXTERNAL  uis$set_tb_ast
!! 
!!  uis$set_text_formatting (vd_id, iatb, oatb, mode)
!! 
!! 
!!      Set formatting mode (normal, justify, center)
!! 
!!  Inputs:
!! 
!!  vd_id.rl.r = Virtual Display ID
!!  iatb.rl.r = Input attribute block number
!!  oatb.rl.r = Output attribute block number
!!  mode.rl.r = Formatting mode
!! 
!EXTERNAL  uis$set_text_formatting
!! 
!!  uis$set_text_margins (vd_id, iatb, oatb, x, y, margin_length)
!! 
!! 
!!      Set text margins to use for text formatting.
!! 
!!  Inputs:
!! 
!!  vd_id.rl.r = Virtual Display ID
!!  iatb.rl.r = Input attribute block number
!!  oatb.rl.r = Output attribute block number
!!  x,y.rf.r = X and Y coordinate of starting position
!! margin_length.rf.r = Distance along text line to ending margin
!! 
!EXTERNAL  uis$set_text_margins
!! 
!!   UIS$SET_TEXT_PATH (vd_id, atb, major, minor)
!! 
!!     Sets the text paths.
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! major.wl.r = Major text path
!! minor.wl.r = Minor text path
!! 
!EXTERNAL  uis$set_text_path
!! 
!!   UIS$SET_TEXT_SLOPE (vd_id, iatb, oatb, angle)
!! 
!!     Sets the slope of text lines
!! 
!! angle.rf.r = Current text slope angle
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Input attribute block number
!! angle.rf.r = Angle to set slant to
!EXTERNAL  uis$set_text_slope
%external %routine %spec UIS Set text slope %alias "UIS$SET_TEXT_SLOPE" -
                    (%integer %name VD ID,Iatb,Oatb,
                     %real %name angle)
!! 
!!   UIS$SET_WRITING_INDEX (vd_id, iatb, oatb, index)
!! 
!!     Sets the text and graphics writing color index.
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! index.rl.r = Color map index
!! 
!EXTERNAL  uis$set_writing_index
%external %routine %spec UIS Set Writing Index %alias "UIS$SET_WRITING_INDEX" -
                    (%integer %name VD ID,Iatb,Oatb,Index)
!! 
!!   UIS$SET_WRITING_MODE (vd_id, iatb, oatb, mode)
!! 
!!     Sets the text and graphics writing mode.
!! 
!! vd_id.rl.r = Virtual display ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! mode.rl.r = Number of the mode
!! 
!EXTERNAL  uis$set_writing_mode
%external %routine %spec UIS Set Writing Mode %alias "UIS$SET_WRITING_MODE" -
                    (%integer %name VD ID,iatb,oatb,mode)
!! 
!!  UIS$SHRINK_TO_ICON (wd_id, [icon_wd_id,] [ icon_flags,]
!! [icon_name,] [attributes])
!! 
!!   If a wd_id for an icon is passed to uis$shrink_to_icon then the wdb
!!   for the icon and viewport are modified so that they point to each
!!   other and the icon bit is set in the icon's wdb. Otherwise, (If no
!!   icon wd_id was given) the desired viewport is moved off the
!!   physical display and an icon window is created to represent the
!!   viewport.
!! 
!! wd_id.rl.r = Display window ID for shrunk viewport.
!! icon_wd_id.rl.r = (optional) Display window ID for icon.
!!  icon_flags.rl.r = (optional) Flags to indicate if UIS should
!! handle the viewport's keyboard or the icon's body.
!!  icon_name.rt.dx = (optional) Text to be used as icon name.
!!     attributes.ra.v, icon_abs_y.rf.r =  (optional) Window
!!         attribute list for icon.
!! 
%external %routine %spec UIS SHRINK TO ICON %alias "UIS$SHRINK_TO_ICON" -
         (%integer %name WD ID, ICON ID, ICON FLAGS, ICON NAME, Attributes)
!EXTERNAL  uis$shrink_to_icon
!! 
!!   UIS$SOUND_BELL (devnam, [bell_volume])
!! 
!!     Sound keyboard bell.
!! 
!! devnam.rt.dx = Device name descriptor
!! bell_volume.rl.r = Bell volume level (optional)
!! 
!! 
!EXTERNAL  uis$sound_bell
!! 
!!   UIS$SOUND_CLICK (kb_id, [click_volume])
!! 
!!     Sound key click.
!! 
!! devnam.rt.dx = Device name descriptor
!! click_volume.rl.r = Click volume level (optional)
!! 
!! 
!EXTERNAL  uis$sound_click
!! 
!!   boolean.rl.v = UIS$TEST_KB (kb_id)
!! 
!!     Test if a virtual keyboard is active.
!! 
!! kb_id.rl.r = Virtual keyboard ID
!! 
!BYTE      uis$test_kb
!EXTERNAL  uis$test_kb
!! 
!!   UIS$TEXT (vd_id, atb, text_string [,x,y] [,ctllist,ctllen])
!! 
!!     Write text to display
!! 
!! vd_id.rl.r = Virtual display ID
!! atb.rl.r = Attribute block number
!! text_string.rt.dx = Text string descriptor
!! x.rf.r, y.rf.r = Optional X,Y starting position (F floating)
!! ctllist.ra.v = control list array
!! ctllen.rl.r = control list length in longwords
!! 
!EXTERNAL  uis$text
%external %routine %spec UIS TEXT %alias "UIS$TEXT" -
                    (%integer %name VD ID,ATB,
                     %record (DSC FM) %name Text String,
                     %real %name x,y,
                     %integer %name ctllist,ctllen)
!! 
!!   UIS$TRANSFORM_OBJECT (obj_id, matrix, ia)
!! 
!!     Translate, scale and rotate object.
!! 
!! obj_id.rl.r = SEG or OTP ID
!! matrix.ra.v = Address of matrix
!! ia.rl.r = Input attribute block value
!! 
!EXTERNAL  uis$transform_object
!! 
!!   DOP = UISDC$ALLOCATE_DOP(WD_ID,SIZE,ATB)
!! 
!! Allocate a DOP driver drawing packet
!! 
!INTEGER*4 uisdc$allocate_dop
!EXTERNAL  uisdc$allocate_dop
!! 
!!   UISDC$CIRCLE (wd_id, atb,center_x,center_y,xradius,
!! [start_deg],[end_deg])
!! 
!!     Draw the arc of a circle.
!! 
!! wd_id.rl.r = Display window ID
!!       atb.rl.r = Attribute block number
!!       center_x.rl.r, center_y.rl.r = Center x,y coordinates
!! xradius.rl.r = Radius of the circle (x axis)
!! start_deg.rf.r = Degree at which arc starts (F floating, optional)
!! end_deg.rf.r = Degree at which arc ends (F floating, optional)
!! 
!EXTERNAL  uisdc$circle
!! 
!!   UISDC$ELLIPSE (wd_id, atb,center_x,center_y,xradius,yradius,[start_deg],[end_deg])
!! 
!!     Draw the arc of an ellipse.
!! 
!! wd_id.rl.r = Display window ID
!!       atb.rl.r = Attribute block number
!!       center_x.rl.r, center_y.rl.r = Center x,y coordinates
!! xradius.rl.r = Major axis radius of the ellipse
!! yradius.rl.r = Minor axis radius of the ellipse
!! start_deg.rf.r = Degree at which arc starts (F floating, optional)
!! end_deg.rf.r = Degree at which arc ends (F floating, optional)
!! 
!EXTERNAL  uisdc$ellipse
!! 
!!   UISDC$ERASE (wd_id, [x1,y1,x2,y2])
!! 
!!     Erases the region specified by the given rectangle.
!! 
!! wd_id.rl.r = Display window ID
!! x1.rl.r, y1.rl.r = X,Y position of one rectangle corner
!! x2.rl.r, y2.rl.r = X,Y position of other corner
!! 
!EXTERNAL  uisdc$erase
!! 
!!   UISDC$EXECUTE_DOP_ASYNCH(WD_ID,DOP,IOSB)
!! 
!! Insert a DOP on the drawing queue of a window
!! 
!EXTERNAL  uisdc$execute_dop_asynch
!! 
!!   UISDC$EXECUTE_DOP_SYNCH(WD_ID,DOP)
!! 
!! Insert a DOP on the drawing queue of a window
!! and wait for completion.
!! 
!EXTERNAL  uisdc$execute_dop_synch
!! 
!!   UISDC$GET_ALIGNED_POSITION (wd_id, atb, retx,rety)
!! 
!!     Gets the current "alignment" text position.
!! 
!! wd_id.rl.r = Display window ID
!! atb.rl.r = Attribute block number number
!! retx.wl.r, rety.wl.r = Address to return X,Y position
!! 
!EXTERNAL  uisdc$get_aligned_position
!! 
!!   UISDC$GET_CHAR_SIZE (wd_id, iatb, char, width, height)
!! 
!!     Sets an additional amount of text spacing.
!! 
!! wd_id.rl.r = Display window ID
!! atb.rl.r = Input attribute block number
!! char.wt.dx = Character on which to base size
!! width.wl.r = Width of example character
!! height.wl.r = Height to make example character
!! 
!BYTE      uisdc$get_char_size
!EXTERNAL  uisdc$get_char_size
!!   UISDC$GET_CLIP (wd_id, atb [,x1, y1, x2, y2])
!! 
!!     Gets a user clipping rectangle.
!! 
!! wd_id.rl.r = Display window ID
!! atb.rl.r = Input attribute block number
!! x1.wl.r, y1.wl.r = X,Y position of lower left corner
!! x2.wl.r, y2.wl.r = X,Y position of upper right corner
!! 
!BYTE      uisdc$get_clip
!EXTERNAL  uisdc$get_clip
!!   x = UISDC$GET_LEFT_MARGIN (wd_id, atb)
!! 
!!     Gets the left margin for writing text.
!! 
!! x.wl.v = X coordinate of left margin (return value)
!! wd_id.rl.r = Display window ID
!! atb.rl.r = Input attribute block number
!! 
!INTEGER*4 uisdc$get_left_margin
!EXTERNAL  uisdc$get_left_margin
!! 
!!   status.rl.r = UISDC$GET_POINTER_POSITION (wd_id, retx, rety)
!! 
!!     Gets the current mouse position in viewport relative pixel
!!     coordinates.
!! 
!! wd_id.rl.r = Display window ID
!! retx.wl.r, rety.wl.r = Address to return X,Y pixel coordinates
!! 
!!     Returns true/false if mouse is within the window
!! 
!BYTE      uisdc$get_pointer_position
!EXTERNAL  uisdc$get_pointer_position
!! 
!!   UISDC$GET_POSITION (wd_id, retx,rety)
!! 
!!     Gets the current baseline text position.
!! 
!! wd_id.rl.r = Display window ID
!! retx.wl.r, rety.wl.r = Address to return X,Y position
!! 
!EXTERNAL  uisdc$get_position
!! 
!!  uisdc$get_text_margins (wd_id, atb, x, y, margin_length)
!! 
!! 
!!      Get text margins used for text formatting.
!! 
!!  Inputs:
!! 
!!  wd_id.rl.r = Window ID
!!  atb.rl.r = Input attribute block number
!!  x,y.wl.r = (optional) X and Y coordinate of starting position
!! margin_length.wl.r = (optional) Distance to ending margin
!! 
!EXTERNAL  uisdc$get_text_margins
!! 
!!   boolean = UISDC$GET_VISIBILITY(wd_id, [,x1, y1 [,x2 ,y2])
!! 
!!     Returns whether the specified rectangle in the display
!!     window is completely visible or not.
!! 
!!     Returns true/false visibility status
!! wd_id.rl.r = Display window ID
!! x1.rl.r,y1.rl.r = World coordinates of one corner
!! x2.rl.r,y2.rl.r = World coordinates of other corner
!! 
!BYTE      uisdc$get_visibility
!EXTERNAL  uisdc$get_visibility
!! 
!!   UISDC$IMAGE (wd_id, atb,x1,y1,x2,y2,
!! rasterwidth,rasterheight,bitsperpixel,
!! rasteraddr)
!! 
!!     Write a natural image bitmap into the specified virtual
!!     display rectangle given by the two corners.  If the size
!!     of the bitmap doesn't match the rectangle, scaling is done.
!! 
!! wd_id.rl.r = Display window ID
!! atb.rl.r = Attribute block number
!! x1.rl.r, y1.rl.r = X,Y position of one rectangle corner
!! x2.rl.r, y2.rl.r = X,Y position of other corner
!! rasterwidth.rl.r = Width of image bitmap in pixels
!! rasterheight.rl.r = Height of image bitmap in pixels
!! bitsperpixel.rl.r = Number of image bits which make up 1 "pixel"
!! rasteraddr.ra.v = Address of natural image data
!! 
!EXTERNAL  uisdc$image
!! 
!!   UISDC$LINE (wd_id, atb,x1,y1[,x2,y2,...])
!! 
!!     Plot point or disconnected lines
!! 
!! wd_id.rl.r = Display window ID
!!       atb.rl.r = Attribute block number
!!       x1.rl.r, y1.rl.r = x,y coordinates, repeated
!! 
!EXTERNAL  uisdc$line
!! 
!!   UISDC$LINE_ARRAY (wd_id, atb, count,x_vector,y_vector)
!! 
!!     Plot point or disconnected lines
!! 
!! wd_id.rl.r = Display window ID
!!       atb.rl.r = Attribute block number
!! count.rl.r = Number of points
!!       x_vector.ra.v = Address of array of x coordinates
!!       y_vector.ra.v = Address of array of y coordinates
!! 
!EXTERNAL  uisdc$line_array
!! 
!!   UISDC$LOAD_BITMAP(WD_ID,BITMAP_ADR,BITMAP_LEN,BITMAP_WIDTH,BITS_PER_PIXEL)
!! 
!! Load a bitmap into offscreen memory for use as a fill pattern,
!! line style, image, or font.
!! 
!INTEGER*4 uisdc$load_bitmap
!EXTERNAL  uisdc$load_bitmap
!! 
!!   UISDC$MEASURE_TEXT (wd_id, atb, text_string, retwidth,retheight
!! [,ctllist, ctllen] [,posarray])
!! 
!!     Gets the width and height of a text string in pixels
!! 
!! wd_id.rl.r = Display window ID
!! atb.rl.r = attribute block number number
!! text_string.rt.dx = Character string descriptor
!! retwidth.wl.r, retheight.wl.r = Address to return width,height
!! ctllist.ra.v = control list array
!! ctllen.rl.r = length of ctllist in longwords
!! posarray.wa.v = position array
!! 
!EXTERNAL  uisdc$measure_text
!! 
!!   UISDC$MOVE_AREA (wd_id, x1,y1,x2,y2,new_x,new_y)
!! 
!!     Moves the region specified by the given rectangle to
!!     another place in the display window.
!! 
!! wd_id.rl.r = Display window ID
!! x1.rl.r, y1.rl.r = X,Y position of one rectangle corner
!! x2.rl.r, y2.rl.r = X,Y position of other corner
!! new_x.rl.r, new_y.rl.r = New X,Y origin for rectangle
!! 
!EXTERNAL  uisdc$move_area
!! 
!!   UISDC$NEW_TEXT_LINE (wd_id, atb)
!! 
!!     Format the current text line, and position to next text line
!! 
!! wd_id.rl.r = Display window ID
!! atb.rl.r = Attribute block number
!! 
!EXTERNAL  uisdc$new_text_line
!! 
!!   UISDC$PLOT (wd_id, atb,x1,y1[,x2,y2,...])
!! 
!!     Plot point or line(s)
!! 
!! wd_id.rl.r = Display window ID
!!       atb.rl.r = Attribute block number
!!       x1.rl.r, y1.rl.r = x,y coordinates, repeated
!! 
!EXTERNAL  uisdc$plot
!! 
!!   UISDC$PLOT_ARRAY (wd_id, atb, count,x_vector,y_vector)
!! 
!!     Plot point or line(s)
!! 
!! wd_id.rl.r = Display window ID
!!       atb.rl.r = Attribute block number
!! count.rl.r = Number of points
!!       x_vector.ra.v = Address of array of x coordinates
!!       y_vector.ra.v = Address of array of y coordinates
!! 
!EXTERNAL  uisdc$plot_array
!! 
!!   UISDC$QUEUE_DOP(WD_ID,DOP)
!! 
!! Insert a DOP on the drawing queue of a window
!! 
!EXTERNAL  uisdc$queue_dop
!! 
!!   UISDC$READ_IMAGE (wd_id,x1,y1,x2,y2,
!! rasterwidth,rasterheight,bitsperpixel,
!! rasteraddr,buffer_size)
!! 
!!     Reads an image bitmap into the specified device coordinate
!!     rectangle given by the two corners.
!! 
!! wd_id.rl.r = Display window ID
!! x1.rl.r, y1.rl.r = X,Y position of one rectangle corner
!! x2.rl.r, y2.rl.r = X,Y position of other corner
!! rasterwidth.wl.r = Width of image bitmap in pixels
!! rasterheight.wl.r = Height of image bitmap in pixels
!! bitsperpixel.wl.r = Number of image bits which make up 1 "pixel"
!! rasteraddr.wa.v = Image buffer
!! buffer_size.rl.r = Size of image buffer
!! 
!EXTERNAL  uisdc$read_image
!! 
!!   UISDC$SET_ALIGNED_POSITION (wd_id, atb, x,y)
!! 
!!     Set the current text position, which is used when writing
!!     text.  The position refers to the upper left corner of the
!!     first character.
!! 
!! wd_id.rl.r = Display window ID
!! atb.rl.r = Attribute block number
!! x.rl.r, y.rl.r = X,Y position
!! 
!EXTERNAL  uisdc$set_aligned_position
!! 
!!   UISDC$SET_BUTTON_AST (wd_id, [astadr, astprm] [,keybuf]
!! [,x1,y1,x2,y2])
!! 
!!     Setup a region to intercept mouse button transitions
!! 
!! wd_id.rl.r = Display window ID
!! astadr.ra.v = AST routine address
!! astprm.rl.r = AST parameter
!! keybuf.wl.r = Longword to receive button information
!! x1.rl.r,y1.rl.r,x2.rl.r,y2.rl.r = Bounds of rectangle
!! 
!EXTERNAL  uisdc$set_button_ast
!! 
!!   UISDC$SET_CHAR_SIZE (vd_id, iatb, oatb, char, width, height)
!! 
!!     Sets an additional amount of text spacing.
!! 
!! vd_id.rl.r = Virtual display ID
!! oatb.rl.r = Output attribute block number
!! char.rt.dx = Character on which to base size
!! width.rl.r = Width of example character
!! height.rl.r = Height to make example character
!! 
!EXTERNAL  uisdc$set_char_size
!! 
!!   UISDC$SET_CLIP (wd_id, iatb, oatb [,x1,y1,x2,y2])
!! 
!!     Sets a user clipping rectangle.
!! 
!! wd_id.rl.r = Display window ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! x1.rl.r, y1.rl.r = X,Y position of lower left corner
!! x2.rl.r, y2.rl.r = X,Y position of upper right corner
!! 
!EXTERNAL  uisdc$set_clip
!! 
!!   UISDC$SET_LEFT_MARGIN (wd_id, iatb, oatb, x)
!! 
!!     Sets the left margin for writing text.
!! 
!! wd_id.rl.r = Display window ID
!! iatb.rl.r = Input attribute block number
!! oatb.rl.r = Output attribute block number
!! x.rl.r =  Position of left margin
!! 
!EXTERNAL  uisdc$set_left_margin
!! 
!!   UISDC$SET_POINTER_AST (wd_id, [astadr], [astprm],
!! [x1,y1,x2,y2],
!! [exitastadr], [exitastprm])
!! 
!!     Setup a region to intercept mouse movement
!! 
!! wd_id.rl.r = Display window ID
!! astadr.ra.v = AST routine address
!! astprm.rl.r = AST parameter
!! x1.rl.r,y1.rl.r,x2.rl.r,y2.rl.r = Bounds of rectangle
!! exitastadr.ra.v = Exit AST address
!! exitastprm.rl.r = Exit AST parameter
!! 
!EXTERNAL  uisdc$set_pointer_ast
!! 
!!   UISDC$SET_POINTER_PATTERN (wd_id, [pattern1, nullarg, activex, activey,]
!! [x1,y1,x2,y2])
!! 
!!     Setup a cursor pattern region.
!! 
!! wd_id.rl.r = Display window ID
!! pattern1.ra.v = 16x16 pixel bitmap describing the cursor pattern
!! nullarg. = reserved to Digital
!! activex,activey.rl.r = Offset from upper left of mouse to hot spot
!! x1.rl.r,y1.rl.r,x2.rl.r,y2.rl.r = Bounds of rectangle (integer)
!! flags.rl.r = Flags longword
!! 
!EXTERNAL  uisdc$set_pointer_pattern
!! 
!!   boolean = UISDC$SET_POINTER_POSITION (wd_id, x, y)
!! 
!!     Specifies a new current pointer position in pixel
!!     coordinates.  It is only effective if the specified
!!     position is visible.
!! 
!!  wd_id.rl.r = Display window ID
!! x.rl.r = New X coordinate
!! y.rl.r = New Y coordinate
!! 
!!     Returns true/false if position is set.
!! 
!BYTE      uisdc$set_pointer_position
!EXTERNAL  uisdc$set_pointer_position
!! 
!!   UISDC$SET_POSITION (wd_id, x,y)
!! 
!!     Set the current text position, which is used when writing
!!     text.   The position refers to the alignment point (baseline)
!!     of the first character.
!! 
!! wd_id.rl.r = Display window ID
!! x.rl.r, y.rl.r = X,Y position
!! 
!EXTERNAL  uisdc$set_position
!! 
!!  uisdc$set_text_margins (wd_id, iatb, oatb, x, y, margin_length)
!! 
!! 
!!      Set text margins to use for text formatting.
!! 
!!  Inputs:
!! 
!!  wd_id.rl.r = Window  Display ID
!!  iatb.rl.r = Input attribute block number
!!  oatb.rl.r = Output attribute block number
!!  x,y.rl.r = X and Y coordinate of starting position
!! margin_length.rl.r = Distance along text line to ending margin
!! 
!EXTERNAL  uisdc$set_text_margins
!! 
!!   UISDC$TEXT (wd_id, atb, text_string [,x,y] [,ctllist,ctllen])
!! 
!!     Write text to display
!! 
!! wd_id.rl.r = Display window ID
!! atb.rl.r = Attribute block number
!! text_string.rt.dx = Text string descriptor
!! x.rl.r, y.rl.r = Optional X,Y starting position
!! ctllist.ra.v = control list array
!! ctllen.rl.r = control list length in longwords
!! 
!EXTERNAL  uisdc$text
!
