/*
 * $RCSfile: DialWraps.psw,v $
 *
 * (c) Copyright 1992-1994 Adobe Systems Incorporated.
 * All rights reserved.
 * 
 * Permission to use, copy, modify, distribute, and sublicense this software
 * and its documentation for any purpose and without fee is hereby granted,
 * provided that the above copyright notices appear in all copies and that
 * both those copyright notices and this permission notice appear in
 * supporting documentation and that the name of Adobe Systems Incorporated
 * not be used in advertising or publicity pertaining to distribution of the
 * software without specific, written prior permission.  No trademark license
 * to use the Adobe trademarks is hereby granted.  If the Adobe trademark
 * "Display PostScript"(tm) is used to describe this software, its
 * functionality or for any other purpose, such use shall be limited to a
 * statement that this software works in conjunction with the Display
 * PostScript system.  Proper trademark attribution to reflect Adobe's
 * ownership of the trademark shall be given whenever any such reference to
 * the Display PostScript system is made.
 * 
 * ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
 * ANY PURPOSE.  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
 * ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NON- INFRINGEMENT OF THIRD PARTY RIGHTS.  IN NO EVENT SHALL ADOBE BE LIABLE
 * TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  ADOBE WILL NOT
 * PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
 * 
 * Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
 * Incorporated which may be registered in certain jurisdictions
 * 
 * Author:  Adobe Systems Incorporated
 */


/*
** DialWraps.psw
**
** Contains the wraps to draw the dial in several different ways.
*/

/***************************************************************
**
** FUNCTION:    PSWDefs
**
** DESCRIPTION: Defines procedures that are called often and binds
** to save operator look up time.
**
** PARAMETERS:  None
**
** RETURN:      None
**
***************************************************************/
defineps PSWDefs ()
    /ML { % X1 Y1 X0 Y0
        moveto lineto
    } bind def
        
    /RML { % X1 Y1 X0 Y0 Ang
        rotate moveto lineto
    } bind def
endps

/***************************************************************
**
** FUNCTION:    PSWMakeLine
**
** DESCRIPTION: Draws a line.
**
** PARAMETERS:  X0, Y0  coordinates of start of line
**              X1, Y1  coordinates of end of line
**
** RETURN:      None
**
***************************************************************/
defineps PSWMakeLine (float X0, Y0, X1, Y1)
    X1 Y1 X0 Y0 ML
endps

/***************************************************************
**
** FUNCTION:    PSWStrokePath
**
** DESCRIPTION: Draws a line along the current path.
**
** PARAMETERS:  Color       gray scale color value (0 to 1)
**              Width       line width
**
** RETURN:      None
**
***************************************************************/
defineps PSWStrokePath (float Color, Width)
    Color  setgray Width setlinewidth stroke
endps

/***************************************************************
**
** FUNCTION:    PSWFillPath
**
** DESCRIPTION: Fills region enclosed by current path.
**
** PARAMETERS:  Color       gray scale color value (0 to 1)
**
** RETURN:      None
**
***************************************************************/
defineps PSWFillPath (float Color)
    Color  setgray fill
endps

/***************************************************************
**
** FUNCTION:    PSWRotate_Makeline
**
** DESCRIPTION: Draws a line rotated by the specified angle.
**
** PARAMETERS:  Ang     angle at which to draw line
**              X0, Y0  coordinates of start of line
**              X1, Y1  coordinates of end of line
**
** RETURN:      None
**
***************************************************************/
defineps PSWRotate_MakeLine (float Ang, X0, Y0, X1, Y1)
    X1 Y1 X0 Y0 Ang RML
endps

/***************************************************************
**
** FUNCTION:    PSWSetColorWidth
**
** DESCRIPTION: Sets the current gray scale and line width.
**
** PARAMETERS:  Color       gray scale color value (0 to 1)
**              Width       line width
**
** RETURN:      None
**
***************************************************************/
defineps PSWSetColorWidth (float Color, Width)
    Color  setgray Width setlinewidth
endps

/***************************************************************
**
** FUNCTION:    PSWPlaceName
**
** DESCRIPTION: Place a name on the stack.
**
** PARAMETERS:  Str         name string to be placed on stack
**
** RETURN:      None
**
***************************************************************/
defineps PSWPlaceName (char *Str)
    /Str
endps

/***************************************************************
**
** FUNCTION:    PSWDrawUserPath
**
** DESCRIPTION: Draws the named user path.
**
** PARAMETERS:  Color       gray scale color value (0 to 1)
**              Width       line width
**              Str         name string of user path to draw
**
** RETURN:      None
**
***************************************************************/
defineps PSWDrawUserPath (float Color, Width; char *Str)
    Color  setgray Width setlinewidth
    Str ustroke
endps

/***************************************************************
**
** FUNCTION:    PSWGetTransform
**
** DESCRIPTION: Gets the current transform matrices and offset
**              coordinates.
**
** PARAMETERS:  Ctxt        DPS context
**
** RETURN:      Ctm         array containing current transform matrix
**              Invctm      array containing inverted matrix
**              XOffset     X offset value
**              YOffset     Y offset value
**
***************************************************************/
defineps PSWGetTransform(DPSContext Ctxt | float Ctm[6],
     Invctm[6]; int *XOffset, *YOffset)
   matrix currentmatrix dup Ctm
   matrix invertmatrix Invctm
   currentXoffset YOffset XOffset
endps

