Rich Thomson Software Engineer Design Systems Division Evans & Sutherland Computer Corporation Wed Apr 3 16:18:45 MST 1991 The PEXt (PEX Toolkit) library contains several convenience routines for X toolkit based PEX applications as well as providing a PHIGS workstation widget that can automate some of the tedium of handling exposure and resize events on a PHIGS workstation's window. The following man pages describe the routines in the library: Matrix convenience routines: PEXtBuildTran PEXtNonUniformScale PEXtRotate PEXtTranslate Primitive convenience routines: PEXtCircle PEXtCube PEXtCylinder PEXtEllipse2 PEXtSphere Utility routines: PEXtInitialize PEXtOpenPEX PEXtRegisterConverters PEXtSanityCheck Widgets: PEXtWorkstation The PEXt library was born out of the observation that certain operations become common when writing PEX application code. For instance, the PEX API provides convenience routines for creating transformation matrices (BUILD TRANSFORMATION MATRIX 3, ROTATE, TRANSLATE, SCALE, etc) and a routine for setting transformation matrices in the PHIGS viewing pipeline model (SET LOCAL TRANSFORMATION, SET GLOBAL TRANSFORMATION, etc). A commonly encountered operation is to create a matrix using one of the convenience routines and immediately insert the matrix as a local transformation matrix: [...] { Pvec3 translation; Pint PEXtError; Pmatrix3 m; translation.delta_x = 1.; translation.delta_y = 1.; translation.delta_z = 1.; ptranslate3(&translation, &PEXtError, m); if (PEXtError) { fprintf(stderr, "?unexpected PEX error %d!\n", PEXtError); exit(1); } pset_local_tran3(m, PTYPE_POSTCONCAT); } [...] PEXt provides convenience routines to perform this common operation with a single procedure call: PEXtTranslate3(1., 1., 1., PTYPE_POSTCONCAT); The error code returned by the PEX API routines called by the PEXt library is kept in the global variable PEXtError (described in the PEXtSanityCheck man page). A "sanity check" is performed after this variable is passed to any PEX API routine, and the library prints a message and exits when it encounters a non-zero value for the error code. These convenience routines provide simple mechanisms for performing common PEX operations. The second portion of PEXt is the PHIGS workstation widget, which is described fully in the man page for PEXtWorkstation. The widget provides the basic mechanisms of a PHIGS workstation and provides callbacks for expose and resize events. Simple management of exposure and resize events can also be performed without callbacks, providing commonly occuring behaviour for these events. For a description of the behaviours supported, see the man page. The third portion of PEXt is a set of resource conversion routines that allow PEX applications to specify resources having PEX data types (Ppoint3, Pvec3, etc.). The resource conversions and the valid string values are described in the man page for PEXtRegisterConverters. This library evolved (and is evolving) out of common operations in real PEX programs and suggestions for improvement and/or bugs should be submitted to Evans & Sutherland. This is the first public release of this library and it will be submitted to the X consortium for inclusion in the contributed software distributed by the consortium.