1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#include <stdio.h>
#include <stdlib.h>
void main(int argc, char *argv[])
{
void nexsup_( int *ifunc, char *cbuf, float *rtmp);
char *cbuf=NULL;
float rtmp[20];
int ifunc;
ifunc=1;
printf("demo--Sending ifunc=1 showwind/getsize.\n");
nexsup_(&ifunc, cbuf, rtmp);
printf("demo-window size is %f %f %f\n",rtmp[0],rtmp[1],rtmp[2]);
ifunc=2;
rtmp[0]=1.;
printf("demo--Sending ifunc=2 beginp/clear\n");
nexsup_(&ifunc, cbuf, rtmp);
ifunc=3;
printf("demo--Sending ifunc=3, pscode.\n");
nexsup_(&ifunc,
".20 setgray newpath 50 50 moveto 100 500 lineto stroke", rtmp);
ifunc=5;
printf("demo--Sending ifunc=5, flush\n");
nexsup_(&ifunc, cbuf, rtmp);
ifunc=3;
printf("demo--Sending ifunc=3, pscode.\n");
nexsup_(&ifunc,
"newpath 100 100 moveto 100 0 rlineto 0 100 rlineto
-100 0 rlineto closepath eofill", rtmp);
ifunc=3;
printf("demo--Sending ifunc=3, pscode.\n");
nexsup_(&ifunc,"newpath 0 0 moveto 20 20 lineto stroke", rtmp);
/*
ifunc=3;
printf("demo--Sending ifunc=3, userpath.\n");
nexsup_(&ifunc,
"[ [ 0 0 200 200 175 100 200 100 100 175 100 200 25 100 0 100 100 25 100 0
] <000103010301030103>
] ustroke",
rtmp);
*/
ifunc=5;
printf("demo--Sending ifunc=5, flush\n");
nexsup_(&ifunc, cbuf, rtmp);
/*
ifunc=4;
printf("demo--Sending ifunc=4 read cursor.\n");
nexsup_(&ifunc, cbuf, rtmp);
printf("demo--Cursor= %f %f %f\n",rtmp[0],rtmp[1],rtmp[2]);
*/
exit(0);
}
|