GDDM V3R2 Base Application Programming Guide
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF | BOOK


Overview of graphics input functions

GDDM V3R2 Base Application Programming Guide
SC33-0867-01



The type of input a host computer may receive depends on the type of terminal that sent it. To help programs be device-independent, the GDDM interactive graphics calls present all input as if it comes from logical input devices, rather than physical facilities of a terminal.

There are five types of logical input device:

  • Choice devices, which correspond to the keys on the terminal that can cause an interrupt, such as the ENTER key and PF keys. The ordinary alphanumeric data keys can also cause interrupts. Choice devices provide input as a code identifying which key was pressed.
    
    
  • A locator device, which corresponds to the graphics cursor, and provides input as an (x,y) screen position expressed in world coordinates.
    
    
  • A pick device, which also corresponds to the graphics cursor. It differs from a locator in providing input as the identifier of a graphics primitive that has been selected, or picked, by the end user. The identifier is called a tag. The identifier of the segment to which the picked primitive belongs is also returned. The workstation creates the input by translating the (x,y) position of the cursor into a tag and a segment identifier, a process called correlation.
    
    
  • A string device, which consists of graphics text typed by the end user into an area of the graphics field defined by the application program.
    
    
  • A stroke device, which, like the locator, corresponds to the graphics cursor. It differs in providing a set of (x,y) coordinates sampled from the trajectory of a moving cursor. The sampling is either at intervals fixed by GDDM or at points indicated by the end user with the mouse or puck buttons or the stylus tip-switch.
    
    

The 3270-PC/G and GX workstations provide several ways of controlling the graphics cursor: a mouse; a tablet with either a puck (four-button cursor) or stylus; or, if neither a mouse nor a tablet is plugged in, the cursor keys. Any of these physical devices can provide locator, pick, and stroke input, except that the cursor keys cannot provide stroke input. The input data is completely independent of the physical device; application programs cannot, in general, determine which is used.

The end user has a separate alphanumeric cursor for typing into alphanumeric fields. It is positioned using the cursor keys. If the workstation has neither a mouse, puck, nor stylus, these keys control the graphics cursor as well. The end user switches between alphanumeric and graphics cursor control by holding down the ALT key and pressing PF24.

The graphics cursor is a type of device echo. In general, an echo is the immediate feedback that the workstation provides for the end user. In the case of a pick, locator, or stroke device, the echo indicates the device's position. In the case of a string device, it indicates the characters that the end user has typed in.

After positioning the graphics cursor for pick, locator, or stroke data, or after typing string data, the end user must trigger the logical input device (that is, start the transmission to the host) by, for instance, pressing the ENTER key.

Your program may need input from some logical devices but not others. All those from which it requires input must be enabled. GDDM discards input from devices that are not enabled.

There is a special call, GSREAD, for interactive graphics I/O. It sends the current page to the terminal and waits for input, just like ASREAD. It differs from ASREAD in that it presents the input as if it came from one or more of the logical input devices. It adds elements to a graphics input queue-one element for each logical input device that has provided input. Your program accesses the queue by executing query calls, of which there is one for each type of logical device.

GSREAD reads any data that the end user may have typed into alphanumeric fields, in addition to graphics data.

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012