ftp.nice.ch/pub/next/tools/workspace/Cassandra.1.7a.s.tar.gz#/Cassandra/sym/ClockPS.c

This is ClockPS.c in view mode; [Download] [Up]

/* ./sym/ClockPS.c generated from ClockPS.psw
   by unix pswrap V1.009  Wed Apr 19 17:50:24 PDT 1989
 */

#include <dpsclient/dpsfriends.h>
#include <string.h>

#line 1 "ClockPS.psw"
/* drawClockHand draws a line with the specified width and color. 
** The line starts at 0, 0 and spans the specified length in the 
** direction specified by angle. Despite its name, this function is
** a pretty generic line drawer.
*/
#line 15 "./sym/ClockPS.c"
void drawClockHand(float angle, float length, float gray, float width)
{
  typedef struct {
    unsigned char tokenType;
    unsigned char topLevelCount;
    unsigned short nBytes;

    DPSBinObjGeneric obj0;
    DPSBinObjReal obj1;
    DPSBinObjGeneric obj2;
    DPSBinObjGeneric obj3;
    DPSBinObjGeneric obj4;
    DPSBinObjGeneric obj5;
    DPSBinObjGeneric obj6;
    DPSBinObjReal obj7;
    DPSBinObjGeneric obj8;
    DPSBinObjReal obj9;
    DPSBinObjGeneric obj10;
    DPSBinObjReal obj11;
    DPSBinObjGeneric obj12;
    DPSBinObjGeneric obj13;
    DPSBinObjGeneric obj14;
    } _dpsQ;
  static const _dpsQ _dpsStat = {
    DPS_DEF_TOKENTYPE, 15, 124,
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 78},	/* gsave */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: angle */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 136},	/* rotate */
    {DPS_LITERAL|DPS_INT, 0, 0, 0},
    {DPS_LITERAL|DPS_INT, 0, 0, 0},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 107},	/* moveto */
    {DPS_LITERAL|DPS_INT, 0, 0, 0},
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: length */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 99},	/* lineto */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: width */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 155},	/* setlinewidth */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: gray */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 150},	/* setgray */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 167},	/* stroke */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 77},	/* grestore */
    }; /* _dpsQ */
  _dpsQ _dpsF;	/* local copy  */
  register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
  char pad[3];
  register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
  _dpsF = _dpsStat;	/* assign automatic variable */

  _dpsP[1].val.realVal = angle;
  _dpsP[7].val.realVal = length;
  _dpsP[11].val.realVal = gray;
  _dpsP[9].val.realVal = width;
  DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,124);
  if (0) *pad = 0;    /* quiets compiler warnings */
}
#line 14 "ClockPS.psw"


/* Center string at x, y at pointsize size
 */
#line 75 "./sym/ClockPS.c"
void drawClockString(int x, int y, int size, const char *string)
{
  typedef struct {
    unsigned char tokenType;
    unsigned char sizeFlag;
    unsigned short topLevelCount;
    unsigned long nBytes;

    DPSBinObjReal obj0;
    DPSBinObjGeneric obj1;
    DPSBinObjGeneric obj2;
    DPSBinObjGeneric obj3;
    DPSBinObjGeneric obj4;
    DPSBinObjGeneric obj5;
    DPSBinObjGeneric obj6;
    DPSBinObjGeneric obj7;
    DPSBinObjGeneric obj8;
    DPSBinObjGeneric obj9;
    DPSBinObjGeneric obj10;
    DPSBinObjGeneric obj11;
    DPSBinObjGeneric obj12;
    DPSBinObjGeneric obj13;
    DPSBinObjGeneric obj14;
    DPSBinObjGeneric obj15;
    DPSBinObjGeneric obj16;
    DPSBinObjGeneric obj17;
    DPSBinObjGeneric obj18;
    DPSBinObjGeneric obj19;
    DPSBinObjGeneric obj20;
    DPSBinObjGeneric obj21;
    DPSBinObjGeneric obj22;
    DPSBinObjGeneric obj23;
    DPSBinObjGeneric obj24;
    } _dpsQ;
  static const _dpsQ _dpsStat = {
    DPS_DEF_TOKENTYPE, 0, 25, 208,
    {DPS_LITERAL|DPS_REAL, 0, 0, 0.0},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 150},	/* setgray */
    {DPS_LITERAL|DPS_INT, 0, 0, 0},	/* param: x */
    {DPS_LITERAL|DPS_INT, 0, 0, 0},	/* param: y */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 107},	/* moveto */
    {DPS_LITERAL|DPS_NAME, 0, DPSSYSNAME, 211},	/* Times-Roman */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 67},	/* findfont */
    {DPS_LITERAL|DPS_INT, 0, 0, 0},	/* param: size */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 140},	/* scalefont */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 149},	/* setfont */
    {DPS_LITERAL|DPS_STRING, 0, 0, 200},	/* param string */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 56},	/* dup */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 166},	/* stringwidth */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 117},	/* pop */
    {DPS_LITERAL|DPS_INT, 0, 0, 2},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 54},	/* div */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 40},	/* currentpoint */
    {DPS_LITERAL|DPS_INT, 0, 0, 3},
    {DPS_LITERAL|DPS_INT, 0, 0, -2},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 135},	/* roll */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 62},	/* exch */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 169},	/* sub */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 62},	/* exch */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 107},	/* moveto */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 160},	/* show */
    }; /* _dpsQ */
  _dpsQ _dpsF;	/* local copy  */
  register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
  char pad[3];
  register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
  register int _dps_offset = 200;
  _dpsF = _dpsStat;	/* assign automatic variable */

  _dpsP[2].val.integerVal = x;
  _dpsP[3].val.integerVal = y;
  _dpsP[7].val.integerVal = size;
  _dpsP[10].length = strlen(string);
  _dpsP[10].val.stringVal = _dps_offset;
  _dps_offset += (_dpsP[10].length + 3) & ~3;

  _dpsF.nBytes = _dps_offset+8;
  DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,208);
  DPSWriteStringChars(_dpsCurCtxt, (char *)string, _dpsP[10].length);
  DPSWriteStringChars(_dpsCurCtxt, (char *)pad, ~(_dpsP[10].length + 3) & 3);
  if (0) *pad = 0;    /* quiets compiler warnings */
}
#line 32 "ClockPS.psw"

 

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.