AWAIT EVENT(3P) — SUNPHIGS LIBRARY
NAME
AWAIT EVENT − move event from input queue to current event report
SYNOPSIS
C Syntax
void
pawaitevent ( timeout, event )
Pfloattimeout;timeout ( seconds )
Pevent∗event;OUT event
FORTRAN Syntax
SUBROUTINE pwait ( TOUT, WKID, ICL, IDNR )
REALTOUTtime out (seconds)
INTEGERWKIDOUT workstation identifier
INTEGERICLOUT input class
INTEGERIDNROUT logical input device number
Required PHIGS Operating States
(PHOP, WSOP, ∗, ∗)
DESCRIPTION
Purpose
AWAIT EVENT makes an event available to the application program by moving an event from the input event queue to the current event report in the PHIGS state list.
If the input queue is empty, AWAIT EVENT suspends PHIGS until an event is entered into the queue or the time specified by timeout has elapsed.
C Input Parameters
timeout
The time, in seconds, to wait for an event if none are present in the input queue.
eventA pointer to a Pevent data structure identifying the workstation, device class, and device number of the device that generated the input event. Pevent is defined in phigs.h as follows:
typedef struct {
Pintws;/∗ workstation identifier ∗/
Piclassclass;/∗ device class ∗/
Pintdev;/∗ logical input device number ∗/
} Pevent;
class is an enumerated type that may take the following values:
typedef enum {
PI_NONE,
PI_LOCATOR,
PI_STROKE,
PI_VALUATOR,
PI_CHOICE,
PI_PICK,
PI_STRING
} Piclass;
PI_NONE is returned if a timeout occurs before an event is added to the input queue.
FORTRAN Input Parameters
TOUTThe time, in seconds, to wait for an event if none are present in the input queue.
WKIDThe identifier of the workstation that generated the event.
ICLThe class of the input device that generated the event. Valid classes as defined in phigs77.h are:
0PNCLASNone
1PLOCATLocator
2PSTROKStroke
3PVALUAValuator
4PCHOICChoice
5PPICKPick
6PSTRINString
PNCLAS is returned if a timeout occurs before an event is added to the input queue.
IDNRThe device number of the input device that generated the event.
Execution
The AWAIT EVENT function writes the logical input value of the oldest input event in the input queue to the current event report in the PHIGS state list. The workstation id, device class, and device number of the input device that generated the event are returned in the output parameters. The current event report is accessed by the appropriate GET device class function; for example, GET LOCATOR or GET STRING.
If there are no events in the input queue when AWAIT EVENT is called, PHIGS is placed in a wait state until an event is added to the queue or until the time specified by the timeout parameter has elapsed. If a timeout occurs, NONE is returned as the device class. The other two values, workstation id and device number, are undefined.
While PHIGS is in a wait state, window system events such as repaints, resizes, etc., are processed as usual.
While timeout can be any positive floating-point value, the effective timeout resolution is approximately 2 hundredths of a second.
The Sun_canvas workstation types ignore the timeout parameter. The device class NONE is returned immediately if there are no events in the input queue.
ERRORS
003Ignoring function, function requires state (PHOP, WSOP, ∗, ∗)
256Warning, the input queue has overflowed
SEE ALSO
SET VALUATOR MODE (3P)
SET STROKE MODE (3P)
SET STRING MODE (3P)
SET PICK MODE (3P)
SET LOCATOR MODE (3P)
SET CHOICE MODE (3P)
GET CHOICE (3P)
GET LOCATOR (3P)
GET LOCATOR 3 (3P)
GET PICK (3P)
GET STRING (3P)
GET STROKE (3P)
GET STROKE 3 (3P)
GET VALUATOR (3P)
INQUIRE MORE SIMULTANEOUS EVENTS (3P)
INQUIRE INPUT QUEUE OVERFLOW (3P)
ESCAPE -2 (3P)
Sun Release 4.0 — Last change: 31 July 1989