home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 344b.lha / plplot_v2.6 / unix / dg300.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-27  |  1.6 KB  |  99 lines

  1. #include "plplot.h"
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <limits.h>
  5.  
  6. struct termattr {
  7.    unsigned char com[4];
  8.    unsigned char rom[4];
  9.    unsigned char ram[4];
  10.    unsigned char con[5];
  11.    unsigned char eor;
  12. } termattr;
  13.  
  14. #define  DGX    639
  15. #define  DGY    239
  16.  
  17. void dgsetup(xdpi,ydpi,xwid,ywid)
  18. PLINT xwid, ywid;
  19. PLFLT xdpi, ydpi;
  20. {
  21. }
  22.  
  23. void dginit()
  24. {
  25.    /* Request terminal configuration report */
  26.    printf("\n\036\107\051\n");
  27.    scanf("%s",(char *)&termattr);
  28.    while(getchar() != '\n')
  29.       ;
  30.    if(!strncmp((char *)&termattr.ram[0],"0000",4)) {
  31.       printf("Please wait while graphics interpreter is downloaded.\n");
  32.       /* Need to download graphics interpreter. */
  33.       system("cat  /usr/local/src/g300/g300gci110.tx");
  34.    }
  35.  
  36.    /* Clear screen, Set pen color to green, Absolute positioning */
  37.    printf("\036\107\063\060\n\036\107\155\061\n\036\107\151\060\n");
  38.    printf("\036\107\042\061\n");
  39.  
  40.    /* set plplot stuff */
  41.    smod(1);   /* interaction mode */
  42.    scol(1);   /* color */
  43.    swid(1);
  44.    setpxl(3.316*16,1.655*16);
  45.    setphy(0,DGX*16,0,DGY*16);
  46. }
  47.  
  48. void dgselect(ori,file)
  49. PLINT ori;
  50. char *file;
  51. {
  52. }
  53.  
  54. void dgtext()
  55. {
  56. }
  57.  
  58. void dggraph()
  59. {
  60. }
  61.  
  62. void dgclear()
  63. {
  64.    /* Before clearing wait for CR */
  65.    putchar('\007');
  66.    fflush(stdout);
  67.    while(getchar() != '\n')
  68.       ;
  69.    printf("ERASE\n");
  70. }
  71.  
  72. void dgpage()
  73. {
  74. }
  75.  
  76. void dgcolor(colour)
  77. PLINT colour;
  78. {
  79. }
  80.  
  81. void dgline(x1,y1,x2,y2)
  82. PLINT x1,y1,x2,y2;
  83. {
  84.    printf("LINE %d %d %d %d\n",x1>>4,y1>>3,x2>>4,y2>>3);
  85. }
  86.  
  87. void dgtidy()
  88. {
  89.    dgclear();
  90.    printf("\036\107\042\060\n");
  91.    fflush(stdout);
  92. }
  93.  
  94. void dgwidth(width)
  95. PLINT width;
  96. {
  97. }
  98.  
  99.