home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / bsd / dev / npio.h < prev    next >
Text File  |  1992-07-29  |  3KB  |  84 lines

  1. /*
  2.  * Copyright (c) 1988 by NeXT, Inc.
  3.  *
  4.  * HISTORY
  5.  *  8-Mar-88  Peter King (king) at NeXT, Inc.
  6.  *    Created.
  7.  */
  8.  
  9. /*
  10.  * Structures and definitions for NeXT Laser Printer io control commands
  11.  */
  12.  
  13. #ifndef    _M68K_DEV_NPIO_
  14. #define    _M68K_DEV_NPIO_
  15.  
  16. /* Paper types */
  17. enum np_papersize { NOCASSETTE, A4, LETTER, B5, LEGAL };
  18.  
  19. /* Structure for NPIOCPOP - printer op command */
  20. #define    NPIOCPOP    _IOWR('p', 1, struct npop) /* do a printer op */
  21.  
  22. struct npop {
  23.     short    np_op;        /* operations defined below */
  24.     union {
  25.         int        npd_power; /* Power */
  26.         unsigned char    npd_resolution; /* 300/400 DPI */
  27.         struct {
  28.             int    left; /* # of bits to indent on left */
  29.             int    top;  /* # of lines from top of page */
  30.                 /*
  31.                  * NOTE: less than a 200 line top margin
  32.                  *     is questionable.  Experiment.
  33.                  */
  34.             int    width; /* width in #'s of longwords  */
  35.             int    height;    /* height in lines */
  36.         }        npd_margins;
  37.         struct np_stat {
  38.             u_int    flags;
  39.             u_int    retrans;
  40.         }        npd_status;
  41.         enum np_papersize    npd_size;
  42.         boolean_t        npd_bool;
  43.     } np_Data;
  44. };
  45. #define    np_power    np_Data.npd_power
  46. #define    np_margins    np_Data.npd_margins
  47. #define    np_resolution    np_Data.npd_resolution
  48. #define    np_status    np_Data.npd_status
  49. #define    np_size        np_Data.npd_size
  50. #define    np_bool        np_Data.npd_bool
  51.  
  52. /* operations */
  53. #define    NPSETPOWER    0    /* turn the printer on/off */
  54. #define    NPSETMARGINS    1    /* Set the printer margins */
  55. #define    NPSETRESOLUTION    2    /* Set the printer resolution */
  56. #define    NPGETSTATUS    3    /* Get the printer status */
  57. #define    NPCLEARRETRANS    4    /* Clear the retransmit counter */
  58. #define    NPGETPAPERSIZE    5    /* Get the paper size */
  59. #define    NPSETMANUALFEED    6    /* Set manual feed based on npop.np_bool */
  60.  
  61. /* resolutions */
  62. #define    DPI300        0
  63. #define    DPI400        1
  64.  
  65. /* Status bits */
  66. #define    NPPAPERDELIVERY    0x0001    /* Paper is being processed in the printer */
  67. #define    NPDATARETRANS    0x0002    /* Data should be retransmitted due to jam
  68.                    or poor video signal.  Number of pages
  69.                    is in npop.np_stat.retrans.  Clear this
  70.                    with the NPCLEARRETRANS command. */
  71. #define    NPCOLD        0x0004    /* Fixing assembly not yet hot enough */
  72. #define    NPNOCARTRIDGE    0x0008    /* No cartridge in printer */
  73. #define    NPNOPAPER    0x0010    /* No paper in printer */
  74. #define    NPPAPERJAM    0x0020    /* Paper jam */
  75. #define    NPDOOROPEN    0x0040    /* Door open */
  76. #define    NPNOTONER    0x0080    /* Toner low */
  77. #define    NPHARDWAREBAD    0(@0    /* Hardware failure - see other bad bits */
  78. #define    NPMANUALFEED    0x0200    /* Manual feed selected */
  79. #define    NPFUSERBAD    0x0400    /* Fixing assembly malfunction */
  80. #define NPLASERBAD    0x0800    /* Poor Beam Detect signal */
  81. #define NPMOTORBAD    0x1000    /* Scanning motor malfunction */
  82.  
  83. #endif    _M68K_DEV_NPIO_
  84.