ftp.nice.ch/pub/next/tools/screen/backspace/FlippyFloppy.NIHS.bs.tar.gz#/FlippyFloppyView.BackModule/FlippyFloppyWraps.c

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

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

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

#line 1 "FlippyFloppyWraps.psw"
/* 

FlippyFloppyWraps.psw

Wraps for this funky thing.

 Copyright (c) 1992 by Scott Byer

 Permission is given to freely distribute and modify this code
 provided the copyright notice is left unchanged.
 No warranties, explicit or implied, apply to this code.
*/

  /* Zero out the cache limit for this context, return the old value. */
#line 24 "FlippyFloppyWraps.c"
void FFWzerocachelimit(int *cacheLimit)
{
  typedef struct {
    unsigned char tokenType;
    unsigned char topLevelCount;
    unsigned short nBytes;

    DPSBinObjGeneric obj0;
    DPSBinObjGeneric obj1;
    DPSBinObjGeneric obj2;
    DPSBinObjGeneric obj3;
    DPSBinObjGeneric obj4;
    DPSBinObjGeneric obj5;
    DPSBinObjGeneric obj6;
    DPSBinObjGeneric obj7;
    DPSBinObjGeneric obj8;
    DPSBinObjGeneric obj9;
    } _dpsQ;
  static const _dpsQ _dpsF = {
    DPS_DEF_TOKENTYPE, 10, 84,
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 265},	/* cachestatus */
    {DPS_LITERAL|DPS_INT, 0, 0, 0},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119},	/* printobject */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 18},	/* clear */
    {DPS_LITERAL|DPS_INT, 0, 0, 0},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 338},	/* setcachelimit */
    {DPS_LITERAL|DPS_INT, 0, 0, 0},
    {DPS_LITERAL|DPS_INT, 0, 0, 1},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119},	/* printobject */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 70},	/* flush */
    }; /* _dpsQ */
  register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
  char pad[3];
  DPSResultsRec _dpsR[1];
  static const DPSResultsRec _dpsRstat[] = {
    { dps_tInt, -1 },
    };
    _dpsR[0] = _dpsRstat[0];
    _dpsR[0].value = (char *)cacheLimit;

  DPSSetResultTable(_dpsCurCtxt, _dpsR, 1);
  DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,84);
  DPSAwaitReturnValues(_dpsCurCtxt);
  if (0) *pad = 0;    /* quiets compiler warnings */
}
#line 18 "FlippyFloppyWraps.psw"

#line 72 "FlippyFloppyWraps.c"
void FFWsetcachelimit(int cacheLimit)
{
  typedef struct {
    unsigned char tokenType;
    unsigned char topLevelCount;
    unsigned short nBytes;

    DPSBinObjGeneric obj0;
    DPSBinObjGeneric obj1;
    } _dpsQ;
  static const _dpsQ _dpsStat = {
    DPS_DEF_TOKENTYPE, 2, 20,
    {DPS_LITERAL|DPS_INT, 0, 0, 0},	/* param: cacheLimit */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 338},	/* setcachelimit */
    }; /* _dpsQ */
  _dpsQ _dpsF;	/* local copy  */
  register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
  char pad[3];
  register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
  _dpsF = _dpsStat;	/* assign automatic variable */

  _dpsP[0].val.integerVal = cacheLimit;
  DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,20);
  if (0) *pad = 0;    /* quiets compiler warnings */
}
#line 22 "FlippyFloppyWraps.psw"


  /*  Get the path bounding box for a line of text. */
#line 102 "FlippyFloppyWraps.c"
void FFWTextBBox(const char *someText, double *llx, double *lly, double *urx, double *ury)
{
  typedef struct {
    unsigned char tokenType;
    unsigned char sizeFlag;
    unsigned short topLevelCount;
    unsigned long nBytes;

    DPSBinObjGeneric 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;
    } _dpsQ;
  static const _dpsQ _dpsStat = {
    DPS_DEF_TOKENTYPE, 0, 21, 176,
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 111},	/* newpath */
    {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_STRING, 0, 0, 168},	/* param someText */
    {DPS_LITERAL|DPS_BOOL, 0, 0, 0},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 17},	/* charpath */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 68},	/* flattenpath */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 115},	/* pathbbox */
    {DPS_LITERAL|DPS_INT, 0, 0, 3},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119},	/* printobject */
    {DPS_LITERAL|DPS_INT, 0, 0, 2},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119},	/* printobject */
    {DPS_LITERAL|DPS_INT, 0, 0, 1},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119},	/* printobject */
    {DPS_LITERAL|DPS_INT, 0, 0, 0},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119},	/* printobject */
    {DPS_LITERAL|DPS_INT, 0, 0, 0},
    {DPS_LITERAL|DPS_INT, 0, 0, 4},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 119},	/* printobject */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 70},	/* flush */
    }; /* _dpsQ */
  _dpsQ _dpsF;	/* local copy  */
  register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
  char pad[3];
  register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
  register int _dps_offset = 168;
  DPSResultsRec _dpsR[4];
  static const DPSResultsRec _dpsRstat[] = {
    { dps_tDouble, -1 },
    { dps_tDouble, -1 },
    { dps_tDouble, -1 },
    { dps_tDouble, -1 },
    };
    _dpsR[0] = _dpsRstat[0];
    _dpsR[0].value = (char *)llx;
    _dpsR[1] = _dpsRstat[1];
    _dpsR[1].value = (char *)lly;
    _dpsR[2] = _dpsRstat[2];
    _dpsR[2].value = (char *)urx;
    _dpsR[3] = _dpsRstat[3];
    _dpsR[3].value = (char *)ury;

  _dpsF = _dpsStat;	/* assign automatic variable */

  _dpsP[4].length = strlen(someText);
  _dpsP[4].val.stringVal = _dps_offset;
  _dps_offset += (_dpsP[4].length + 3) & ~3;

  _dpsF.nBytes = _dps_offset+8;
  DPSSetResultTable(_dpsCurCtxt, _dpsR, 4);
  DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,176);
  DPSWriteStringChars(_dpsCurCtxt, (char *)someText, _dpsP[4].length);
  DPSWriteStringChars(_dpsCurCtxt, (char *)pad, ~(_dpsP[4].length + 3) & 3);
  DPSAwaitReturnValues(_dpsCurCtxt);
  if (0) *pad = 0;    /* quiets compiler warnings */
}
#line 30 "FlippyFloppyWraps.psw"


  /* Transform the coordinate system */
#line 196 "FlippyFloppyWraps.c"
void FFWTransform(double tx, double ty, double sx, double sy, double r)
{
  typedef struct {
    unsigned char tokenType;
    unsigned char topLevelCount;
    unsigned short nBytes;

    DPSBinObjReal obj0;
    DPSBinObjReal obj1;
    DPSBinObjGeneric obj2;
    DPSBinObjReal obj3;
    DPSBinObjReal obj4;
    DPSBinObjGeneric obj5;
    DPSBinObjReal obj6;
    DPSBinObjGeneric obj7;
    } _dpsQ;
  static const _dpsQ _dpsStat = {
    DPS_DEF_TOKENTYPE, 8, 68,
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: tx */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: ty */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 173},	/* translate */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: sx */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: sy */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 139},	/* scale */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: r */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 136},	/* rotate */
    }; /* _dpsQ */
  _dpsQ _dpsF;	/* local copy  */
  register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
  char pad[3];
  register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
  _dpsF = _dpsStat;	/* assign automatic variable */

  _dpsP[0].val.realVal = tx;
  _dpsP[1].val.realVal = ty;
  _dpsP[3].val.realVal = sx;
  _dpsP[4].val.realVal = sy;
  _dpsP[6].val.realVal = r;
  DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,68);
  if (0) *pad = 0;    /* quiets compiler warnings */
}
#line 35 "FlippyFloppyWraps.psw"


  /* Reverse transform things, if given the right inputs. */
#line 242 "FlippyFloppyWraps.c"
void FFWDeTransform(double tx, double ty, double sx, double sy, double r)
{
  typedef struct {
    unsigned char tokenType;
    unsigned char topLevelCount;
    unsigned short nBytes;

    DPSBinObjReal obj0;
    DPSBinObjGeneric obj1;
    DPSBinObjReal obj2;
    DPSBinObjReal obj3;
    DPSBinObjGeneric obj4;
    DPSBinObjReal obj5;
    DPSBinObjReal obj6;
    DPSBinObjGeneric obj7;
    } _dpsQ;
  static const _dpsQ _dpsStat = {
    DPS_DEF_TOKENTYPE, 8, 68,
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: r */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 136},	/* rotate */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: sx */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: sy */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 139},	/* scale */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: tx */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: ty */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 173},	/* translate */
    }; /* _dpsQ */
  _dpsQ _dpsF;	/* local copy  */
  register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
  char pad[3];
  register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
  _dpsF = _dpsStat;	/* assign automatic variable */

  _dpsP[5].val.realVal = tx;
  _dpsP[6].val.realVal = ty;
  _dpsP[2].val.realVal = sx;
  _dpsP[3].val.realVal = sy;
  _dpsP[0].val.realVal = r;
  DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,68);
  if (0) *pad = 0;    /* quiets compiler warnings */
}
#line 40 "FlippyFloppyWraps.psw"


  /* Draw a single black rectangle. */
#line 288 "FlippyFloppyWraps.c"
void FFWBlackBox(double llx, double lly, double width, double height)
{
  typedef struct {
    unsigned char tokenType;
    unsigned char topLevelCount;
    unsigned short nBytes;

    DPSBinObjGeneric obj0;
    DPSBinObjGeneric obj1;
    DPSBinObjReal obj2;
    DPSBinObjReal obj3;
    DPSBinObjReal obj4;
    DPSBinObjReal obj5;
    DPSBinObjGeneric obj6;
    } _dpsQ;
  static const _dpsQ _dpsStat = {
    DPS_DEF_TOKENTYPE, 7, 60,
    {DPS_LITERAL|DPS_INT, 0, 0, 0},
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 150},	/* setgray */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: llx */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: lly */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: width */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: height */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 128},	/* rectfill */
    }; /* _dpsQ */
  _dpsQ _dpsF;	/* local copy  */
  register DPSContext _dpsCurCtxt = DPSPrivCurrentContext();
  char pad[3];
  register DPSBinObjRec *_dpsP = (DPSBinObjRec *)&_dpsF.obj0;
  _dpsF = _dpsStat;	/* assign automatic variable */

  _dpsP[2].val.realVal = llx;
  _dpsP[3].val.realVal = lly;
  _dpsP[4].val.realVal = width;
  _dpsP[5].val.realVal = height;
  DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,60);
  if (0) *pad = 0;    /* quiets compiler warnings */
}
#line 46 "FlippyFloppyWraps.psw"


  /* Draw text at a given location; the font must already be set. */
#line 331 "FlippyFloppyWraps.c"
void FFWText(double x, double y, const char *text)
{
  typedef struct {
    unsigned char tokenType;
    unsigned char sizeFlag;
    unsigned short topLevelCount;
    unsigned long nBytes;

    DPSBinObjReal obj0;
    DPSBinObjReal obj1;
    DPSBinObjGeneric obj2;
    DPSBinObjGeneric obj3;
    DPSBinObjGeneric obj4;
    } _dpsQ;
  static const _dpsQ _dpsStat = {
    DPS_DEF_TOKENTYPE, 0, 5, 48,
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: x */
    {DPS_LITERAL|DPS_REAL, 0, 0, 0},	/* param: y */
    {DPS_EXEC|DPS_NAME, 0, DPSSYSNAME, 107},	/* moveto */
    {DPS_LITERAL|DPS_STRING, 0, 0, 40},	/* param text */
    {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 = 40;
  _dpsF = _dpsStat;	/* assign automatic variable */

  _dpsP[0].val.realVal = x;
  _dpsP[1].val.realVal = y;
  _dpsP[3].length = strlen(text);
  _dpsP[3].val.stringVal = _dps_offset;
  _dps_offset += (_dpsP[3].length + 3) & ~3;

  _dpsF.nBytes = _dps_offset+8;
  DPSBinObjSeqWrite(_dpsCurCtxt,(char *) &_dpsF,48);
  DPSWriteStringChars(_dpsCurCtxt, (char *)text, _dpsP[3].length);
  DPSWriteStringChars(_dpsCurCtxt, (char *)pad, ~(_dpsP[3].length + 3) & 3);
  if (0) *pad = 0;    /* quiets compiler warnings */
}
#line 51 "FlippyFloppyWraps.psw"

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