Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

wgetsigmask(3W)

whotspot_create(3W)

whotspot_set(3W)

wscroll_set(3W)

wsetsigmask(3W)

weventclear(3W)

WEVENTPOLL(3W)

Series 300 and 500 Only

NAME

weventpoll − poll for window locator events

SYNOPSIS

#include <window.h>
int weventpoll(fd,mask,count,x,y);
int fd;
int *mask,*count,*x,*y;

DESCRIPTION

fd is an integer file descriptor for an opened window type device interface. 

mask is defined as in wsetsigmask.  In this routine, however, it is both an input parameter and an output parameter. 

If mask = 0,then the bit corresponding to the last event that has occurred will be set and passed back in mask (EVENT_ECHO will not be considered an event in this case).  Events are not queued, so weventpoll will return only the most recent event since the last call to weventpoll.

If mask <> 0, then weventpoll looks only at the events whose bits are set in mask. If one of the specified events has occurred, then the bit will remain set; otherwise, if the event has not occurred, then the bit is cleared in mask on return.  count, x, and y are returned for the most significant bit (event) set, and the count is cleared for that event.  If none of the events specified in mask have occurred, then 0 is returned in mask. 

Valid event bits are defined in window.h. 

count
is the number of times this event has occurred since the last time the count, x, y values were read for this event. 

x,y contain event-specific information, see below. 

DISCUSSION

This routine checks to see whether one or more specific events have occurred. 

If the event was EVENT_SIZE, then x and y contain the new width and height of the window. 

If the event was EVENT_MOVE, then x and y contain the new location of the window. 

If the event was EVENT_REPAINT, EVENT_SELECT, EVENT_DESTROY, EVENT_BREAK, EVENT_ICON, or EVENT_ABORT then x and y both contain 0. 

If the event was EVENT_MENU, then x contains the menu id of the menu from which a selection was made, and y contains the item id of the selected item. 

If the event was EVENT_HOTSPOT, then x contains the event_byte specified for the hotspot in whotspot_create(3W) or whotspot_set(3W), and y contains the cause of the hotspot activation. 

If the event was EVENT_ELEVATOR then an interactive move of an elevator has been requested by the user. In this case, x contains either SCROLLBAR_V or SCROLLBAR_H to identify the elevator, and y contains the requested value for the elevator.  Note that the elevator hasn’t actually been moved; this can be accomplished using wscroll_set(3W).  Elevator events can only occur for elevators that are in user mode. 

If the event was EVENT_SB_ARROW, then x contains the sum of all horizontal scroll bar arrow events that have occurred where a right arrow event adds 1 and a left arrow event adds -1. Likewise, y contains the sum of all vertical scroll bar arrows events that have occurred where a down arrow event adds 1 and an up arrow event adds -1. 

If the event was EVENT_B1_DOWN through EVENT_B8_UP or EVENT_ECHO, x and y are the the echo x and y locations at the time of the last event of this type.  Note that x and y are in pixel units. 

HARDWARE DEPENDENCIES

Series 500:
The following events are not supported on Series 500:

EVENT_HOTSPOT
EVENT_DESTROY
EVENT_BREAK
EVENT_ICON
EVENT_ELEVATOR
EVENT_SB_ARROW
EVENT_ABORT

In addition, the Series 500 does not support hot spots or scroll bars; these are supported on Series 300 Only. 

SEE ALSO

wgetsigmask(3W), whotspot_create(3W), whotspot_set(3W), wscroll_set(3W), wsetsigmask(3W), weventclear(3W). 

DIAGNOSTICS

A return of -1 indicates failure; otherwise 0 is returned.  See errno(2) for more information.

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026