home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / applic / ncsa / Mac / Telnet2.6 / prerelease / d4 / Telnet2.6.1d4.src.sit.hqx / Telnet 2.6.1d4 source / source / tek / rgmp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-18  |  2.2 KB  |  126 lines

  1. /*
  2. rgmp.c by Gaige B. Paulsen
  3.   spawned from rgp.c by Aaron Contorer for NCSA
  4. Copyright 1987, board of trustees, University of Illinois
  5.  
  6. Routines for Macintosh Picture output.  Only one Real device is available
  7. */
  8.  
  9. #ifdef MPW
  10. #pragma segment TEKMacPic
  11. #endif
  12.  
  13. #include "TelnetHeader.h"
  14.  
  15. #define INXMAX 4096
  16. #define INYMAX 4096
  17.  
  18. #include "rgmp.proto.h"
  19.  
  20. void    TEKMacPicunload(void) {}
  21.  
  22. char    RGMPbusy; /* is device already in use */
  23. short    RGMPwidth, RGMPheight, RGMPxoffset=0, RGMPyoffset=0;
  24. int RGMPcolor[]=
  25.     { 30,            /* black */
  26.       33,            /* white */
  27.       205,            /* red */
  28.       341,            /* green */
  29.       409,            /* blue */
  30.       273,            /* cyan */
  31.       137,            /* magenta */
  32.       69            /* yellow */
  33.       };
  34.  
  35. short    RGMPnewwin(void)
  36. {
  37.  
  38.     RGMPbusy=1;
  39.  
  40. /*    RGMPwidth=4096;
  41.     RGMPheight=4096;     */
  42.     RGMPxoffset=0;
  43.     RGMPyoffset=0;
  44.  
  45.     return(0);
  46. }
  47.  
  48. char    *RGMPdevname(void)
  49. {
  50.     return("Macintosh PICTURE output");
  51. }
  52.  
  53. void    RGMPinit(void)
  54. {
  55.     RGMPbusy=0;
  56.  
  57. /*    RGMPwidth=4096;
  58.     RGMPheight=4096; */
  59.     RGMPxoffset=0;
  60.     RGMPyoffset=0;
  61. }
  62.  
  63. short    RGMPpencolor(short w, short color)
  64. {
  65.     UNUSED_ARG(w)
  66.     ForeColor( (long) RGMPcolor[color] );
  67.     return 0;
  68. }
  69.  
  70. short    RGMPclose(short w)
  71. {
  72.     UNUSED_ARG(w)
  73.     RGMPbusy=0;
  74.     return 0;
  75. }
  76.  
  77. short    RGMPpoint(short w, short x, short y)
  78. {
  79.     UNUSED_ARG(w)
  80.     MoveTo(x,y);
  81.     LineTo(x,y);
  82.     return 0;
  83. }
  84.  
  85. short    RGMPdrawline(short w, short x0, short y0, short x1, short y1)
  86. {
  87.     UNUSED_ARG(w)
  88.     x0 = RGMPxoffset + (short) ((long) x0 * RGMPwidth / INXMAX);
  89.     y0 = RGMPyoffset + RGMPheight - (short) ((long) y0 * RGMPheight / INYMAX);
  90.     x1 = RGMPxoffset + (short) ((long) x1 * RGMPwidth/INXMAX);
  91.     y1 = RGMPyoffset + RGMPheight - (short) ((long) y1 * RGMPheight / INYMAX);
  92.  
  93.     MoveTo(x0,y0);
  94.     LineTo(x1,y1);
  95.     return 0;
  96. }
  97.  
  98. void    RGMPinfo(short w, short v, short a, short b, short c, short d)
  99. {
  100. #pragma unused(w, v, a, b, c, d)
  101. }
  102.  
  103. void    RGMPdataline(short blah, short blam, short bluh)
  104. {
  105.     UNUSED_ARG(blah)
  106.     UNUSED_ARG(blam)
  107.     UNUSED_ARG(bluh)
  108. }
  109.  
  110. void    RGMPcharmode(short w, short rotation, short size)
  111. {
  112.     UNUSED_ARG(w)
  113.     UNUSED_ARG(rotation)
  114.     UNUSED_ARG(size)
  115. }
  116.  
  117. short    RGMPsize(Rect *incoming)
  118. {
  119.     RGMPheight= incoming->bottom-incoming->top;
  120.     RGMPwidth = incoming->right - incoming->left;
  121.     RGMPyoffset= incoming->top;
  122.     RGMPxoffset= incoming->left; 
  123.  
  124.     return(0);
  125. }
  126.