home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / maths / plplot / plplot_2 / drivers / null.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-19  |  3.5 KB  |  145 lines

  1. /* $Id: null.c,v 1.12 1994/07/19 22:30:25 mjl Exp $
  2.  * $Log: null.c,v $
  3.  * Revision 1.12  1994/07/19  22:30:25  mjl
  4.  * All device drivers: enabling macro renamed to PLD_<driver>, where <driver>
  5.  * is xwin, ps, etc.  See plDevs.h for more detail.
  6.  *
  7.  * Revision 1.11  1994/03/23  06:34:32  mjl
  8.  * All drivers: cleaned up by eliminating extraneous includes (stdio.h and
  9.  * stdlib.h now included automatically by plplotP.h), extraneous clears
  10.  * of pls->fileset, pls->page, and pls->OutFile = NULL (now handled in
  11.  * driver interface or driver initialization as appropriate).  Special
  12.  * handling for malloc includes eliminated (no longer needed) and malloc
  13.  * prototypes fixed as necessary.
  14. */
  15.  
  16. /*    null.c
  17.  
  18.     PLPLOT Null device driver.
  19. */
  20. #include "plDevs.h"
  21.  
  22. #ifdef PLD_null
  23.  
  24. #include "plplotP.h"
  25. #include "drivers.h"
  26.  
  27. /*----------------------------------------------------------------------*\
  28. * plD_init_null()
  29. *
  30. * Initialize device (terminal).
  31. \*----------------------------------------------------------------------*/
  32.  
  33. void
  34. plD_init_null(PLStream *pls)
  35. {
  36.     int xmin = 0;
  37.     int xmax = PIXELS_X - 1;
  38.     int ymin = 0;
  39.     int ymax = PIXELS_Y - 1;
  40.  
  41.     float pxlx = (double) PIXELS_X / (double) LPAGE_X;
  42.     float pxly = (double) PIXELS_Y / (double) LPAGE_Y;
  43.  
  44.     printf("Sending output to Null device..\n");
  45.  
  46.     pls->termin = 0;        /* not an interactive terminal */
  47.     pls->icol0 = 1;
  48.     pls->color = 0;
  49.     pls->width = 1;
  50.     pls->bytecnt = 0;
  51.     pls->page = 0;
  52.  
  53. /* Set up device parameters */
  54.  
  55.     plP_setpxl(pxlx, pxly);
  56.     plP_setphy(xmin, xmax, ymin, ymax);
  57. }
  58.  
  59. /*----------------------------------------------------------------------*\
  60. * plD_line_null()
  61. *
  62. * Draw a line in the current color from (x1,y1) to (x2,y2).
  63. \*----------------------------------------------------------------------*/
  64.  
  65. void
  66. plD_line_null(PLStream *pls, short x1a, short y1a, short x2a, short y2a)
  67. {
  68. }
  69.  
  70. /*----------------------------------------------------------------------*\
  71. * plD_polyline_null()
  72. *
  73. * Draw a polyline in the current color.
  74. \*----------------------------------------------------------------------*/
  75.  
  76. void
  77. plD_polyline_null(PLStream *pls, short *xa, short *ya, PLINT npts)
  78. {
  79. }
  80.  
  81. /*----------------------------------------------------------------------*\
  82. * plD_eop_null()
  83. *
  84. * End of page.
  85. \*----------------------------------------------------------------------*/
  86.  
  87. void
  88. plD_eop_null(PLStream *pls)
  89. {
  90. }
  91.  
  92. /*----------------------------------------------------------------------*\
  93. * plD_bop_null()
  94. *
  95. * Set up for the next page.
  96. * Advance to next family file if necessary (file output).
  97. \*----------------------------------------------------------------------*/
  98.  
  99. void
  100. plD_bop_null(PLStream *pls)
  101. {
  102. }
  103.  
  104. /*----------------------------------------------------------------------*\
  105. * plD_tidy_null()
  106. *
  107. * Close graphics file or otherwise clean up.
  108. \*----------------------------------------------------------------------*/
  109.  
  110. void
  111. plD_tidy_null(PLStream *pls)
  112. {
  113. }
  114.  
  115. /*----------------------------------------------------------------------*\
  116. * plD_state_null()
  117. *
  118. * Handle change in PLStream state (color, pen width, fill attribute, etc).
  119. \*----------------------------------------------------------------------*/
  120.  
  121. void 
  122. plD_state_null(PLStream *pls, PLINT op)
  123. {
  124. }
  125.  
  126. /*----------------------------------------------------------------------*\
  127. * plD_esc_null()
  128. *
  129. * Escape function.
  130. \*----------------------------------------------------------------------*/
  131.  
  132. void
  133. plD_esc_null(PLStream *pls, PLINT op, void *ptr)
  134. {
  135. }
  136.  
  137. #else
  138. int 
  139. pldummy_null()
  140. {
  141.     return 0;
  142. }
  143.  
  144. #endif                /* PLD_nulldev */
  145.