home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_1.3 / Read-Me1.3 / Printer1.3 / Driver.Examples / src / hp / density.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-01  |  824 b   |  30 lines

  1. /*
  2.     Density module for HP_LaserJet
  3.     David Berezowski - May/87
  4. */
  5.  
  6. #include <exec/types.h>
  7. #include "../printer/printer.h"
  8. #include "../printer/prtbase.h"
  9.  
  10. SetDensity(density_code)
  11. ULONG density_code;
  12. {
  13.     extern struct PrinterExtendedData *PED;
  14.     extern char StartCmd[];
  15.  
  16.     /* SPECIAL_DENSITY     0   1   2    3    4    5    6    7 */
  17.     static int XDPI[8] = {75, 75, 100, 150, 300, 300, 300, 300};
  18.     static char codes[8][3] = {
  19.         "075", "075", "100", "150", "300", "300", "300", "300"
  20.     };
  21.  
  22.     density_code /= SPECIAL_DENSITY1;
  23.     PED->ped_MaxXDots = XDPI[density_code] * 8; /* 8 inches */
  24.     PED->ped_MaxYDots = XDPI[density_code] * 10; /* 10 inches */
  25.     PED->ped_XDotsInch = PED->ped_YDotsInch = XDPI[density_code];
  26.     StartCmd[8] = codes[density_code][0];
  27.     StartCmd[9] = codes[density_code][1];
  28.     StartCmd[10] = codes[density_code][2];
  29. }
  30.