Snoopy: print correct title for OpenResource patch.
[AROS.git] / compiler / include / devices / prtbase.h
bloba00d76a53760a02b894435a3ac9c9bbe037a0819
1 #ifndef DEVICES_PRTBASE_H
2 #define DEVICES_PRTBASE_H
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: printer driver structures and tags
9 Lang: english
13 #ifndef UTILITY_TAGITEM_H
14 # include <utility/tagitem.h>
15 #endif
17 #ifndef EXEC_DEVICES_H
18 # include <exec/devices.h>
19 #endif
21 #ifndef DEVICES_PARALLEL_H
22 # include <devices/parallel.h>
23 #endif
25 #ifndef DEVICES_SERIAL_H
26 # include <devices/serial.h>
27 #endif
29 #ifndef DEVICES_TIMER_H
30 # include <devices/timer.h>
31 #endif
33 #ifndef DOS_DOSEXTENS_H
34 # include <dos/dosextens.h>
35 #endif
37 #ifndef INTUITION_INTUITION_H
38 # include <intuition/intuition.h>
39 #endif
41 struct DeviceData
43 struct Library dd_Device;
44 APTR dd_Segment;
45 APTR dd_ExecBase;
46 APTR dd_CmdVectors;
47 APTR dd_CmdBytes;
48 UWORD dd_NumCommands;
51 /* IO Flags */
53 #define IOB_QUEUED 4
54 #define IOB_CURRENT 5
55 #define IOB_SERVICING 6
56 #define IOB_DONE 7
58 #define IOF_QUEUED (1L << IOB_QUEUED)
59 #define IOF_CURRENT (1L << IOB_CURRENT)
60 #define IOF_SERVICING (1L << IOB_SERVICING)
61 #define IOF_DONE (1L << IOB_DONE)
63 /* pd_Flags */
65 #define PB_IOR0 0
66 #define PB_IOR1 1
67 #define PB_IOOPENED 2
68 #define PB_EXPUNGED 7
70 #define PBF_IOR0 (1L << PB_IOR0)
71 #define PBF_IOR1 (1L << PB_IOR1)
72 #define PBF_IOOPENDED (1L << PB_IOOPENED)
73 #define PBF_EXPUNGED (1L << PB_EXPUNGED)
75 /* du_Flags (actually placed in pd_Unit.mp_Node.ln_Pri) */
77 #define DUB_STOPPED 0
79 #define DUF_STOPPED (1L << DUB_STOPPED)
81 #define P_OLDSTKSIZE 0x0800 /* Unused */
82 #define P_STKSIZE 0x1000 /* Unused */
83 #define P_BUFSIZE 256
84 #define P_SAFESIZE 128
86 union printerIO;
88 struct PrinterData
90 struct DeviceData pd_Device;
91 struct MsgPort pd_Unit;
92 BPTR pd_PrinterSegment;
93 UWORD pd_PrinterType;
94 struct PrinterSegment *pd_SegmentData;
95 UBYTE *pd_PrintBuf;
96 LONG (*pd_PWrite)(APTR data, LONG len);
97 LONG (*pd_PBothReady)(VOID);
98 union
100 struct IOExtPar pd_p0;
101 struct IOExtSer pd_s0;
102 struct IOStdReq pd_i0;
103 } pd_ior0;
104 union
106 struct IOExtPar pd_p1;
107 struct IOExtSer pd_s1;
108 struct IOStdReq pd_i1;
109 } pd_ior1;
110 struct timerequest pd_TIOR;
111 struct MsgPort pd_IORPort;
112 struct Task pd_TC;
113 UBYTE pd_OldStk[P_OLDSTKSIZE];
114 UBYTE pd_Flags;
115 UBYTE pd_pad;
116 struct Preferences pd_Preferences;
117 UBYTE pd_PWaitEnabled;
118 UBYTE pd_Flags1;
119 UBYTE pd_Stk[P_STKSIZE];
120 struct PrinterUnit *pd_PUnit;
121 LONG (*pd_PRead)(char * buffer, LONG *length, struct timeval *tv);
122 LONG (*pd_CallErrHook)(struct Hook *hook, union printerIO *ior, struct PrtErrMsg *pem);
123 ULONG pd_UnitNumber;
124 STRPTR pd_DriverName;
125 LONG (*pd_PQuery)(LONG *numofchars);
128 #define pd_PIOR0 pd_ior0.pd_p0
129 #define pd_SIOR0 pd_ior0.pd_s0
131 #define pd_PIOR1 pd_ior1.pd_p1
132 #define pd_SIOR1 pd_ior1.pd_s1
134 /* Printer Class */
136 #define PPCB_GFX 0
137 #define PPCF_GFX 0x1
138 #define PPCB_COLOR 1
139 #define PPCF_COLOR 0x2
141 #define PPC_BWALPHA 0x00
142 #define PPC_BWGFX 0x01
143 #define PPC_COLORALPHA 0x02
144 #define PPC_COLORGFX 0x03
146 #define PPCB_EXTENDED 2
147 #define PPCF_EXTENDED 0x4
149 #define PPCB_NOSTRIP 3
150 #define PPCF_NOSTRIP 0x8
152 /* Color Class */
154 #define PCC_BW 0x01 /* Black & White */
155 #define PCC_YMC 0x02 /* Cyan, Yellow, and Magenta printer */
156 #define PCC_YMC_BW 0x03 /* CYM *or* BW printer */
157 #define PCC_YMCB 0x04 /* CYMK printer */
158 #define PCC_4COLOR 0x04 /* Flag for PCC_YMCB and PCC_BGRW */
159 #define PCC_ADDITIVE 0x08 /* Blue, Green, Red, White */
160 #define PCC_WB 0x09 /* White-on-Black printer */
161 #define PCC_BGR 0x0A /* BGR printer */
162 #define PCC_BGR_WB 0x0B /* BGR *or* black & white */
163 #define PCC_BGRW 0x0C /* Blue, Green, Red, White */
164 #define PCC_MULTI_PASS 0x10 /* Flag for full page, one-pass-per-color */
166 struct PrinterExtendedData
168 char *ped_PrinterName;
169 LONG (*ped_Init)(struct PrinterData *pd); /* return 0 for success */
170 VOID (*ped_Expunge)(VOID);
171 LONG (*ped_Open)(union printerIO *ior); /* return 0 for success */
172 VOID (*ped_Close)(union printerIO *ior);
173 UBYTE ped_PrinterClass;
174 UBYTE ped_ColorClass;
175 UBYTE ped_MaxColumns;
176 UBYTE ped_NumCharSets;
177 UWORD ped_NumRows;
178 ULONG ped_MaxXDots;
179 ULONG ped_MaxYDots;
180 UWORD ped_XDotsInch;
181 UWORD ped_YDotsInch;
182 STRPTR *ped_Commands;
183 LONG (*ped_DoSpecial)(UWORD *command,
184 UBYTE output_buffer[],
185 BYTE *current_line_position,
186 BYTE *current_line_spacing,
187 BYTE *crlf_flag,
188 UBYTE params[]);
189 LONG (*ped_Render)(SIPTR ct, LONG x, LONG y, LONG status);
190 LONG ped_TimeoutSecs;
191 /* Version 33 and above drivers */
192 STRPTR *ped_8BitChars;
193 LONG ped_PrintMode;
194 /* Version 34 and above drivers */
195 LONG (*ped_ConvFunc)(UBYTE *buf, UBYTE c, LONG crlf_flag);
196 /* Version 44 and above drivers, with PPCF_EXTENDED */
197 struct TagItem *ped_TagList;
198 LONG (*ped_DoPreferences)(union printerIO *ior, LONG command);
199 VOID (*ped_CallErrHook)(union printerIO *ior, struct Hook *hook);
202 /* Tags to define more printer driver features */
204 #define PRTA_Dummy (TAG_USER + 0x50000)
205 #define PRTA_8BitGuns (PRTA_Dummy + 1)
206 #define PRTA_ConvertSource (PRTA_Dummy + 2)
207 #define PRTA_FloydDithering (PRTA_Dummy + 3)
208 #define PRTA_AntiAlias (PRTA_Dummy + 4)
209 #define PRTA_ColorCorrection (PRTA_Dummy + 5)
210 #define PRTA_NoIO (PRTA_Dummy + 6)
211 #define PRTA_NewColor (PRTA_Dummy + 7)
212 #define PRTA_ColorSize (PRTA_Dummy + 8)
213 #define PRTA_NoScaling (PRTA_Dummy + 9)
215 /* User interface */
216 #define PRTA_DitherNames (PRTA_Dummy + 20)
217 #define PRTA_ShadingNames (PRTA_Dummy + 21)
218 #define PRTA_ColorCorrect (PRTA_Dummy + 22)
219 #define PRTA_DensityInfo (PRTA_Dummy + 23)
221 /* Hardware page borders */
222 #define PRTA_LeftBorder (PRTA_Dummy + 30)
223 #define PRTA_TopBorder (PRTA_Dummy + 31)
225 #define PRTA_MixBWColor (PRTA_Dummy + 32)
227 /* Driver Preferences */
228 #define PRTA_Preferences (PRTA_Dummy + 40)
230 /****************************************************************************/
232 struct PrinterSegment
234 BPTR ps_NextSegment;
235 ULONG ps_runAlert;
236 UWORD ps_Version;
237 UWORD ps_Revision;
238 struct PrinterExtendedData ps_PED;
241 /****************************************************************************/
243 struct PrtDriverPreferences
245 UWORD pdp_Version;
246 UBYTE pdp_PrinterID[32];
247 char pdp_PrefName[FILENAME_SIZE-16];
248 ULONG pdp_Length; /* size of this structure */
250 /* .. more driver private fields following .. */
253 #endif /* DEVICES_PRTBASE_H */