FROMXY_TERM0(3W)
NAME
fromxy_term0 − convert from Term0 pixel units to characters
SYNOPSIS
int fromxy_term0(fd,x,y,colptr,rowptr);
int fd;
int x,y;
int *colptr,*rowptr;
DESCRIPTION
fd is an integer file descriptor for an opened Term0 window type device interface.
x,y are the coordinates, in pixels relative to upper left corner of window, of the point to be mapped.
colptr,rowptr
are pointers to the coordinates, in character units, after mapping.
DISCUSSION
This routine provides a mapping from pixel units to column and row in a TERM0 window. The column and row returned are the coordinates of the 1 byte character cell which contains the point x,y. The current font cell size applies to this conversion. Note that 2-byte characters take up two columns. Both coordinate systems (pixels and characters) define 0,0 to be at the upper left corner of the window (which may be offscreen). Note that character 0,0 in the window may not be character 0,0 in the scroll buffer.
This routine is useful to convert coordinates from locator input devices into screen positions.
HARDWARE DEPENDENCIES
Series 500:
Term0 routines do not support HP-15 (2-byte) fonts on Series 500.
SEE ALSO
DIAGNOSTICS
A return of -1 indicates failure; otherwise 0 is returned. See errno(2) for more information.
Hewlett-Packard Company — HP-UX Release 8.0: January 1991