home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / devices / prtbase.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  6KB  |  168 lines

  1. #ifndef  DEVICES_PRTBASE_H
  2. #define  DEVICES_PRTBASE_H
  3. /*
  4. **    $VER: prtbase.h 1.10 (2.11.90)
  5. **    Includes Release 40.15
  6. **
  7. **    printer.device base structure definitions
  8. **
  9. **    (C) Copyright 1987-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef  EXEC_TYPES_H
  14. #include "exec/types.h"
  15. #endif
  16. #ifndef  EXEC_NODES_H
  17. #include "exec/nodes.h"
  18. #endif
  19. #ifndef  EXEC_LISTS_H
  20. #include "exec/lists.h"
  21. #endif
  22. #ifndef  EXEC_PORTS_H
  23. #include "exec/ports.h"
  24. #endif
  25. #ifndef  EXEC_LIBRARIES_H
  26. #include "exec/libraries.h"
  27. #endif
  28. #ifndef  EXEC_TASKS_H
  29. #include "exec/tasks.h"
  30. #endif
  31.  
  32. #ifndef  DEVICES_PARALLEL_H
  33. #include "devices/parallel.h"
  34. #endif
  35. #ifndef  DEVICES_SERIAL_H
  36. #include "devices/serial.h"
  37. #endif
  38. #ifndef  DEVICES_TIMER_H
  39. #include "devices/timer.h"
  40. #endif
  41. #ifndef  LIBRARIES_DOSEXTENS_H
  42. #include "libraries/dosextens.h"
  43. #endif
  44. #ifndef  INTUITION_INTUITION_H
  45. #include "intuition/intuition.h"
  46. #endif
  47.  
  48.  
  49. struct DeviceData {
  50.     struct Library dd_Device; /* standard library node */
  51.     APTR dd_Segment;          /* A0 when initialized */
  52.     APTR dd_ExecBase;          /* A6 for exec */
  53.     APTR dd_CmdVectors;       /* command table for device commands */
  54.     APTR dd_CmdBytes;          /* bytes describing which command queue */
  55.     UWORD   dd_NumCommands;   /* the number of commands supported */
  56. };
  57.  
  58. #define P_OLDSTKSIZE    0x0800    /* stack size for child task (OBSOLETE) */
  59. #define P_STKSIZE    0x1000    /* stack size for child task */
  60. #define P_BUFSIZE    256    /* size of internal buffers for text i/o */
  61. #define P_SAFESIZE    128    /* safety margin for text output buffer */
  62.  
  63. struct     PrinterData {
  64.     struct DeviceData pd_Device;
  65.     struct MsgPort pd_Unit;    /* the one and only unit */
  66.     BPTR pd_PrinterSegment;    /* the printer specific segment */
  67.     UWORD pd_PrinterType;    /* the segment printer type */
  68.                 /* the segment data structure */
  69.     struct PrinterSegment *pd_SegmentData;
  70.     UBYTE *pd_PrintBuf;    /* the raster print buffer */
  71.     int (*pd_PWrite)();    /* the write function */
  72.     int (*pd_PBothReady)();    /* write function's done */
  73.     union {            /* port I/O request 0 */
  74.         struct IOExtPar pd_p0;
  75.         struct IOExtSer pd_s0;
  76.     } pd_ior0;
  77.  
  78. #define  pd_PIOR0 pd_ior0.pd_p0
  79. #define  pd_SIOR0 pd_ior0.pd_s0
  80.  
  81.     union {            /*   and 1 for double buffering */
  82.         struct IOExtPar pd_p1;
  83.         struct IOExtSer pd_s1;
  84.     } pd_ior1;
  85.  
  86. #define  pd_PIOR1 pd_ior1.pd_p1
  87. #define  pd_SIOR1 pd_ior1.pd_s1
  88.  
  89.     struct timerequest pd_TIOR;    /* timer I/O request */
  90.     struct MsgPort pd_IORPort;    /* and message reply port */
  91.     struct Task pd_TC;        /* write task */
  92.     UBYTE pd_OldStk[P_OLDSTKSIZE];    /* and stack space (OBSOLETE) */
  93.     UBYTE pd_Flags;            /* device flags */
  94.     UBYTE pd_pad;            /* padding */
  95.     struct Preferences pd_Preferences;    /* the latest preferences */
  96.     UBYTE pd_PWaitEnabled;        /* wait function switch */
  97.     /* new fields for V2.0 */
  98.     UBYTE pd_Flags1;        /* padding */
  99.     UBYTE pd_Stk[P_STKSIZE];    /* stack space */
  100. };
  101.  
  102. /* Printer Class */
  103. #define PPCB_GFX    0    /* graphics (bit position) */
  104. #define PPCF_GFX    0x1    /* graphics (and/or flag) */
  105. #define PPCB_COLOR    1    /* color (bit position) */
  106. #define PPCF_COLOR    0x2    /* color (and/or flag) */
  107.  
  108. #define PPC_BWALPHA    0x00    /* black&white alphanumerics */
  109. #define PPC_BWGFX    0x01    /* black&white graphics */
  110. #define PPC_COLORALPHA    0x02    /* color alphanumerics */
  111. #define PPC_COLORGFX    0x03    /* color graphics */
  112.  
  113. /* Color Class */
  114. #define    PCC_BW        0x01    /* black&white only */
  115. #define    PCC_YMC        0x02    /* yellow/magenta/cyan only */
  116. #define    PCC_YMC_BW    0x03    /* yellow/magenta/cyan or black&white */
  117. #define    PCC_YMCB    0x04    /* yellow/magenta/cyan/black */
  118. #define    PCC_4COLOR    0x04    /* a flag for YMCB and BGRW */
  119. #define    PCC_ADDITIVE    0x08    /* not ymcb but blue/green/red/white */
  120. #define    PCC_WB        0x09    /* black&white only, 0 == BLACK */
  121. #define    PCC_BGR        0x0A    /* blue/green/red */
  122. #define    PCC_BGR_WB    0x0B    /* blue/green/red or black&white */
  123. #define    PCC_BGRW    0x0C    /* blue/green/red/white */
  124. /*
  125.     The picture must be scanned once for each color component, as the
  126.     printer can only define one color at a time.  ie. If 'PCC_YMC' then
  127.     first pass sends all 'Y' info to printer, second pass sends all 'M'
  128.     info, and third pass sends all C info to printer.  The CalComp
  129.     PlotMaster is an example of this type of printer.
  130. */
  131. #define PCC_MULTI_PASS    0x10    /* see explanation above */
  132.  
  133. struct PrinterExtendedData {
  134.     char    *ped_PrinterName;    /* printer name, null terminated */
  135.     VOID    (*ped_Init)();         /* called after LoadSeg */
  136.     VOID    (*ped_Expunge)();    /* called before UnLoadSeg */
  137.     int    (*ped_Open)();         /* called at OpenDevice */
  138.     VOID    (*ped_Close)();      /* called at CloseDevice */
  139.     UBYTE    ped_PrinterClass;    /* printer class */
  140.     UBYTE    ped_ColorClass;      /* color class */
  141.     UBYTE    ped_MaxColumns;      /* number of print columns available */
  142.     UBYTE    ped_NumCharSets;     /* number of character sets */
  143.     UWORD    ped_NumRows;         /* number of 'pins' in print head */
  144.     ULONG    ped_MaxXDots;         /* number of dots max in a raster dump */
  145.     ULONG    ped_MaxYDots;         /* number of dots max in a raster dump */
  146.     UWORD    ped_XDotsInch;         /* horizontal dot density */
  147.     UWORD    ped_YDotsInch;         /* vertical dot density */
  148.     char    ***ped_Commands;     /* printer text command table */
  149.     int    (*ped_DoSpecial)();  /* special command handler */
  150.     int    (*ped_Render)();     /* raster render function */
  151.     LONG    ped_TimeoutSecs;     /* good write timeout */
  152.     /* the following only exists if the segment version is >= 33 */
  153.     char    **ped_8BitChars;     /* conv. strings for the extended font */
  154.     LONG    ped_PrintMode;         /* set if text printed, otherwise 0 */
  155.     /* the following only exists if the segment version is >= 34 */
  156.     /* ptr to conversion function for all chars */
  157.     int    (*ped_ConvFunc)();
  158. };
  159.  
  160. struct PrinterSegment {
  161.     ULONG   ps_NextSegment;     /* (actually a BPTR) */
  162.     ULONG   ps_runAlert;     /* MOVEQ #0,D0 : RTS */
  163.     UWORD   ps_Version;     /* segment version */
  164.     UWORD   ps_Revision;     /* segment revision */
  165.     struct  PrinterExtendedData ps_PED;   /* printer extended data */
  166. };
  167. #endif
  168.