.\"##
.\" $XConsortium: p258,v 5.3 94/04/17 20:57:26 hersh Exp $
.\"##
.\"## 
$XMCOPY
.\"## Copyright (c) 1990, 1991 by Sun Microsystems, Inc. 
.\"## 
.\"##                         All Rights Reserved
.\"## 
.\"## Permission to use, copy, modify, and distribute this software and its 
.\"## documentation for any purpose and without fee is hereby granted, 
.\"## provided that the above copyright notice appear in all copies and that
.\"## both that copyright notice and this permission notice appear in 
.\"## supporting documentation, and that the name of Sun Microsystems,
.\"## not be used in advertising or publicity 
.\"## pertaining to distribution of the software without specific, written 
.\"## prior permission.  
.\"## 
.\"## SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
.\"## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
.\"## EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
.\"## CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
.\"## USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
.\"## OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\"## PERFORMANCE OF THIS SOFTWARE.
.ds b \s-2BREAK\s+2
.TH "REQUEST STROKE 3" 3P "29 February 1991"
.SH NAME
REQUEST STROKE 3 \- request an operator interaction with a stroke device
.IX "Stroke Input Devices" "REQUEST STROKE 3"
.IX "Request Input Mode" "REQUEST STROKE 3"
.IX "Input Modes" "REQUEST STROKE 3"
.SH SYNOPSIS
.SS C Syntax
.ft B
.ta 1.25i 3i
.nf
void
preq_stroke3 ( ws, dev, in_status, view_ind, stroke )
Pint	ws;	\fIworkstation identifier\fP
Pint	dev;	\fIstroke device number\fP
Pin_status	*in_status	\fI\s-2OUT\s+2 input status\fP
Pint	*view_ind;	\fI\s-2OUT\s+2 view index\fP
Ppoint_list3	*stroke;	\fI\s-2OUT\s+2 stroke\fP
.fi
.ft R
.SS Required PHIGS Operating States
(PHOP, WSOP, *, *)
.SH DESCRIPTION
.SS Purpose
Use \s-2REQUEST STROKE 3\s+2 to request an operator interaction with a
specified stroke device. The device must be in request mode. See
\s-2SET STROKE MODE\s+2 and \s-2INITIALIZE STROKE 3\s+2 for more information.
See the \fIAvailable Devices\fP section of \s-2INITIALIZE STROKE 3\s+2 for a
description of the available stroke devices.
.LP
The request suspends \s-2PHIGS\s+2 until the specified device is triggered
or the operator performs a \*b.
A \*b is performed by typing the \s-2CONTROL\s+2 and \s-2D\s+2 keys
simultaneously (^D).
.SS C Input Parameters
.IP \fIws\fP
Workstation identifier. An integer specifying the workstation with which
the requested stroke device is associated.
.IP \fIdev\fP
The device number of the requested stroke device.
See the \fIAvailable Devices\fP section of \s-2INITIALIZE STROKE 3\s+2 for a
description of the available stroke devices.
.SS C Output Parameter
.IP \fIin_status\fP
A pointer to the location to store the request status.
Pin_status is defined in phigs.h as follows:
.sp .4
.ta .5i
.nf
typedef enum {
.sp .2
	PIN_STATUS_NONE,
	PIN_STATUS_OK,
	PIN_STATUS_NO_IN
.sp .2
} Pin_status;
.fi
.sp .4
.IP \fIview_ind\fP
A pointer to the location to store
the view index used to transform the Device Coordinate (\s-2DC\s+2) positions
to World Coordinate (\s-2WC\s+2) points.
.IP \fIstroke\fP
A pointer to the location to store the stroke points.
Ppoint_list3 is defined in phig.h as follows:
.sp .4
.ta .5i +\w'Ppoint3	'u +\w'num_points;	'u
.nf
typedef struct {
.sp .2
	Pint	num_points;	/* number of points in list */
	Ppoint3	*points;	/* list of points  */
.sp .2
} Ppoint_list3;
.fi
.IP
\fInum_points\fP is the number of points in \fIpoints\fP.
.IP
\fIpoints\fP is the array of Ppoint3 structures specifying the
points in \s-2WC\s+2.  
\fBThis array must be allocated by the calling program
and the array pointer assigned to this field before calling this
function\fP.  
The array must be at least as large as the buffer of the
\s-2STROKE\s+2 device.  
This buffer size is set when the device is initialized.
Ppoint3 is defined in phigs.h as follows:
.bp
.sp .4
.nf
.ta .5i +\w'Pfloat	'u +\w'x;	'u
typedef struct {
.sp .2
	Pfloat	x;	/* x coordinate */
	Pfloat	y;	/* y coordinate */
	Pfloat	z;	/* z coordinate */
.sp .2
} Ppoint3;
.fi
.SS Execution
\s-2REQUEST STROKE 3\s+2 requests a logical input value from the specified
stroke device. The specified device must be in request mode. See
\s-2SET STROKE MODE\s+2 for more information.
.LP
\s-2REQUEST STROKE 3\s+2 creates a measure
process for the specified device and suspends \s-2PHIGS\s+2 until the
device is triggered or the operator issues a \*b. 
A \*b is generated by the operator by depressing the
\s-2CONTROL\s+2 and \s-2D\s+2 keys
simultaneously (^D).
.LP
If a \*b occurs, a status of \s-2PIN_STATUS_NO_IN\s+2 is returned and the stroke data
is undefined.  If a status of \s-2PIN_STATUS_OK\s+2 is returned, the stroke data is
available.  In either case, the measure process is then terminated and
\s-2PHIGS\s+2 processing resumes.
.LP
A stroke measure consists of a \fIview index\fP and \s-2WC\s+2
\fIpositions\fP.  The \fIview index\fP specifies the view representation
from the workstation's view table that was used to map the stroke
positions from Normalized Projections Coordinates (\s-2NPC\s+2) to \s-2WC\s+2.
The \fIpositions\fP are the positions of the stroke in \s-2WC\s+2.
\fBNote:\fP The \s-2\&2D\s+2 and \s-2\&3D\s+2 stroke measure processes are the same except
that the \s-2\&2D\s+2 process discards the \fIz\fP
coordinates. The \s-2\&2D\s+2 version of this
function, \s-2REQUEST STROKE\s+2, can be used if the \fIz\fP
coordinates are not needed.
.LP
See \s-2INITIALIZE STROKE 3\s+2 for a description of the available stroke
devices.
.SH ERRORS
.IP 003
Ignoring function, function requires state 
(\s-2PHOP\s+2, \s-2WSOP\s+2, \s-2*\s+2, \s-2*\s+2)
.IP 054
Ignoring function, the specified workstation is not open
.IP 061
Ignoring function, specified workstation is neither of category \s-2INPUT\s+2
nor of category \s-2OUTIN\s+2
.IP 250
Ignoring function, the specified device is not available
on the specified workstation
.IP 251
Ignoring function, the function requires the input device
to be in \s-2REQUEST\s+2 mode
.SH SEE ALSO
.nf
.IP
.ta 0.5i
.SM "INITIALIZE STROKE 3 (3P)"
.SM "SET STROKE MODE (3P)"
.SM "SET VIEW TRANSFORMATION INPUT PRIORITY (3P)"
.SM "REQUEST STROKE (3P)"
.fi