1 #ifndef DEVICES_PRTBASE_H
2 #define DEVICES_PRTBASE_H
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 Desc: printer driver structures and tags
13 #ifndef UTILITY_TAGITEM_H
14 # include <utility/tagitem.h>
17 #ifndef EXEC_DEVICES_H
18 # include <exec/devices.h>
21 #ifndef DEVICES_PARALLEL_H
22 # include <devices/parallel.h>
25 #ifndef DEVICES_SERIAL_H
26 # include <devices/serial.h>
29 #ifndef DEVICES_TIMER_H
30 # include <devices/timer.h>
33 #ifndef DOS_DOSEXTENS_H
34 # include <dos/dosextens.h>
37 #ifndef INTUITION_INTUITION_H
38 # include <intuition/intuition.h>
43 struct Library dd_Device
;
55 #define IOB_SERVICING 6
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)
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) */
79 #define DUF_STOPPED (1L << DUB_STOPPED)
81 #define P_OLDSTKSIZE 0x0800
82 #define P_STKSIZE AROS_STACKSIZE /* 0x1000 in AmigaOS */
84 #define P_SAFESIZE 128
90 struct DeviceData pd_Device
;
91 struct MsgPort pd_Unit
;
92 BPTR pd_PrinterSegment
;
94 struct PrinterSegment
*pd_SegmentData
;
96 LONG (*pd_PWrite
)(APTR data
, LONG len
);
97 LONG (*pd_PBothReady
)(VOID
);
100 struct IOExtPar pd_p0
;
101 struct IOExtSer pd_s0
;
105 struct IOExtPar pd_p1
;
106 struct IOExtSer pd_s1
;
108 struct timerequest pd_TIOR
;
109 struct MsgPort pd_IORPort
;
111 UBYTE pd_OldStk
[P_OLDSTKSIZE
];
114 struct Preferences pd_Preferences
;
115 UBYTE pd_PWaitEnabled
;
117 UBYTE pd_Stk
[P_STKSIZE
];
118 struct PrinterUnit
*pd_PUnit
;
119 LONG (*pd_PRead
)(char * buffer
, LONG
*length
, struct timeval
*tv
);
120 LONG (*pd_CallErrHook
)(struct Hook
*hook
, union printerIO
*ior
, struct PrtErrMsg
*pem
);
122 STRPTR pd_DriverName
;
123 LONG (*pd_PQuery
)(LONG
*numofchars
);
126 #define pd_PIOR0 pd_ior0.pd_p0
127 #define pd_SIOR0 pd_ior0.pd_s0
129 #define pd_PIOR1 pd_ior1.pd_p1
130 #define pd_SIOR1 pd_ior1.pd_s1
137 #define PPCF_COLOR 0x2
139 #define PPC_BWALPHA 0x00
140 #define PPC_BWGFX 0x01
141 #define PPC_COLORALPHA 0x02
142 #define PPC_COLORGFX 0x03
144 #define PPCB_EXTENDED 2
145 #define PPCF_EXTENDED 0x4
147 #define PPCB_NOSTRIP 3
148 #define PPCF_NOSTRIP 0x8
154 #define PCC_YMC_BW 0x03
155 #define PCC_YMCB 0x04
156 #define PCC_4COLOR 0x04
157 #define PCC_ADDITIVE 0x08
160 #define PCC_BGR_WB 0x0B
161 #define PCC_BGRW 0x0C
162 #define PCC_MULTI_PASS 0x10
164 struct PrinterExtendedData
166 char *ped_PrinterName
;
167 VOID (*ped_Init
)(struct PrinterData
*pd
);
168 VOID (*ped_Expunge
)(VOID
);
169 LONG (*ped_Open
)(union printerIO
*ior
);
170 VOID (*ped_Close
)(union printerIO
*ior
);
171 UBYTE ped_PrinterClass
;
172 UBYTE ped_ColorClass
;
173 UBYTE ped_MaxColumns
;
174 UBYTE ped_NumCharSets
;
180 STRPTR
**ped_Commands
;
181 LONG (*ped_DoSpecial
)(UWORD
*command
,
182 UBYTE output_buffer
[],
183 BYTE
*current_line_position
,
184 BYTE
*current_line_spacing
,
187 LONG (*ped_Render
)(LONG ct
, LONG x
, LONG y
, LONG status
);
188 LONG ped_TimeoutSecs
;
189 STRPTR
*ped_8BitChars
;
191 LONG (*ped_ConvFunc
)(UBYTE
*buf
, UBYTE c
, LONG crlf_flag
);
192 struct TagItem
*ped_TagList
;
193 LONG (*ped_DoPreferences
)(union printerIO
*ior
, LONG command
);
194 VOID (*ped_CallErrHook
)(union printerIO
*ior
, struct Hook
*hook
);
197 /* Tags to define more printer driver features */
199 #define PRTA_Dummy (TAG_USER + 0x50000)
200 #define PRTA_8BitGuns (PRTA_Dummy + 1)
201 #define PRTA_ConvertSource (PRTA_Dummy + 2)
202 #define PRTA_FloydDithering (PRTA_Dummy + 3)
203 #define PRTA_AntiAlias (PRTA_Dummy + 4)
204 #define PRTA_ColorCorrection (PRTA_Dummy + 5)
205 #define PRTA_NoIO (PRTA_Dummy + 6)
206 #define PRTA_NewColor (PRTA_Dummy + 7)
207 #define PRTA_ColorSize (PRTA_Dummy + 8)
208 #define PRTA_NoScaling (PRTA_Dummy + 9)
211 #define PRTA_DitherNames (PRTA_Dummy + 20)
212 #define PRTA_ShadingNames (PRTA_Dummy + 21)
213 #define PRTA_ColorCorrect (PRTA_Dummy + 22)
214 #define PRTA_DensityInfo (PRTA_Dummy + 23)
216 /* Hardware page borders */
217 #define PRTA_LeftBorder (PRTA_Dummy + 30)
218 #define PRTA_TopBorder (PRTA_Dummy + 31)
220 #define PRTA_MixBWColor (PRTA_Dummy + 32)
222 /* Driver Preferences */
223 #define PRTA_Preferences (PRTA_Dummy + 40)
225 /****************************************************************************/
227 struct PrinterSegment
233 struct PrinterExtendedData ps_PED
;
236 /****************************************************************************/
238 struct PrtDriverPreferences
241 UBYTE pdp_PrinterID
[32];
242 char pdp_PrefName
[FILENAME_SIZE
-16];
243 ULONG pdp_Length
; /* size of this structure */
245 /* .. more driver private fields following .. */
248 #endif /* DEVICES_PRTBASE_H */