WORD evnt_button(clicks, mask, x, my, buttopn, kstate)
WORD clocks, mask, state
WORD *mx, *my, *button, *kstate

        Stops program execution until a specified mouse event has taken place.
        
                clicks= the no. of mouse-clicks to wait for
                mask specifies the buttons to wait for
                
                        0x01    left button
                        0x02    right button
                        0x04    middle button
                        0x08    other buttons
                        
                state specifies the state of the relevant buttons to wait for
                
                        0x00    all buttons released
                        0x01    left button depressed
                        0x02    right button depressed
                        0x08    other buttons.
                        
                In both cases the middle button is defined as the one next to 
                the left of the rightmost button. The 'others' continue in a 
                logical progression leftwards until the leftmost is reached, 
                which is the left button.
                
                mx points to a word containing the x position of the mouse on 
                return.
                
                my likewise for the y position.
                
                button is a pointer to a word containing the returned state of 
                the buttons defined as in 'state'
                
                 kstate is a pointer to a word showing the state of the keyboard 
                 shift keys, as follows..
                 
                        0x01    right shift
                        0x02    left shift
                        0x04    control
                        0x08    alternate
                        
                upon exit, this function returns a value corresponding to the 
                number of times the the mouse buttons conformed to 'state'.
                        
                         
WORD evnt_keybd(VOID)
        
        stops execution of the program until a keypress event appears in the 
        applications message queue.
        
        Returns a WORD with the ASCII code of the key pressed in it's lower word 
        and the scan code in the upper.


WORD evnt_mouse(flag, x, y, w h, mx, my , button, kstate)
WORD flag, x, y, w, h
WORD *mx, *my, *button, kstate  
         stops execution of the program until the mouse enters or leaves a 
         specific area of the screen.
         
         'flag' specifies  the behaviour to wait for. 0= enter the rectangle, 1 
         leave it.
         
         x, y, w and h specify the size and position of the rectangle
         
         mx, my, button and kstate fulfill the same functions as for evnt_button
        
         this function always returns 1 at present.
         
         
VOID v_contourfill(handle, x, y, colour)
WORD handle, x, y, colour

        outputs a 'seed' style fill.
        
         handle is the VDI device handle, x and y define the starting point of 
         the fill. Colour defines either the colour of the border to stop the 
         fill at, or if -1 it signifies 'stop as soon as you hit a different 
         colour from the one at x,y'.
         
         
VOID v_fillarea(handle, count, pxy)
WORD handle, count
WORD *pxy

        outputs a filled polygon.
        
        handle is the VDI handle, count is the number of vertices in the 
        polygon, and pxy is an array of point data; pxy[0]= x of first point, 
        pxy[1]= y of first point etc.. The last point is automatically connected 
        with the first. All current fill attributes are used.
        

VOID v_get_pixel(handle, x, y, pindex, vindex)
WORD handle, x, y
WORD *pindex, *vindex

        returns the colour value for the pixel specified by x,y
        
        For palette based displays pindex points to the a value for the hardware 
        colour register, while vindex points to the value for the VDI index of 
        the colour.
        
        for 16 bit colour modes, pindex will contain a 16 bit colour value in the 
        form RRRR RGGG GGGB BBBB and vindex will contain 0.
        
        for 32 bit colour modes the lower byte of vindex will contain 8 bits of 
        red, the higher byte will contain 8 bits of green. The low byte of 
        pindex will contain the 8 bits of blue. The upper byte of vindex will 
        contain other image data, depending upon the exact nature of the 
        display.
        

VOID v_pline(handle, count, pxy)
WORD handle, count
WORD *pxy

        draws a series of lines - a 'polyline'. The parameters are as for 
        v_fillarea, except that the last point and the first point are NOT 
        connected. All current line attributes are followed.
        

VOID v_pmarker(handle, count, pxy)
WORD handle, count
WORD *pxy
        
        draws several 'markers' on the screen
        All current marker attributes are observed. Handle is the VDI handle, 
        count is the number of points and pxy is an array of x,y WORD pairs of 
        point coordinates. Therefore pxy is 2*count WORDs in size.
        

VOID vq_chcells(handle, rows, columns)
WORD handle,
WORD *rows, *columns

        returns the number of text rows and columns on the current device.
        
        handle is the VDI handle, and the results are returned in the two other 
        parameters.
        
        
VOID vq_curaddress(handle, row, column)
WORD handle
WORD *row, *column

        returns in row and column the coordinate of the text cursor associated 
        with the VDI device who's handle is 'handle'.
        
        
VOID vq_extnd(handle, mode, out)
WORD handle, mode
WORD *out
                
        returns extra information about the device. Handle is for the relevant 
        device, mode is defined such that if mode = 0, out is filled with the 
        57 WORDS of data returned in work_out[] by v_opnwk() or v_opnvwk().
        If mode =1 the following data is returned in out[].
        
                word    name            values
                
                0       Screentype      0= not screen
                                        1=separate text /graphic displays & 
                                                controls
                                        2=separate controls, common screen
                                        3=common controllers, separate image 
                                                memory
                                        4= common controllers and memory
                                        (all known are either 0 or 4)
                1       bgcolours       no. of background colours available
                2       textfx          Text effects available (bitmap as 
                                        vst_effects()).
                3       canscale        0 = can't scale rasters, 1 = can.
                4       planes          number of planes
                5       lut             1=look up table supported, 0=not (true 
                                                colour)
                6       rops            no of 16x16 raster ops / second
                7       cancontourfill  1=v_contourfill() available.
                8       textrot         0= no text rotation
                                        1= 90 deg, rotations
                                        2= free angle rotation
                9       writemodes      no, of writing modes available
                10      inputmodes      0= no input
                                        1= request input
                                        2= sample input
                11      textalign       1= text alignment available
                12      inking          1= device can ink (whatever that means)
                13      rubberbanding   0= no rubberbanding
                                        1= rubberbanding lines
                                        2= rubberbanding lines and rectangles
                14      maxvertices     max no. vertices (1= no maximum)
                15      maxintin        max length of intin array (-1= no max.)
                16      mousebuttons    no. of mouse buttons
                17      widestyles      1=styles available for wide lines
                18      widemodes       1= writing modes allowed for wide lines
                19-56           -       reserved for future use.
                

ULONG vq_gdos(VOID)

        determines whether GDOS is available or not.
        returns..
                
                -2                      Not installed
                Any other value         GDOS 1.0, 1.1, 1.2
                0x5F464E54  ('_FNT')    Font GDOS installed
                0x5f46534D  ('_FSM')    FSMGDOS installed
        
        To determine whether FSMGDOS or SpeedoGDOS is loaded, you must examine 
        the FSMC cookie in the cookie jar. THe cookie value will be either 
        '_FSM' or '_SPD'.
        

VOID vq_keys_s(handle, status)
WORD handle,
WORD *status

        handle is the workstation handle. Status points to a WORD defined as 
        follows..
        
                BIT     Meaning
                0       Right shift key pressed
                1       Left shift key pressed
                2       Control key pressed
                3       Alternate key pressed
                
                
VOID vqf_attributes(handle, attributes)
WORD handle
WORD *attributes
        
        returns information about fill attributes.
        Handle is the workstation handle
        Attributes poits to an array of five WORDS defined as follows..
        
        [0]     fill interior type (set by vsf_interior() )
        [1]     fill area colour   (set by vsf_color() )
        [2]     fill style         (set by vsf_style() )
        [3]     writing mode       (set by vswr_mode() )
        [4]     perimeter settings (set by vsf_perimeter() )


VOID vrq_string(handle, maxlen, echo, echoxy, str)
WORD handle, maxlen, echo
WORD *echoxy
cha *str

        waits for input from the 'string' device in request mode.
        
        handle is a valid workstation handle. Characters are input from the 
        keyboard input the buffer 'str' points to up to maxlen+1 characters. If 
        'echo' is 1, characters are echoed to the screen at the place pointed to 
        by the two WORDS pointed to by echoxy.
        
        Note that at the moment, the echo parameter is nonfunctional, and the 
        input is never echoed. Even so, 'echoxy' must point to valid memory space 
        or a crash will occur.
        
WORD vsm_color(handle, colour)
WORD handle, colour

        This function sets the colour of markers subsequently displayed. Colur 
        specifies a palette entry to use. Returns the colour actually set.
        
WORD vsm_height(handle, size)
WORD handle, size

        Size specifies the height (and width) in pixels of markers drawn 
        afterwards. Returns the value actually set. The 'dot' marker is not 
        affected by this call.
        

WORD vsm_string(handle, maxlen, echo, echoxy, str)
WORD  handle, maxlen, echo
WORD *echoxy
char *str

        This call inputs characters from the keyboard into a buffer pointed to 
        by 'str' up to (maxlen+1) characters. If echo = 1. the input is echoed 
        to the screen at location pointed to by the values pointed to by 
        'echoxy'.
        
        returns the number of characters actually read.
        
        NOTE: Using this command in a program which also uses AES keyboard 
        routines (i.e dialogue boxes) will result in very unpredictable 
        behaviour.


WORD vsm_type(handle, type)

        This function sets the form of markers used by v_pmarker(). Handle is  
        valid workstation handle, and the values of type that can be used are as 
        follows..
        
                1       'dot' a single pixel
                2       A cross (+)
                3       An 8 line star (a + and an X overlaid)
                4       A square (hollow)
                5       An X
                6       A diamond (hollow0
                7 (+)   Device dependant.
                
        returns the actual value set.